Fix displaying non-contiguous netmasks.

Found by:	ae
Sponsored by:	Yandex LLC
This commit is contained in:
melifaro 2014-10-24 13:29:12 +00:00
parent cbbca2de4d
commit c909035802

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 */
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)