summaryrefslogtreecommitdiffstats
path: root/sys/contrib/ipfilter/netinet
diff options
context:
space:
mode:
authorbz <bz@FreeBSD.org>2008-08-17 23:27:27 +0000
committerbz <bz@FreeBSD.org>2008-08-17 23:27:27 +0000
commit1021d43b569bfc8d2c5544bde2f540fa432b011f (patch)
tree1496da534aec03cf2f9d2d0735d80e4c1e3b5715 /sys/contrib/ipfilter/netinet
parent7fc341305a3e341fca7f202fc1219358f8d9dbbd (diff)
downloadFreeBSD-src-1021d43b569bfc8d2c5544bde2f540fa432b011f.zip
FreeBSD-src-1021d43b569bfc8d2c5544bde2f540fa432b011f.tar.gz
Commit step 1 of the vimage project, (network stack)
virtualization work done by Marko Zec (zec@). This is the first in a series of commits over the course of the next few weeks. Mark all uses of global variables to be virtualized with a V_ prefix. Use macros to map them back to their global names for now, so this is a NOP change only. We hope to have caught at least 85-90% of what is needed so we do not invalidate a lot of outstanding patches again. Obtained from: //depot/projects/vimage-commit2/... Reviewed by: brooks, des, ed, mav, julian, jamie, kris, rwatson, zec, ... (various people I forgot, different versions) md5 (with a bit of help) Sponsored by: NLnet Foundation, The FreeBSD Foundation X-MFC after: never V_Commit_Message_Reviewed_By: more people than the patch
Diffstat (limited to 'sys/contrib/ipfilter/netinet')
-rw-r--r--sys/contrib/ipfilter/netinet/fil.c3
-rw-r--r--sys/contrib/ipfilter/netinet/ip_fil_freebsd.c14
2 files changed, 13 insertions, 4 deletions
diff --git a/sys/contrib/ipfilter/netinet/fil.c b/sys/contrib/ipfilter/netinet/fil.c
index ea19254..3cd09d1 100644
--- a/sys/contrib/ipfilter/netinet/fil.c
+++ b/sys/contrib/ipfilter/netinet/fil.c
@@ -33,6 +33,9 @@
# if (__FreeBSD_version == 400019)
# define CSUM_DELAY_DATA
# endif
+# if (__FreeBSD_version >= 800044)
+# include <sys/vimage.h>
+# endif
# endif
# include <sys/filio.h>
#else
diff --git a/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c b/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c
index 0eb2632..7bfd1de 100644
--- a/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c
+++ b/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c
@@ -62,6 +62,12 @@ static const char rcsid[] = "@(#)$Id: ip_fil_freebsd.c,v 2.53.2.50 2007/09/20 12
#else
# include <sys/select.h>
#endif
+#if __FreeBSD_version >= 800044
+# include <sys/vimage.h>
+#else
+#define V_path_mtu_discovery path_mtu_discovery
+#define V_ipforwarding ipforwarding
+#endif
#include <net/if.h>
#if __FreeBSD_version >= 300000
@@ -234,7 +240,7 @@ int ipfattach()
fr_running = 1;
if (fr_control_forwarding & 1)
- ipforwarding = 1;
+ V_ipforwarding = 1;
SPL_X(s);
#if (__FreeBSD_version >= 300000)
@@ -257,7 +263,7 @@ int ipfdetach()
int s;
#endif
if (fr_control_forwarding & 2)
- ipforwarding = 0;
+ V_ipforwarding = 0;
SPL_NET(s);
@@ -652,11 +658,11 @@ mb_t *m, **mpp;
ip->ip_tos = oip->ip_tos;
ip->ip_id = fin->fin_ip->ip_id;
#if (__FreeBSD_version > 460000)
- ip->ip_off = path_mtu_discovery ? IP_DF : 0;
+ ip->ip_off = V_path_mtu_discovery ? IP_DF : 0;
#else
ip->ip_off = 0;
#endif
- ip->ip_ttl = ip_defttl;
+ ip->ip_ttl = V_ip_defttl;
ip->ip_sum = 0;
hlen = sizeof(*oip);
break;
OpenPOWER on IntegriCloud