From owner-freebsd-stable Mon Jul 26 18:17:37 1999 Delivered-To: freebsd-stable@freebsd.org Received: from mail.singtel-yp.com (mail.singtel-yp.com [165.21.60.44]) by hub.freebsd.org (Postfix) with SMTP id A5DF415022 for ; Mon, 26 Jul 1999 18:17:32 -0700 (PDT) (envelope-from ktsin@mail.singtel-yp.com) Received: (qmail 23014 invoked by uid 1001); 27 Jul 1999 01:17:31 -0000 Message-ID: <19990727011731.23013.qmail@mail.singtel-yp.com> From: ktsin@mail.singtel-yp.com Subject: Re: a patch to fix the proxy arp problem To: jooji@neptune.oceancomputer.com (Jasper O'Malley) Date: Tue, 27 Jul 1999 09:17:31 +0800 (SGT) Cc: stable@freebsd.org In-Reply-To: from "Jasper O'Malley" at Jul 26, 99 09:41:28 am X-Mailer: ELM [version 2.4 PL25] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-freebsd-stable@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG > 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