diff options
author | glebius <glebius@FreeBSD.org> | 2014-03-12 10:45:58 +0000 |
---|---|---|
committer | glebius <glebius@FreeBSD.org> | 2014-03-12 10:45:58 +0000 |
commit | f937dcf2bd0584087acec5d8dc92dd5dba177113 (patch) | |
tree | 8cbef21f45f26a80647ff8a0604c3c9c65c2bb40 /usr.bin | |
parent | eeff801556700aefbd569ad4bac5acdebcc3b9a8 (diff) | |
download | FreeBSD-src-f937dcf2bd0584087acec5d8dc92dd5dba177113.zip FreeBSD-src-f937dcf2bd0584087acec5d8dc92dd5dba177113.tar.gz |
Bulk sync of pf changes from head, in attempt to fixup broken build I
made in r263029.
Merge r257186,257215,257349,259736,261797.
These changesets split pfvar.h into several smaller headers and make
userland utilities to include only some of them.
Diffstat (limited to 'usr.bin')
-rw-r--r-- | usr.bin/kdump/Makefile | 6 | ||||
-rw-r--r-- | usr.bin/kdump/mkioctls | 6 | ||||
-rw-r--r-- | usr.bin/netstat/Makefile | 4 | ||||
-rw-r--r-- | usr.bin/netstat/if.c | 8 | ||||
-rw-r--r-- | usr.bin/netstat/main.c | 2 |
5 files changed, 23 insertions, 3 deletions
diff --git a/usr.bin/kdump/Makefile b/usr.bin/kdump/Makefile index f19bd16..1fe42f2 100644 --- a/usr.bin/kdump/Makefile +++ b/usr.bin/kdump/Makefile @@ -1,6 +1,8 @@ # @(#)Makefile 8.1 (Berkeley) 6/6/93 # $FreeBSD$ +.include <bsd.own.mk> + .if (${MACHINE_ARCH} == "amd64") SFX= 32 .endif @@ -12,6 +14,10 @@ SRCS= kdump_subr.c kdump.c ioctl.c subr.c DPSRCS= kdump_subr.h CFLAGS+= -I${.CURDIR}/../ktrace -I${.CURDIR} -I${.CURDIR}/../.. -I. +.if ${MK_PF} != "no" +CFLAGS+=-DPF +.endif + .if ${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "i386" SRCS+= linux_syscalls.c .endif diff --git a/usr.bin/kdump/mkioctls b/usr.bin/kdump/mkioctls index 0dac684..a9ba860 100644 --- a/usr.bin/kdump/mkioctls +++ b/usr.bin/kdump/mkioctls @@ -21,7 +21,8 @@ LC_ALL=C; export LC_ALL # XXX should we use an ANSI cpp? ioctl_includes=$( cd $includedir - find -H -s * -name '*.h' | grep -v '.*disk.*\.h' | \ + find -H -s * -name '*.h' | \ + egrep -v '(.*disk.*|net/pfvar|net/if_pfsync)\.h' | \ xargs egrep -l \ '^#[ ]*define[ ]+[A-Za-z_][A-Za-z0-9_]*[ ]+_IO[^a-z0-9_]' | awk '{printf("#include <%s>\\n", $1)}' @@ -54,7 +55,10 @@ BEGIN { print "#include <net/ethernet.h>" print "#include <net/if.h>" print "#include <net/if_var.h>" + print "#ifdef PF" print "#include <net/pfvar.h>" + print "#include <net/if_pfsync.h>" + print "#endif" print "#include <net/route.h>" print "#include <netinet/in.h>" print "#include <netinet/ip_mroute.h>" diff --git a/usr.bin/netstat/Makefile b/usr.bin/netstat/Makefile index 1644aab..2432cfb 100644 --- a/usr.bin/netstat/Makefile +++ b/usr.bin/netstat/Makefile @@ -27,6 +27,10 @@ CFLAGS+=-DINET6 CFLAGS+=-DSDP .endif +.if ${MK_PF} != "no" +CFLAGS+=-DPF +.endif + BINGRP= kmem BINMODE=2555 DPADD= ${LIBKVM} ${LIBMEMSTAT} ${LIBUTIL} diff --git a/usr.bin/netstat/if.c b/usr.bin/netstat/if.c index 1ec0beb..e0f6e28 100644 --- a/usr.bin/netstat/if.c +++ b/usr.bin/netstat/if.c @@ -49,13 +49,15 @@ __FBSDID("$FreeBSD$"); #include <net/if_dl.h> #include <net/if_types.h> #include <net/ethernet.h> -#include <net/pfvar.h> -#include <net/if_pfsync.h> #include <netinet/in.h> #include <netinet/in_var.h> #include <netipx/ipx.h> #include <netipx/ipx_if.h> #include <arpa/inet.h> +#ifdef PF +#include <net/pfvar.h> +#include <net/if_pfsync.h> +#endif #include <err.h> #include <errno.h> @@ -81,6 +83,7 @@ static void sidewaysintpr(int); static char addr_buf[NI_MAXHOST]; /* for getnameinfo() */ #endif +#ifdef PF static const char* pfsyncacts[] = { /* PFSYNC_ACT_CLR */ "clear all request", /* PFSYNC_ACT_INS */ "state insert", @@ -155,6 +158,7 @@ pfsync_stats(u_long off, const char *name, int af1 __unused, int proto __unused) p(pfsyncs_oerrors, "\t\t%ju send error%s\n"); #undef p } +#endif /* PF */ /* * Display a formatted value, or a '-' in the same space. diff --git a/usr.bin/netstat/main.c b/usr.bin/netstat/main.c index 5c952ad..0876460 100644 --- a/usr.bin/netstat/main.c +++ b/usr.bin/netstat/main.c @@ -214,8 +214,10 @@ struct protox { pim_stats, NULL, "pim", 1, IPPROTO_PIM }, { -1, N_CARPSTAT, 1, NULL, carp_stats, NULL, "carp", 1, 0 }, +#ifdef PF { -1, N_PFSYNCSTAT, 1, NULL, pfsync_stats, NULL, "pfsync", 1, 0 }, +#endif { -1, N_ARPSTAT, 1, NULL, arp_stats, NULL, "arp", 1, 0 }, { -1, -1, 0, NULL, |