summaryrefslogtreecommitdiffstats
path: root/sys/netinet
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/netinet
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/netinet')
-rw-r--r--sys/netinet/ip_fw.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/sys/netinet/ip_fw.h b/sys/netinet/ip_fw.h
index 14b08f5..dae8cc0 100644
--- a/sys/netinet/ip_fw.h
+++ b/sys/netinet/ip_fw.h
@@ -614,6 +614,7 @@ typedef struct _ipfw_table_xentry {
uint8_t type; /* entry type */
uint8_t masklen; /* mask length */
uint16_t tbl; /* table number */
+ uint16_t flags; /* record flags */
uint32_t value; /* value */
union {
/* Longest field needs to be aligned by 4-byte boundary */
@@ -621,6 +622,7 @@ typedef struct _ipfw_table_xentry {
char iface[IF_NAMESIZE]; /* interface name */
} k;
} ipfw_table_xentry;
+#define IPFW_TCF_INET 0x01 /* CIDR flags: IPv4 record */
typedef struct _ipfw_table {
u_int32_t size; /* size of entries in bytes */
OpenPOWER on IntegriCloud