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.
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.
 	 */
_______________________________________________
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to