From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25746 invoked by alias); 17 Jun 2005 10:01:55 -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 25721 invoked by uid 22791); 17 Jun 2005 10:01:41 -0000 Received: from sta-206-168-96-204.rockynet.com (HELO hermes.chez-thomas.org) (206.168.96.204) by sourceware.org (qpsmtpd/0.30-dev) with ESMTP; Fri, 17 Jun 2005 10:01:41 +0000 Received: by hermes.chez-thomas.org (Postfix, from userid 2000) id D9B38100410; Fri, 17 Jun 2005 04:01:38 -0600 (MDT) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by hermes.chez-thomas.org (Postfix) with ESMTP id 3486A10005D; Fri, 17 Jun 2005 04:01:36 -0600 (MDT) From: Gary Thomas To: Sturle Mastberg Cc: eCos Discussion In-Reply-To: <42B28F30.1070905@tandberg.net> References: <42B28F30.1070905@tandberg.net> Content-Type: text/plain Date: Fri, 17 Jun 2005 10:01:00 -0000 Message-Id: <1119002495.13965.224.camel@hermes> Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: Re: [ECOS] Possible fix for duplicated ARP entries in the FreeBSD stack X-SW-Source: 2005-06/txt/msg00133.txt.bz2 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 have > caused all sorts of problems. I searched the archive and discovered that > 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 > padding it at the end. This is exactly what is done to the sockaddr_in > 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. > The first instance appears in arplookup (netinet/if_ether.c) where the > first parameter to rtalloc1 is a struct sockaddr_inarp cast to a struct > sockaddr. The second instance appears in ip_output (netinet/ip_output) > via rtalloc_ign (net/route.c) where the first parameter to rtalloc1 is > an actual struct sockaddr. The rtalloc1 function does a radix tree > search with a call to the rn_match function (net/radix.c). A closer look > at this code reveals that it does indeed depend on the size of the > supplied struct. > > > The only conclusion a can draw from this is that the three structs: > sockaddr, sockaddr_in and sockaddr_inarp must all be of equal size. I > have checked the FreeBSD source repository that this is the case for the > original code. > > > While browsing the FreeBSD source repository I discovered that the > sa_data character array member of the sockaddr struct was increased in > size in the eCos FreeBSD stack. Does anyone know why this increase was > introduced in eCos? Can you provide the details of what you found? i.e. exactly how these structures were modified during the port? [more likely, you're looking at a newer version of the FreeBSD code than I used and the changes happened in the BSD codebase] In any case, then we can analyze how things are different and what might need to be done. Thanks -- ------------------------------------------------------------ Gary Thomas | Consulting for the MLB Associates | Embedded world ------------------------------------------------------------ -- Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss