From owner-svn-src-all@FreeBSD.ORG Sat Feb 4 17:53:23 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 56415106566C; Sat, 4 Feb 2012 17:53:23 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 421938FC08; Sat, 4 Feb 2012 17:53:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q14HrN9k045664; Sat, 4 Feb 2012 17:53:23 GMT (envelope-from hrs@svn.freebsd.org) Received: (from hrs@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q14HrN8N045662; Sat, 4 Feb 2012 17:53:23 GMT (envelope-from hrs@svn.freebsd.org) Message-Id: <201202041753.q14HrN8N045662@svn.freebsd.org> From: Hiroki Sato Date: Sat, 4 Feb 2012 17:53:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230989 - head/sbin/route X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 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: Sat, 04 Feb 2012 17:53:23 -0000 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;