Refactor & compact struct i6addr_t #ifdef: remove redundant structure

definintion when USE_INET6 is false.

MFC after:	1 week
This commit is contained in:
Cy Schubert 2017-05-22 03:01:35 +00:00
parent 9257ada0a4
commit 10ee220f07

View File

@ -143,32 +143,20 @@ typedef int (* lookupfunc_t) __P((struct ipf_main_softc_s *, void *,
* i6addr is used as a container for both IPv4 and IPv6 addresses, as well
* as other types of objects, depending on its qualifier.
*/
typedef union i6addr {
u_32_t i6[4];
struct in_addr in4;
#ifdef USE_INET6
typedef union i6addr {
u_32_t i6[4];
struct in_addr in4;
struct in6_addr in6;
void *vptr[2];
lookupfunc_t lptr[2];
struct {
u_short type;
u_short subtype;
int name;
} i6un;
} i6addr_t;
#else
typedef union i6addr {
u_32_t i6[4];
struct in_addr in4;
void *vptr[2];
lookupfunc_t lptr[2];
struct {
u_short type;
u_short subtype;
int name;
} i6un;
} i6addr_t;
#endif
void *vptr[2];
lookupfunc_t lptr[2];
struct {
u_short type;
u_short subtype;
int name;
} i6un;
} i6addr_t;
#define in4_addr in4.s_addr
#define iplookupnum i6[1]