Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F167805029
D46683.id143785.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
D46683.id143785.diff
View Options
diff --git a/sys/netinet/in.h b/sys/netinet/in.h
--- a/sys/netinet/in.h
+++ b/sys/netinet/in.h
@@ -418,8 +418,32 @@
#define IN_RFC3021_MASK ((in_addr_t)0xfffffffe)
#ifdef _KERNEL
+#include "opt_inet.h"
+#include "opt_inet6.h"
+
#include <net/vnet.h>
+/*
+ * Define an enum with only the relevant address families (i.e. no IPv4 for a
+ * NOINET kernel) so that we can forgo a default case for 'switch (af)'.
+ * We deliberately set the values to be the same as sa_family_t, which is what
+ * we traditionally used in such cases, so that it's less risky to mix types.
+ */
+typedef enum {
+#ifndef AF_INET
+#define AF_INET 2
+#endif
+#ifndef AF_INET6
+#define AF_INET6 28
+#endif
+#ifdef INET
+ IP_AF_4 = AF_INET,
+#endif
+#ifdef INET6
+ IP_AF_6 = AF_INET6,
+#endif
+} ip_af_t;
+
VNET_DECLARE(bool, ip_allow_net0);
VNET_DECLARE(bool, ip_allow_net240);
/* Address space reserved for loopback */
diff --git a/sys/netinet/libalias/alias_sctp.h b/sys/netinet/libalias/alias_sctp.h
--- a/sys/netinet/libalias/alias_sctp.h
+++ b/sys/netinet/libalias/alias_sctp.h
@@ -166,9 +166,8 @@
uint16_t msg; /**< one of the key messages defined above */
#ifdef INET6
// struct ip6_hdr *ip_hdr; /**< pointer to ip packet header */ /*no inet6 support yet*/
-#else
- struct ip *ip_hdr; /**< pointer to ip packet header */
#endif //#ifdef INET6
+ struct ip *ip_hdr; /**< pointer to ip packet header */
struct sctphdr *sctp_hdr; /**< pointer to sctp common header */
union sctpChunkOfInt sctpchnk; /**< union of pointers to the chunk of interest */
int chunk_length; /**< length of chunk of interest */
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Aug 25, 4:37 PM (6 h, 18 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
37231170
Default Alt Text
D46683.id143785.diff (1 KB)
Attached To
Mode
D46683: Introduce ip_af_t
Attached
Detach File
Event Timeline
Log In to Comment