Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 4 Dec 2012 14:22:04 +0400
From:      Gleb Smirnoff <glebius@FreeBSD.org>
To:        Xin LI <delphij@gmail.com>
Cc:        "svn-src-head@freebsd.org" <svn-src-head@FreeBSD.org>, "svn-src-all@freebsd.org" <svn-src-all@FreeBSD.org>, "src-committers@freebsd.org" <src-committers@FreeBSD.org>
Subject:   Re: svn commit: r243019 - head/sbin/route
Message-ID:  <20121204102204.GD14202@FreeBSD.org>
In-Reply-To: <CAGMYy3u8dKX8DFGFmv%2BQqpDqVm-0ivVxM03QNskqEPuiwrGSqA@mail.gmail.com>
References:  <201211140805.qAE85MHU031099@svn.freebsd.org> <CAGMYy3u8dKX8DFGFmv%2BQqpDqVm-0ivVxM03QNskqEPuiwrGSqA@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help

--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--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20121204102204.GD14202>