From owner-freebsd-arch@FreeBSD.ORG Sun Jul 3 00:08:45 2005 Return-Path: X-Original-To: freebsd-arch@freebsd.org Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id C608216A423; Sun, 3 Jul 2005 00:08:45 +0000 (GMT) (envelope-from ps@mu.org) Received: from elvis.mu.org (elvis.mu.org [192.203.228.196]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1C1E943D86; Sun, 3 Jul 2005 00:08:00 +0000 (GMT) (envelope-from ps@mu.org) Received: by elvis.mu.org (Postfix, from userid 1000) id 5D7715DB72; Sat, 2 Jul 2005 17:07:45 -0700 (PDT) X-Original-To: ps@mu.org Delivered-To: ps@mu.org Received: from mx2.freebsd.org (mx2.freebsd.org [216.136.204.119]) by elvis.mu.org (Postfix) with ESMTP id 623805C96B for ; Fri, 12 Nov 2004 00:31:11 -0800 (PST) Received: from hub.freebsd.org (hub.freebsd.org [216.136.204.18]) by mx2.freebsd.org (Postfix) with ESMTP id 9572C563B3; Fri, 12 Nov 2004 08:30:56 +0000 (GMT) (envelope-from owner-freebsd-net@freebsd.org) Received: from hub.freebsd.org (localhost [127.0.0.1]) by hub.freebsd.org (Postfix) with ESMTP id B186E16A527; Fri, 12 Nov 2004 08:30:48 +0000 (GMT) Delivered-To: freebsd-net@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 4CDF116A4CE; Fri, 12 Nov 2004 08:30:43 +0000 (GMT) Received: from tigra.ip.net.ua (tigra.ip.net.ua [82.193.96.10]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7526043D2D; Fri, 12 Nov 2004 08:30:42 +0000 (GMT) (envelope-from ru@ip.net.ua) Received: from localhost (rocky.ip.net.ua [82.193.96.2]) by tigra.ip.net.ua (8.12.11/8.12.11) with ESMTP id iAC8Ueho084326; Fri, 12 Nov 2004 10:30:41 +0200 (EET) (envelope-from ru@ip.net.ua) Received: from tigra.ip.net.ua ([82.193.96.10]) by localhost (rocky.ipnet [82.193.96.2]) (amavisd-new, port 10024) with LMTP id 04757-19; Fri, 12 Nov 2004 10:30:36 +0200 (EET) Received: from heffalump.ip.net.ua (heffalump.ip.net.ua [82.193.96.213]) by tigra.ip.net.ua (8.12.11/8.12.11) with ESMTP id iAC8UEqs084054 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 12 Nov 2004 10:30:14 +0200 (EET) (envelope-from ru@ip.net.ua) Received: (from ru@localhost) by heffalump.ip.net.ua (8.13.1/8.13.1) id iAC8UE0w051003; Fri, 12 Nov 2004 10:30:14 +0200 (EET) (envelope-from ru) From: Ruslan Ermilov To: Max Laier Message-ID: <20041112083014.GB41844@ip.net.ua> References: <200411112124.12616.max@love2party.net> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="GID0FwUMdk1T2AWN" Content-Disposition: inline In-Reply-To: <200411112124.12616.max@love2party.net> User-Agent: Mutt/1.5.6i X-Virus-Scanned: by amavisd-new at ip.net.ua X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Sender: owner-freebsd-net@freebsd.org Errors-To: owner-freebsd-net@freebsd.org X-Spam-Checker-Version: SpamAssassin 3.0.0 (2004-09-13) on elvis.mu.org X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.0.0 X-Spam-Level: Cc: freebsd-net@freebsd.org, freebsd-arch@freebsd.org Subject: Re: in.c autoadding prefix route X-BeenThere: freebsd-arch@freebsd.org List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Date: Sun, 03 Jul 2005 00:08:46 -0000 X-Original-Date: Fri, 12 Nov 2004 10:30:14 +0200 X-List-Received-Date: Sun, 03 Jul 2005 00:08:46 -0000 --GID0FwUMdk1T2AWN Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi Max, On Thu, Nov 11, 2004 at 09:24:05PM +0100, Max Laier wrote: > I know I have sent this a couple of times before, but never got anywhere.= This=20 > time I am set to commit! >=20 Hey, you did it! ;) > The attached patch (http://people.freebsd.org/~mlaier/in.c.patch) derived= from=20 > WIDE via OpenBSD in.c, rev 1.21 improves the handling of automatic prefix= =20 > routes. >=20 > Right now you can't have two legs into the same network. If you want to, = you=20 > must give on of the interfaces a host address only (netmask /32). This wa= y it=20 > is not possible to hand over the route if one of the interfaces is=20 > "removed" (however this is done in the special case). >=20 > The patch allows to add more than on IPv4 address with the same prefix. I= n the=20 > case that there is a route already, we leave it alone and add the new add= ress=20 > without the IFA_ROUTE flag. When we remove an address later on, that has = a=20 > route associated, we try to find an alternative address to use for the ro= ute=20 > and hand it over. >=20 I cannot give your patch a thorough review at the moment, but I like the algorithm, and I don't see how it can hurt anything. > --- ../dist/sys/netinet/in.c Sat Nov 6 21:01:08 2004 > +++ sys/netinet/in.c Mon Nov 8 02:05:17 2004 > @@ -654,14 +684,7 @@ > register struct ifnet *ifp; > register struct in_ifaddr *ia; > { > - > - if ((ia->ia_flags & IFA_ROUTE) =3D=3D 0) > - return; > - if (ifp->if_flags & (IFF_LOOPBACK|IFF_POINTOPOINT)) > - rtinit(&(ia->ia_ifa), (int)RTM_DELETE, RTF_HOST); > - else > - rtinit(&(ia->ia_ifa), (int)RTM_DELETE, 0); > - ia->ia_flags &=3D ~IFA_ROUTE; > + in_scrubprefix(ia); > } > =20 Looks like "ifp" argument is no longer needed for in_ifscrub(), perhaps it should be killed then. Also, there are a lot of style bugs (besides those that others have already mentioned), the most annoying is comments -- they should be written as per style(9) (make them look like the real sentences). Cheers, --=20 Ruslan Ermilov ru@FreeBSD.org FreeBSD committer --GID0FwUMdk1T2AWN Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.6 (FreeBSD) iD8DBQFBlHSWqRfpzJluFF4RAsJbAJ9MrlyCTjeeC7Db9kC5iZ/xBrt8KQCeIdRy 3pYQvaSeF7SeF+iohADcOmM= =4Ken -----END PGP SIGNATURE----- --GID0FwUMdk1T2AWN--