Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F151498359
D14910.id40921.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D14910.id40921.diff
View Options
Index: sys/net/if.h
===================================================================
--- sys/net/if.h
+++ sys/net/if.h
@@ -421,6 +421,13 @@
#define ifr_lan_pcp ifr_ifru.ifru_vlan_pcp /* VLAN priority */
};
+/*
+ * Consumers such as tcpdump assume no pad between ifr_name and ifr_ifru
+ * when struct ifreq is used in SIOCGIFCONF.
+ */
+_Static_assert(sizeof(((struct ifreq *)0)->ifr_name) ==
+ offsetof(struct ifreq, ifr_ifru), "gap between ifr_name and ifr_ifru");
+
#define _SIZEOF_ADDR_IFREQ(ifr) \
((ifr).ifr_addr.sa_len > sizeof(struct sockaddr) ? \
(sizeof(struct ifreq) - sizeof(struct sockaddr) + \
Index: sys/netinet6/in6_var.h
===================================================================
--- sys/netinet6/in6_var.h
+++ sys/netinet6/in6_var.h
@@ -289,6 +289,14 @@
} ifr_ifru;
};
+/*
+ * struct in6_ifreq and struct ifreq must be type punnable for common members
+ * of ifr_ifru to allow accessors to be shared.
+ */
+_Static_assert(offsetof(struct in6_ifreq, ifr_ifru) ==
+ offsetof(struct ifreq, ifr_ifru),
+ "struct in6_ifreq and struct ifreq are not type punnable");
+
struct in6_aliasreq {
char ifra_name[IFNAMSIZ];
struct sockaddr_in6 ifra_addr;
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Apr 9, 8:20 PM (17 h, 40 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
31169938
Default Alt Text
D14910.id40921.diff (1 KB)
Attached To
Mode
D14910: Document and enforce assumptions about struct (in6_)ifreq.
Attached
Detach File
Event Timeline
Log In to Comment