diff options
author | Alexander V. Chernikov <melifaro@FreeBSD.org> | 2014-10-24 13:29:12 +0000 |
---|---|---|
committer | Alexander V. Chernikov <melifaro@FreeBSD.org> | 2014-10-24 13:29:12 +0000 |
commit | 382a5cbf423a65c5504a421776412b26daa9e949 (patch) | |
tree | 1708a4f1eecc15c629b755cea7157664628242e1 /sbin | |
parent | 3bea5b97f84581510eb5494bd925e4b197959ae7 (diff) | |
download | src-382a5cbf423a65c5504a421776412b26daa9e949.tar.gz src-382a5cbf423a65c5504a421776412b26daa9e949.zip |
Fix displaying non-contiguous netmasks.
Found by: ae
Sponsored by: Yandex LLC
Notes
Notes:
svn path=/head/; revision=273586
Diffstat (limited to 'sbin')
-rw-r--r-- | sbin/ipfw/ipfw2.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/sbin/ipfw/ipfw2.c b/sbin/ipfw/ipfw2.c index a0fc3b85c19f..2c9846628977 100644 --- a/sbin/ipfw/ipfw2.c +++ b/sbin/ipfw/ipfw2.c @@ -1225,9 +1225,10 @@ print_ip(struct buf_pr *bp, struct format_opts *fo, ipfw_insn_ip *cmd, 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) |