summaryrefslogtreecommitdiffstats
path: root/sys/netpfil
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 /sys/netpfil
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 'sys/netpfil')
-rw-r--r--sys/netpfil/ipfw/ip_fw_table.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/sys/netpfil/ipfw/ip_fw_table.c b/sys/netpfil/ipfw/ip_fw_table.c
index 31eebfe..760a10c 100644
--- a/sys/netpfil/ipfw/ip_fw_table.c
+++ b/sys/netpfil/ipfw/ip_fw_table.c
@@ -697,6 +697,7 @@ dump_table_xentry_base(struct radix_node *rn, void *arg)
xent->masklen = 33 - ffs(ntohl(n->mask.sin_addr.s_addr));
/* Save IPv4 address as deprecated IPv6 compatible */
xent->k.addr6.s6_addr32[3] = n->addr.sin_addr.s_addr;
+ xent->flags = IPFW_TCF_INET;
xent->value = n->value;
tbl->cnt++;
return (0);
OpenPOWER on IntegriCloud