From owner-svn-src-all@FreeBSD.ORG Tue Dec 4 10:22:14 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 058B6F54; Tue, 4 Dec 2012 10:22:14 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebius.int.ru (glebius.int.ru [81.19.69.10]) by mx1.freebsd.org (Postfix) with ESMTP id 6AAF48FC08; Tue, 4 Dec 2012 10:22:12 +0000 (UTC) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.5/8.14.5) with ESMTP id qB4AM4i9047042; Tue, 4 Dec 2012 14:22:04 +0400 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.5/8.14.5/Submit) id qB4AM4Xw047041; Tue, 4 Dec 2012 14:22:04 +0400 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Tue, 4 Dec 2012 14:22:04 +0400 From: Gleb Smirnoff To: Xin LI Subject: Re: svn commit: r243019 - head/sbin/route Message-ID: <20121204102204.GD14202@FreeBSD.org> References: <201211140805.qAE85MHU031099@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="nzri8VXeXB/g5ayr" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Dec 2012 10:22:14 -0000 --nzri8VXeXB/g5ayr Content-Type: text/plain; charset=koi8-r Content-Disposition: inline Xin, On Mon, Dec 03, 2012 at 11:47:32AM -0800, Xin LI wrote: X> It seems that this commit breaks the following commands like this: X> X> route add -net 10.8/16 10.2.0.1 Thanks for report. Do you agree with attached patch? -- Totus tuus, Glebius. --nzri8VXeXB/g5ayr Content-Type: text/x-diff; charset=koi8-r Content-Disposition: attachment; filename="route.c.diff" Index: route.c =================================================================== --- route.c (revision 243858) +++ route.c (working copy) @@ -1033,6 +1033,13 @@ rtm_addrs |= RTA_NETMASK; /* + * MSB of net should be meaningful. 0/0 is exception. + */ + if (net > 0) + while ((net & 0xff000000) == 0) + net <<= 8; + + /* * If no /xx was specified we must calculate the * CIDR address. */ --nzri8VXeXB/g5ayr--