aboutsummaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorRobert Watson <rwatson@FreeBSD.org>2002-10-20 22:39:55 +0000
committerRobert Watson <rwatson@FreeBSD.org>2002-10-20 22:39:55 +0000
commit6b459e4956be7f3a80135d2cbc27867a5555c89c (patch)
tree2c60162b47cf187553c522fa319748f8f66912e5 /sys
parent33f9080f82f41f4950b18217478d3a2b4f72b80f (diff)
downloadsrc-6b459e4956be7f3a80135d2cbc27867a5555c89c.tar.gz
src-6b459e4956be7f3a80135d2cbc27867a5555c89c.zip
When packets pass in and out of six-to-four (STF) tunnels, perform
labeling checks and operations as with other network interfaces. Eventually, if it proves desirable, we might want to offer special casing of this or other tunnel interfaces where we have an existing label of interest, rather than treating it as though it's an entirely fresh mbuf in the incoming/outgoing encapsulation directions. Obtained from: TrustedBSD Project Sponsored by: DARPA, Network Associates Laboratories
Notes
Notes: svn path=/head/; revision=105580
Diffstat (limited to 'sys')
-rw-r--r--sys/net/if_stf.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/sys/net/if_stf.c b/sys/net/if_stf.c
index 1acc0a6d0384..88d9d078df92 100644
--- a/sys/net/if_stf.c
+++ b/sys/net/if_stf.c
@@ -76,11 +76,13 @@
#include "opt_inet.h"
#include "opt_inet6.h"
+#include "opt_mac.h"
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/socket.h>
#include <sys/sockio.h>
+#include <sys/mac.h>
#include <sys/mbuf.h>
#include <sys/errno.h>
#include <sys/kernel.h>
@@ -355,6 +357,15 @@ stf_output(ifp, m, dst, rt)
struct ip *ip;
struct ip6_hdr *ip6;
struct in6_ifaddr *ia6;
+#ifdef MAC
+ int error;
+
+ error = mac_check_ifnet_transmit(ifp, m);
+ if (error) {
+ m_freem(m);
+ return (error);
+ }
+#endif
sc = (struct stf_softc*)ifp;
dst6 = (struct sockaddr_in6 *)dst;
@@ -613,6 +624,10 @@ in_stf_input(m, off)
ifp = &sc->sc_if;
+#ifdef MAC
+ mac_create_mbuf_from_ifnet(ifp, m);
+#endif
+
/*
* perform sanity check against outer src/dst.
* for source, perform ingress filter as well.