svn commit: r200990 - user/luigi/ipfw3-head/sys/netinet/ipfw

Luigi Rizzo luigi at FreeBSD.org
Fri Dec 25 17:05:56 UTC 2009


Author: luigi
Date: Fri Dec 25 17:05:55 2009
New Revision: 200990
URL: http://svn.freebsd.org/changeset/base/200990

Log:
  make it possible to omit the bpf support

Modified:
  user/luigi/ipfw3-head/sys/netinet/ipfw/ip_fw_log.c

Modified: user/luigi/ipfw3-head/sys/netinet/ipfw/ip_fw_log.c
==============================================================================
--- user/luigi/ipfw3-head/sys/netinet/ipfw/ip_fw_log.c	Fri Dec 25 16:53:14 2009	(r200989)
+++ user/luigi/ipfw3-head/sys/netinet/ipfw/ip_fw_log.c	Fri Dec 25 17:05:55 2009	(r200990)
@@ -87,6 +87,12 @@ __FBSDID("$FreeBSD$");
 #define SNPARGS(buf, len) buf + len, sizeof(buf) > len ? sizeof(buf) - len : 0
 #define SNP(buf) buf, sizeof(buf)
 
+#ifdef WITHOUT_BPF
+void
+ipfw_log_bpf(int onoff)
+{
+}
+#else /* !WITHOUT_BPF */
 static struct ifnet *log_if;	/* hook to attach to bpf */
 
 /* we use this dummy function for all ifnet callbacks */
@@ -128,6 +134,7 @@ ipfw_log_bpf(int onoff)
 		log_if = NULL;
 	}
 }
+#endif /* !WITHOUT_BPF */
 
 /*
  * We enter here when we have a rule with O_LOG.
@@ -143,6 +150,7 @@ ipfw_log(struct ip_fw *f, u_int hlen, st
 	char action2[40], proto[128], fragment[32];
 
 	if (V_fw_verbose == 0) {
+#ifndef WITHOUT_BPF
 		struct m_hdr mh;
 
 		if (log_if == NULL || log_if->if_bpf == NULL)
@@ -173,6 +181,7 @@ ipfw_log(struct ip_fw *f, u_int hlen, st
 			ip->ip_len = htons(ip->ip_len);
 		}
 #endif /* !HAVE_NET_IPLEN */
+#endif /* !WITHOUT_BPF */
 		return;
 	}
 	/* the old 'log' function */


More information about the svn-src-user mailing list