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.
This commit is contained in:
parent
39824ae151
commit
896e3f467b
@ -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)
|
||||
|
@ -43,9 +43,6 @@ struct file;
|
||||
#include <sys/socket.h>
|
||||
#include <net/if.h>
|
||||
|
||||
#define _WANT_IFADDR
|
||||
#include <net/if_var.h>
|
||||
|
||||
#include <netinet/in.h>
|
||||
#include <netinet/in_systm.h>
|
||||
#include <netinet/ip.h>
|
||||
|
Loading…
Reference in New Issue
Block a user