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 +/* + * 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 */