From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15730 invoked by alias); 20 Jun 2005 09:05:07 -0000 Mailing-List: contact ecos-discuss-help@ecos.sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: ecos-discuss-owner@ecos.sourceware.org Received: (qmail 15631 invoked by uid 22791); 20 Jun 2005 09:04:52 -0000 Received: from ns2328.ovh.net (HELO ns1.neotion.com) (213.186.42.156) by sourceware.org (qpsmtpd/0.30-dev) with ESMTP; Mon, 20 Jun 2005 09:04:52 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by ns1.neotion.com (Postfix) with ESMTP id D31A0F8013; Mon, 20 Jun 2005 10:56:36 +0200 (CEST) Received: from ns1.neotion.com ([127.0.0.1]) by localhost (ns1.neotion.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 20300-01; Mon, 20 Jun 2005 10:56:36 +0200 (CEST) Received: from srvmail.neotion.com (mail-relay.neotion.int [192.168.3.1]) by ns1.neotion.com (Postfix) with ESMTP id 4D8D3F8002; Mon, 20 Jun 2005 10:56:36 +0200 (CEST) Received: from localhost (localhost.atsky.fr [127.0.0.1]) by srvmail.neotion.com (Postfix) with ESMTP id 50EB43B001C; Mon, 20 Jun 2005 11:04:49 +0200 (CEST) Received: from srvmail.neotion.com ([127.0.0.1]) by localhost (srvmail.neotion.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 27106-01; Mon, 20 Jun 2005 11:04:49 +0200 (CEST) Received: from passerelle.neotion.int (passerelle.neotion.int [10.0.0.141]) by srvmail.neotion.com (Postfix) with ESMTP id 14E623B0019; Mon, 20 Jun 2005 11:04:49 +0200 (CEST) Received: from localhost (localhost.neotion.int [127.0.0.1]) by passerelle.neotion.int (Postfix) with ESMTP id 4345EB80016; Mon, 20 Jun 2005 11:10:40 +0200 (CEST) Received: from passerelle.neotion.int ([127.0.0.1]) by localhost (passerelle.neotion.int [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 30737-01; Mon, 20 Jun 2005 11:10:40 +0200 (CEST) Received: from ArnaudC (ArnaudC.neotion.int [190.50.0.20]) by passerelle.neotion.int (Postfix) with ESMTP id 1399EB8000B; Mon, 20 Jun 2005 11:10:40 +0200 (CEST) From: "Arnaud Chataignier" To: "'Gary Thomas'" , "'Nick Garnett'" Cc: "'Andrew Lunn'" , "'Sturle Mastberg'" , "'eCos Discussion'" Date: Mon, 20 Jun 2005 09:05:00 -0000 Message-ID: <001001c57577$1c629d30$140032be@ArnaudC> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable In-Reply-To: <1119013047.13965.253.camel@hermes> Subject: [ECOS] RE : [ECOS] Possible fix for duplicated ARP entries in the FreeBSDstack X-SW-Source: 2005-06/txt/msg00166.txt.bz2 Thank you all for the analysis. I was encountering this bug from a long time now, and fixing it is great news for me. One person did post a temporary patch to this problem a long time ago, but it didn't seem to really correct the cause of the problem, it was just avoiding it : http://sourceware.org/ml/ecos-discuss/2004-11/msg00150.html May anyone post a patch corresponding to this real correction ? As far as I understand, it is only a matter of changing the size of the sa_data member back to 14 ? Thank you, Arnaud. -----Message d'origine----- De : ecos-discuss-owner@ecos.sourceware.org [mailto:ecos-discuss-owner@ecos.sourceware.org] De la part de Gary Thomas Envoy=E9 : vendredi 17 juin 2005 14:57 =C0 : Nick Garnett Cc : Andrew Lunn; Sturle Mastberg; eCos Discussion Objet : Re: [ECOS] Possible fix for duplicated ARP entries in the FreeBSDstack On Fri, 2005-06-17 at 13:53 +0100, Nick Garnett wrote: > Andrew Lunn writes: >=20 > > On Fri, Jun 17, 2005 at 12:57:49PM +0200, Sturle Mastberg wrote: > > > Gary Thomas wrote: > > > >On Fri, 2005-06-17 at 10:52 +0200, Sturle Mastberg wrote: > > > > > > > >>Hello, > > > >> > > > >>For some time I've had problem with duplicated ARP entries that=20 > > > >>have > > > >>caused all sorts of problems. I searched the archive and discovered that=20 > > > >>the problem had been reported before: > > > >> > > > >> > > > >>http://sourceware.org/ml/ecos-discuss/2004-11/msg00097.html > > > >> > > > >> > > > >>My proposal to a fix is to make the sockaddr_inarp struct > > > >>(include/netinet/if_ether.h) equal in size to the sockaddr struct by=20 > > > >>padding it at the end. This is exactly what is done to the sockaddr_in=20 > > > >>struct (include/netinet/in.h) for different reasons. > > > >> > > > >> > > > >>I reached this conclusion after I discovered that two virutally > > > >>identical calls to rtalloc1 (net/route.c) returned different results.=20 > > > >>The first instance appears in arplookup (netinet/if_ether.c) where the=20 > > > >>first parameter to rtalloc1 is a struct sockaddr_inarp cast to a struct=20 > > > >>sockaddr. The second instance appears in ip_output (netinet/ip_output)=20 > > > >>via rtalloc_ign (net/route.c) where the first parameter to rtalloc1 is=20 > > > >>an actual struct sockaddr. The rtalloc1 function does a radix tree=20 > > > >>search with a call to the rn_match function (net/radix.c). A closer look=20 > > > >>at this code reveals that it does indeed depend on the size of the=20 > > > >>supplied struct. > > > >> > > > >> > > > >>The only conclusion a can draw from this is that the three=20 > > > >>structs: > > > >>sockaddr, sockaddr_in and sockaddr_inarp must all be of equal size. I=20 > > > >>have checked the FreeBSD source repository that this is the case for the=20 > > > >>original code. > > > >> > > > >> > > > >>While browsing the FreeBSD source repository I discovered that=20 > > > >>the > > > >>sa_data character array member of the sockaddr struct was increased in=20 > > > >>size in the eCos FreeBSD stack. Does anyone know why this increase was=20 > > > >>introduced in eCos? > >=20 > > I beleave Nick did this for IPv6. This bigger size allows an IPv6=20 > > address to be placed into a sockaddr which you cannot normally do. >=20 > I thought that initially and had a look. The change I made was to=20 > struct sockaddr_in to make it match the increased sockaddr size so=20 > that some punned data structures would match. I think the change to=20 > struct sockaddr was done by Gary during the initial port to make IPv6=20 > addresses fit correctly. I'm sure it all has something to do with the=20 > lack of user/kernel space and the fact that we don't copy things to=20 > and fro as much as the BSD kernel does. This is as I remember it as well. Note the comment in the structure (which I did not add or change) that bodes of this inconsistency. Of course, if someone has a better way to handle it, feel free to post a patch :-) --=20 ------------------------------------------------------------ Gary Thomas | Consulting for the MLB Associates | Embedded world ------------------------------------------------------------ --=20 Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss -- Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss