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

Reply via email to