diff options
author | Kamil Rytarowski <n54@gmx.com> | 2020-03-16 00:39:02 +0100 |
---|---|---|
committer | Kamil Rytarowski <n54@gmx.com> | 2020-03-16 00:47:40 +0100 |
commit | 7f6b25ad1bb3f8057655a9bad2a3b69621f4a543 (patch) | |
tree | 77fb59ce4fb78a7912370438185d619a4ea114ff | |
parent | 6ed18eaa777beac510272c73e3889d9ec54ad341 (diff) |
[compiler-rt] [netbsd] Add support for the MKIPFILTER=no distribution
Add fallback definition for the IPFilter ioctl commands.
-rw-r--r-- | compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_netbsd.cpp | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_netbsd.cpp b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_netbsd.cpp index 722cb1feb560..fb3b69795af1 100644 --- a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_netbsd.cpp +++ b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_netbsd.cpp @@ -161,9 +161,50 @@ #include <net/slip.h> #include <netbt/hci.h> #include <netinet/ip_compat.h> +#if __has_include(<netinet/ip_fil.h>) #include <netinet/ip_fil.h> #include <netinet/ip_nat.h> #include <netinet/ip_proxy.h> +#else +/* Fallback for MKIPFILTER=no */ + +typedef struct ap_control { + char apc_label[16]; + char apc_config[16]; + unsigned char apc_p; + unsigned long apc_cmd; + unsigned long apc_arg; + void *apc_data; + size_t apc_dsize; +} ap_ctl_t; + +typedef struct ipftq { + ipfmutex_t ifq_lock; + unsigned int ifq_ttl; + void *ifq_head; + void **ifq_tail; + void *ifq_next; + void **ifq_pnext; + int ifq_ref; + unsigned int ifq_flags; +} ipftq_t; + +typedef struct ipfobj { + uint32_t ipfo_rev; + uint32_t ipfo_size; + void *ipfo_ptr; + int ipfo_type; + int ipfo_offset; + int ipfo_retval; + unsigned char ipfo_xxxpad[28]; +} ipfobj_t; + +#define SIOCADNAT _IOW('r', 60, struct ipfobj) +#define SIOCRMNAT _IOW('r', 61, struct ipfobj) +#define SIOCGNATS _IOWR('r', 62, struct ipfobj) +#define SIOCGNATL _IOWR('r', 63, struct ipfobj) +#define SIOCPURGENAT _IOWR('r', 100, struct ipfobj) +#endif #include <netinet6/in6_var.h> #include <netinet6/nd6.h> #include <netsmb/smb_dev.h> |