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

Reply via email to