From owner-freebsd-net@FreeBSD.ORG Sun Jul 3 00:08:52 2005 Return-Path: X-Original-To: freebsd-net@freebsd.org 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 366FE16A4A9; Sun, 3 Jul 2005 00:08:52 +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 19C1443D1F; Sun, 3 Jul 2005 00:08:00 +0000 (GMT) (envelope-from ps@mu.org) Received: by elvis.mu.org (Postfix, from userid 1000) id 4958F5DB6F; 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 6717E5C98F for ; Fri, 12 Nov 2004 00:36:44 -0800 (PST) Received: from hub.freebsd.org (hub.freebsd.org [216.136.204.18]) by mx2.freebsd.org (Postfix) with ESMTP id E470755BCC; Fri, 12 Nov 2004 08:36:42 +0000 (GMT) (envelope-from owner-freebsd-arch@freebsd.org) Received: from hub.freebsd.org (localhost [127.0.0.1]) by hub.freebsd.org (Postfix) with ESMTP id 5DDEC16A4D7; Fri, 12 Nov 2004 08:36:42 +0000 (GMT) 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 A1FBB16A4CE; Fri, 12 Nov 2004 08:36:39 +0000 (GMT) Received: from tigra.ip.net.ua (tigra.ip.net.ua [82.193.96.10]) by mx1.FreeBSD.org (Postfix) with ESMTP id D4DE843D3F; Fri, 12 Nov 2004 08:36:38 +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 iAC8acMs086192; Fri, 12 Nov 2004 10:36:38 +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 06169-01; Fri, 12 Nov 2004 10:36: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 iAC8aaSV086183 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 12 Nov 2004 10:36:36 +0200 (EET) (envelope-from ru@ip.net.ua) Received: (from ru@localhost) by heffalump.ip.net.ua (8.13.1/8.13.1) id iAC8aa9c051052; Fri, 12 Nov 2004 10:36:36 +0200 (EET) (envelope-from ru) From: Ruslan Ermilov To: Max Laier Message-ID: <20041112083636.GC41844@ip.net.ua> References: <200411112124.12616.max@love2party.net> <20041111215506.GA60227@webcom.it> <200411120116.33771.max@love2party.net> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="+nBD6E3TurpgldQp" Content-Disposition: inline In-Reply-To: <200411120116.33771.max@love2party.net> User-Agent: Mutt/1.5.6i X-Virus-Scanned: by amavisd-new at ip.net.ua X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Sender: owner-freebsd-arch@freebsd.org Errors-To: owner-freebsd-arch@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, Andrea Campi Subject: Re: in.c autoadding prefix route X-BeenThere: freebsd-net@freebsd.org List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Date: Sun, 03 Jul 2005 00:08:52 -0000 X-Original-Date: Fri, 12 Nov 2004 10:36:36 +0200 X-List-Received-Date: Sun, 03 Jul 2005 00:08:52 -0000 --+nBD6E3TurpgldQp Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Nov 12, 2004 at 01:16:31AM +0100, Max Laier wrote: > On Thursday 11 November 2004 22:55, Andrea Campi wrote: > > On Thu, Nov 11, 2004 at 09:24:05PM +0100, Max Laier wrote: > > > The attached patch (http://people.freebsd.org/~mlaier/in.c.patch) der= ived > > > from WIDE via OpenBSD in.c, rev 1.21 improves the handling of automat= ic > > > prefix routes. > > > > Sounds like a very useful change indeed. > > > > One comment though: > > > @@ -743,26 +766,7 @@ > > > return (0); > > > flags |=3D RTF_HOST; > > > } > > > - > > > - /*- > > > - * Don't add host routes for interface addresses of > > > - * 0.0.0.0 --> 0.255.255.255 netmask 255.0.0.0. This makes it > > > - * possible to assign several such address pairs with consistent > > > - * results (no host route) and is required by BOOTP. > > > - * > > > - * XXX: This is ugly ! There should be a way for the caller to > > > - * say that they don't want a host route. > > > - */ > > > - if (ia->ia_addr.sin_addr.s_addr !=3D INADDR_ANY || > > > - ia->ia_netmask !=3D IN_CLASSA_NET || > > > - ia->ia_dstaddr.sin_addr.s_addr !=3D htonl(IN_CLASSA_HOST)) { > > > - if ((error =3D rtinit(&ia->ia_ifa, (int)RTM_ADD, flags)) !=3D 0) { > > > - ia->ia_addr =3D oldaddr; > > > - return (error); > > > - } > > > - ia->ia_flags |=3D IFA_ROUTE; > > > - } > > > - > > > + error =3D in_addprefix(ia, flags); > > > /* > > > * If the interface supports multicast, join the "all hosts" > > > * multicast group on that interface. > > > > Are you sure you want to go on if you got an error? Regardless, you sho= uld > > probably have an empty line after in_addrprefix. >=20 > Not sure how to deal with the error case. All errors we should get are me= mory=20 > related (as we check carefully that the rtinit will success). This means = that=20 > the following in_addmulti will sleep if we hit it (in_addmulti mallocs wi= th=20 > M_WAITOK) ... so I guess you are right and it's the least intrusive if we= do=20 > return. >=20 The old code did: if ((error =3D rtinit()) !=3D 0) return (error); Why the new code should behave differently, I fail to see? in_addprefix() is just a wrapper around rtinit(), after all. Cheers, --=20 Ruslan Ermilov ru@FreeBSD.org FreeBSD committer --+nBD6E3TurpgldQp Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.6 (FreeBSD) iD8DBQFBlHYUqRfpzJluFF4RAgy6AJ4qwETEoghRRzlWwtnipxrcIhU9SQCgiDGY A3PGCLtB+a+fLw3TCwlLfmc= =a0HD -----END PGP SIGNATURE----- --+nBD6E3TurpgldQp--