Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 24 Oct 2014 13:29:13 +0000 (UTC)
From:      "Alexander V. Chernikov" <melifaro@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r273586 - head/sbin/ipfw
Message-ID:  <201410241329.s9ODTDK7022691@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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)



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