summaryrefslogtreecommitdiffstats
path: root/sbin/ipfw
diff options
context:
space:
mode:
authormelifaro <melifaro@FreeBSD.org>2014-05-17 13:45:03 +0000
committermelifaro <melifaro@FreeBSD.org>2014-05-17 13:45:03 +0000
commitf4783a05e9466a8805fae966e8fd9d592f053eeb (patch)
tree6eb29755a6cdb47ca08b2f95992839b1c7f88dda /sbin/ipfw
parente21a2ccdb6e9010cd9b69be7937fb38cb299f2a8 (diff)
downloadFreeBSD-src-f4783a05e9466a8805fae966e8fd9d592f053eeb.zip
FreeBSD-src-f4783a05e9466a8805fae966e8fd9d592f053eeb.tar.gz
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 Submitted by: Dennis Yusupoff <dyr@smartspb.net> MFC after: 2 weeks
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