From owner-freebsd-hackers Mon Jul 1 11:09:10 1996 Return-Path: owner-hackers Received: (from root@localhost) by freefall.freebsd.org (8.7.5/8.7.3) id LAA18577 for hackers-outgoing; Mon, 1 Jul 1996 11:09:10 -0700 (PDT) Received: from gvr.win.tue.nl (root@gvr.win.tue.nl [131.155.210.19]) by freefall.freebsd.org (8.7.5/8.7.3) with SMTP id LAA18529 for ; Mon, 1 Jul 1996 11:09:00 -0700 (PDT) Received: by gvr.win.tue.nl (8.6.12/1.53) id UAA07690; Mon, 1 Jul 1996 20:06:55 +0200 From: guido@gvr.win.tue.nl (Guido van Rooij) Message-Id: <199607011806.UAA07690@gvr.win.tue.nl> Subject: Re: Multiple delivery of UDP and IP aliases To: jgreco@brasil.moneng.mei.com (Joe Greco) Date: Mon, 1 Jul 1996 20:06:55 +0200 (MET DST) Cc: jcl@pavilion.co.uk, hackers@FreeBSD.org In-Reply-To: <199606251544.KAA07793@brasil.moneng.mei.com> from Joe Greco at "Jun 25, 96 10:44:53 am" X-Mailer: ELM [version 2.4ME+ PL17 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-hackers@FreeBSD.org X-Loop: FreeBSD.org Precedence: bulk > It's a Legitimate Bug in 2.1R and 2.0.5R (at least), and somebody devised > a patch. Check the -hackers list, and if you cannot locate the patch, > write to me and I will dredge it up. > > My apologies to whoever fixed it, I can't remember anymore :-( I made a fix. However, I believ this was fixed in 2.1R. In 2.1, an alias has an associated netmask of all-ones. In the udp code, a packet to an address is always checked to be a broadcast address using in_broadcast(). For an all-one netmask, this succeeds where it should not. I `fixed' this by adding a check for the all-one netmask in in_broadcast(). This is fixed in 2.1. The following patch should fix it on 2.05: -Guido --- in.c.orig Mon Jan 8 21:38:45 1996 +++ in.c Mon Jan 8 21:40:39 1996 @@ -609,7 +609,13 @@ /* * Check for old-style (host 0) broadcast. */ - t == ia->ia_subnet || t == ia->ia_net)) + t == ia->ia_subnet || t == ia->ia_net) && + /* + * Check for an all one subnetmask. These + * only exist when an interface gets a secondary + * address. + */ + ia->ia_subnetmask != (u_long)0xffffffff) return 1; return (0); #undef ia