From owner-svn-src-head@FreeBSD.ORG Fri Oct 24 13:29:13 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BD972EFB; Fri, 24 Oct 2014 13:29:13 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A920C286; Fri, 24 Oct 2014 13:29:13 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s9ODTDUt022692; Fri, 24 Oct 2014 13:29:13 GMT (envelope-from melifaro@FreeBSD.org) Received: (from melifaro@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9ODTDK7022691; Fri, 24 Oct 2014 13:29:13 GMT (envelope-from melifaro@FreeBSD.org) Message-Id: <201410241329.s9ODTDK7022691@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: melifaro set sender to melifaro@FreeBSD.org using -f From: "Alexander V. Chernikov" Date: Fri, 24 Oct 2014 13:29:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r273586 - head/sbin/ipfw 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.18-1 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: Fri, 24 Oct 2014 13:29:13 -0000 Author: melifaro Date: Fri Oct 24 13:29:12 2014 New Revision: 273586 URL: https://svnweb.freebsd.org/changeset/base/273586 Log: Fix displaying non-contiguous netmasks. Found by: ae Sponsored by: Yandex LLC Modified: head/sbin/ipfw/ipfw2.c Modified: head/sbin/ipfw/ipfw2.c ============================================================================== --- head/sbin/ipfw/ipfw2.c Fri Oct 24 12:30:43 2014 (r273585) +++ head/sbin/ipfw/ipfw2.c Fri Oct 24 13:29:12 2014 (r273586) @@ -1225,9 +1225,10 @@ print_ip(struct buf_pr *bp, struct forma else { /* numeric IP followed by some kind of mask */ ia = (struct in_addr *)&a[0]; bprintf(bp, "%s", inet_ntoa(*ia)); - if (mb < 0) - bprintf(bp, ":%s", inet_ntoa(*ia ) ); - else if (mb < 32) + if (mb < 0) { + ia = (struct in_addr *)&a[1]; + bprintf(bp, ":%s", inet_ntoa(*ia)); + } else if (mb < 32) bprintf(bp, "/%d", mb); } if (len > 1)