From owner-svn-src-head@FreeBSD.ORG Tue Dec 4 20:05:02 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 7E6C4EA9; Tue, 4 Dec 2012 20:05:02 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 62AE18FC1B; Tue, 4 Dec 2012 20:05:02 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qB4K52ve044756; Tue, 4 Dec 2012 20:05:02 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qB4K52fL044755; Tue, 4 Dec 2012 20:05:02 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201212042005.qB4K52fL044755@svn.freebsd.org> From: Gleb Smirnoff Date: Tue, 4 Dec 2012 20:05:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r243867 - head/sbin/route X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Dec 2012 20:05:02 -0000 Author: glebius Date: Tue Dec 4 20:05:01 2012 New Revision: 243867 URL: http://svnweb.freebsd.org/changeset/base/243867 Log: Fix fallout from r243019, which broke parsing of shortened network prefixes. Reported and tested by: delphij Modified: head/sbin/route/route.c Modified: head/sbin/route/route.c ============================================================================== --- head/sbin/route/route.c Tue Dec 4 17:12:23 2012 (r243866) +++ head/sbin/route/route.c Tue Dec 4 20:05:01 2012 (r243867) @@ -1033,6 +1033,13 @@ inet_makenetandmask(u_long net, struct s 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. */