Protect sockaddr_union definitions with a protecting define. This allows to

build kernels with FAST_IPSEC and PF. This is the least disruptive fix.

PR:		kern/71836
Reviewed by:	bms, various mailing lists
MFC after:	3 days
This commit is contained in:
mlaier 2004-09-23 12:44:40 +00:00
parent 1fc8694bbf
commit 7b301a7bfc
2 changed files with 12 additions and 10 deletions

View File

@ -49,16 +49,6 @@
#ifdef __FreeBSD__
#include <netinet/in.h>
/*
* XXX
* If we include <netipsec/keydb.h>, we need _KERNEL definition.
* This makes pfctl compilation difficult.
*/
union sockaddr_union {
struct sockaddr sa;
struct sockaddr_in sin;
struct sockaddr_in6 sin6;
};
#endif
#include <netinet/tcp_fsm.h>
@ -831,6 +821,15 @@ struct pfr_tstats {
#define pfrts_name pfrts_t.pfrt_name
#define pfrts_flags pfrts_t.pfrt_flags
#ifndef _SOCKADDR_UNION_DEFINED
#define _SOCKADDR_UNION_DEFINED
union sockaddr_union {
struct sockaddr sa;
struct sockaddr_in sin;
struct sockaddr_in6 sin6;
};
#endif /* _SOCKADDR_UNION_DEFINED */
SLIST_HEAD(pfr_kentryworkq, pfr_kentry);
struct pfr_kentry {
struct radix_node pfrke_node[2];

View File

@ -37,6 +37,8 @@
#include <netipsec/key_var.h>
#ifndef _SOCKADDR_UNION_DEFINED
#define _SOCKADDR_UNION_DEFINED
/*
* The union of all possible address formats we handle.
*/
@ -45,6 +47,7 @@ union sockaddr_union {
struct sockaddr_in sin;
struct sockaddr_in6 sin6;
};
#endif /* _SOCKADDR_UNION_DEFINED */
/* Security Assocciation Index */
/* NOTE: Ensure to be same address family */