Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 4 Feb 2012 17:53:23 +0000 (UTC)
From:      Hiroki Sato <hrs@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r230989 - head/sbin/route
Message-ID:  <201202041753.q14HrN8N045662@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: hrs
Date: Sat Feb  4 17:53:22 2012
New Revision: 230989
URL: http://svn.freebsd.org/changeset/base/230989

Log:
  Fix a possible infinite loop in "route flush" on 64-bit archs.
  
  MFC after:	3 days

Modified:
  head/sbin/route/route.c

Modified: head/sbin/route/route.c
==============================================================================
--- head/sbin/route/route.c	Sat Feb  4 17:43:15 2012	(r230988)
+++ head/sbin/route/route.c	Sat Feb  4 17:53:22 2012	(r230989)
@@ -460,8 +460,8 @@ netname(struct sockaddr *sa)
 			 * Guess at the subnet mask, assuming reasonable
 			 * width subnet fields.
 			 */
-			while (in.s_addr &~ mask)
-				mask = (long)mask >> subnetshift;
+			while (in.s_addr & ~mask)
+				mask |= mask >> subnetshift;
 			net = in.s_addr & mask;
 			while ((mask & 1) == 0)
 				mask >>= 1, net >>= 1;



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