Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F162788675
D58273.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
3 KB
Referenced Files
None
Subscribers
None
D58273.diff
View Options
diff --git a/sys/netinet/in_pcb.h b/sys/netinet/in_pcb.h
--- a/sys/netinet/in_pcb.h
+++ b/sys/netinet/in_pcb.h
@@ -38,50 +38,36 @@
#define _NETINET_IN_PCB_H_
/*
- * PCB with AF_INET6 null bind'ed laddr can receive AF_INET input packet.
- * So, AF_INET6 null laddr is also used as AF_INET null laddr, by utilizing
- * the following structure. This requires padding always be zeroed out,
- * which is done right after inpcb allocation and stays through its lifetime.
- */
-struct in_addr_4in6 {
- uint32_t ia46_pad32[3];
- struct in_addr ia46_addr4;
-};
-
-union in_dependaddr {
- struct in_addr_4in6 id46_addr;
- struct in6_addr id6_addr;
-};
-
-/*
- * NOTE: ipv6 addrs should be 64-bit aligned, per RFC 2553. in_conninfo has
+ * NOTE: IPv6 inpcb bound to unspecified local address shall also receive IPv4
+ * traffic. Thus, IPv6 local address that is IN6_IS_ADDR_UNSPECIFIED() should
+ * also be usable as IPv4 INADDR_ANY. This requires padding in in_dependaddr
+ * to always be zeroed out, which is done right after inpcb allocation and
+ * stays through its lifetime.
+ * NOTE 2: ipv6 addrs should be 64-bit aligned, per RFC 2553. in_conninfo has
* some extra padding to accomplish this.
- * NOTE 2: tcp_syncache.c uses first 5 32-bit words, which identify fport,
+ * NOTE 3: tcp_syncache.c uses first 5 32-bit words, which identify fport,
* lport, faddr to generate hash, so these fields shouldn't be moved.
*/
-struct in_endpoints {
- uint16_t ie_fport; /* foreign port */
- uint16_t ie_lport; /* local port */
- /* protocol dependent part, local and foreign addr */
- union in_dependaddr ie_dependfaddr; /* foreign host table entry */
- union in_dependaddr ie_dependladdr; /* local host table entry */
-#define ie_faddr ie_dependfaddr.id46_addr.ia46_addr4
-#define ie_laddr ie_dependladdr.id46_addr.ia46_addr4
-#define ie6_faddr ie_dependfaddr.id6_addr
-#define ie6_laddr ie_dependladdr.id6_addr
- uint32_t ie6_zoneid; /* scope zone id */
-};
-
-/*
- * XXX The defines for inc_* are hacks and should be changed to direct
- * references.
- */
struct in_conninfo {
uint8_t inc_flags;
uint8_t inc_len;
uint16_t inc_fibnum; /* XXX was pad, 16 bits is plenty */
- /* protocol dependent part */
- struct in_endpoints inc_ie;
+ struct in_endpoints {
+ uint16_t ie_fport; /* foreign port */
+ uint16_t ie_lport; /* local port */
+ union in_dependaddr {
+ struct {
+ uint32_t __pad[3];
+ struct in_addr id4_addr;
+ };
+ struct in6_addr id6_addr;
+ } ie_dependfaddr, ie_dependladdr;
+#define ie_faddr ie_dependfaddr.id4_addr
+#define ie_laddr ie_dependladdr.id4_addr
+#define ie6_faddr ie_dependfaddr.id6_addr
+#define ie6_laddr ie_dependladdr.id6_addr
+ uint32_t ie6_zoneid; /* scope zone id */
+ } inc_ie;
};
/*
diff --git a/sys/netinet/in_pcb_var.h b/sys/netinet/in_pcb_var.h
--- a/sys/netinet/in_pcb_var.h
+++ b/sys/netinet/in_pcb_var.h
@@ -151,7 +151,7 @@
uint8_t il_numa_domain;
int il_fibnum;
union in_dependaddr il_dependladdr; /* (c) */
-#define il_laddr il_dependladdr.id46_addr.ia46_addr4
+#define il_laddr il_dependladdr.id4_addr
#define il6_laddr il_dependladdr.id6_addr
uint32_t il_inpsiz; /* max count in il_inp[] (h) */
uint32_t il_inpcnt; /* cur count in il_inp[] (h) */
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Jul 17, 9:59 PM (7 h, 22 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
35178645
Default Alt Text
D58273.diff (3 KB)
Attached To
Mode
D58273: inpcb: declare struct in_conninfo as a single declaration
Attached
Detach File
Event Timeline
Log In to Comment