Author: glebius
Date: Thu Feb 19 23:14:35 2015
New Revision: 279029
URL: https://svnweb.freebsd.org/changeset/base/279029
Log:
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.
Modified:
head/contrib/ipfilter/ip_fil.c
head/contrib/ipfilter/ipf.h
Modified: head/contrib/ipfilter/ip_fil.c
==============================================================================
--- head/contrib/ipfilter/ip_fil.c Thu Feb 19 22:42:33 2015
(r279028)
+++ head/contrib/ipfilter/ip_fil.c Thu Feb 19 23:14:35 2015
(r279029)
@@ -44,6 +44,9 @@ static int write_output __P((struct ifne
# endif
#endif
+struct ifaddr {
+ struct sockaddr_storage ifa_addr;
+};
int
ipfattach(softc)
Modified: head/contrib/ipfilter/ipf.h
==============================================================================
--- head/contrib/ipfilter/ipf.h Thu Feb 19 22:42:33 2015 (r279028)
+++ head/contrib/ipfilter/ipf.h Thu Feb 19 23:14:35 2015 (r279029)
@@ -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>
_______________________________________________
[email protected] mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "[email protected]"