Fix displaying non-contiguous netmasks.

Found by:	ae
Sponsored by:	Yandex LLC
This commit is contained in:
Alexander V. Chernikov 2014-10-24 13:29:12 +00:00
parent 3bea5b97f8
commit 382a5cbf42
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=273586

View File

@ -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 */ else { /* numeric IP followed by some kind of mask */
ia = (struct in_addr *)&a[0]; ia = (struct in_addr *)&a[0];
bprintf(bp, "%s", inet_ntoa(*ia)); bprintf(bp, "%s", inet_ntoa(*ia));
if (mb < 0) if (mb < 0) {
bprintf(bp, ":%s", inet_ntoa(*ia ) ); ia = (struct in_addr *)&a[1];
else if (mb < 32) bprintf(bp, ":%s", inet_ntoa(*ia));
} else if (mb < 32)
bprintf(bp, "/%d", mb); bprintf(bp, "/%d", mb);
} }
if (len > 1) if (len > 1)