Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 27 Jul 1999 09:17:31 +0800 (SGT)
From:      ktsin@mail.singtel-yp.com
To:        jooji@neptune.oceancomputer.com (Jasper O'Malley)
Cc:        stable@freebsd.org
Subject:   Re: a patch to fix the proxy arp problem
Message-ID:  <19990727011731.23013.qmail@mail.singtel-yp.com>
In-Reply-To: <Pine.BSF.4.05.9907260906340.22743-100000@neptune.oceancomputer.com> from "Jasper O'Malley" at Jul 26, 99 09:41:28 am

next in thread | previous in thread | raw e-mail | index | archive | help
> On Mon, 26 Jul 1999 ktsin@mail.singtel-yp.com wrote:
> 
> > I've managed to track down the proxy arp problem in 3.2-stable. It was due to 
> > misalignment which led to wrong/corrupted destination address and netmask.
> 
> Thank you :) If you have a second, could you go over the patch briefly,
> and explain what it does? Is the misalignment caused by the addition of
> the sdl_rcf and sdl_route elements to the sockaddr_dl structure in
> /usr/src/sys/net/if_dl.h?

Yes. sockaddr_dl was previously 20 bytes long (multiple of 4 bytes or
sizeof(long)). After the sdl_rcf and sdl_route elements were added the length
increased to 54 bytes.

> Why did it work without the ROUNDUP() macro
> before the addition of these elements, and why don't it now?

The ROUNDUP() macro is also used in /usr/src/sys/net/rtsock.c. By using 
the macro, rtsock.c requires the start of each sockaddr in the sockaddr list
to be a multiple of 4. Arp does not adhere to this requirement when
constructing or extracting the sockaddr list in the set() or get() routines.
It just appends one sockaddr after another, without leaving any padding or gap
when needed.

I don't know if arp or changes to sockaddr_dl in if_dl.h is responsible for
the breakage. Does the spec require the length of all sockaddrs to be
multiples of 4 bytes?

kt

> 
> Thanks again for the patch...I can upgrade my firewall again ;)
> 
> Cheers,
> Mick
> 
> 



To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-stable" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?19990727011731.23013.qmail>