summaryrefslogtreecommitdiffstats
path: root/sbin/ipfw
diff options
context:
space:
mode:
authormelifaro <melifaro@FreeBSD.org>2015-09-18 17:29:24 +0000
committermelifaro <melifaro@FreeBSD.org>2015-09-18 17:29:24 +0000
commit5496fd3096bf187ed2221f8f0290f9f119b06208 (patch)
tree7ab3e012c4c9d531d96fb628c7a3e79f93933434 /sbin/ipfw
parent26a0cf375aceedb2911b79b762cbc4f28510040a (diff)
downloadFreeBSD-src-5496fd3096bf187ed2221f8f0290f9f119b06208.zip
FreeBSD-src-5496fd3096bf187ed2221f8f0290f9f119b06208.tar.gz
MFC r266310
Fix wrong formatting of 0.0.0.0/X table records in ipfw(8). Add `flags` u16 field to the hole in ipfw_table_xentry structure. Kernel has been guessing address family for supplied record based on xent length size. Userland, however, has been getting fixed-size ipfw_table_xentry structures guessing address family by checking address by IN6_IS_ADDR_V4COMPAT(). Fix this behavior by providing specific IPFW_TCF_INET flag for IPv4 records. PR: bin/189471,kern/200169
Diffstat (limited to 'sbin/ipfw')
-rw-r--r--sbin/ipfw/ipfw2.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sbin/ipfw/ipfw2.c b/sbin/ipfw/ipfw2.c
index 98b25b3..25d6afd 100644
--- a/sbin/ipfw/ipfw2.c
+++ b/sbin/ipfw/ipfw2.c
@@ -4389,7 +4389,7 @@ table_list(uint16_t num, int need_header)
addr6 = &xent->k.addr6;
- if (IN6_IS_ADDR_V4COMPAT(addr6)) {
+ if ((xent->flags & IPFW_TCF_INET) != 0) {
/* IPv4 address */
inet_ntop(AF_INET, &addr6->s6_addr32[3], tbuf, sizeof(tbuf));
} else {
OpenPOWER on IntegriCloud