From 896e3f467bb1988d34b0711c1ccc64990fab0ce7 Mon Sep 17 00:00:00 2001 From: glebius Date: Thu, 19 Feb 2015 23:14:35 +0000 Subject: The ipftest(1) is a program that emulates ipf(4) operation and tests packets against rules. It definitely doesn't need to know about kernel internals, such as 'struct ifaddr'. What it does with ifaddr, is that it only takes ifa_addr member of it, and treats it as sockaddr, while it is only a pointer to sockaddr. Fortunately, sizeof(struct ifaddr) > sizeof(struct sockaddr_in6), so no problems arise. Fix that declaring a private struct ifaddr in ipftest(1) and stop including if_var.h. Sponsored by: Netflix Sponsored by: Nginx, Inc. --- contrib/ipfilter/ip_fil.c | 3 +++ contrib/ipfilter/ipf.h | 3 --- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/contrib/ipfilter/ip_fil.c b/contrib/ipfilter/ip_fil.c index 9178bd3..03e4093 100644 --- a/contrib/ipfilter/ip_fil.c +++ b/contrib/ipfilter/ip_fil.c @@ -44,6 +44,9 @@ static int write_output __P((struct ifnet *, struct mbuf *, # endif #endif +struct ifaddr { + struct sockaddr_storage ifa_addr; +}; int ipfattach(softc) diff --git a/contrib/ipfilter/ipf.h b/contrib/ipfilter/ipf.h index d4bd524..dfae008 100644 --- a/contrib/ipfilter/ipf.h +++ b/contrib/ipfilter/ipf.h @@ -43,9 +43,6 @@ struct file; #include #include -#define _WANT_IFADDR -#include - #include #include #include -- cgit v1.1