summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrwatson <rwatson@FreeBSD.org>2002-10-20 22:27:59 +0000
committerrwatson <rwatson@FreeBSD.org>2002-10-20 22:27:59 +0000
commit9a588ee4bc78be5f657fbb1844ef821c733976a5 (patch)
treee89b7971a0bcf3b723423f91aa3579bf6849b067
parent1e6c984b5adc87ad318abd7186e14d2223c96db1 (diff)
downloadFreeBSD-src-9a588ee4bc78be5f657fbb1844ef821c733976a5.zip
FreeBSD-src-9a588ee4bc78be5f657fbb1844ef821c733976a5.tar.gz
When a packet is sent via a FDDI interface, perform appropriate MAC
transmission checks; when it is received, label the packet appropriately. Although we don't have a local FDDI setup to test this with, the labeling and checks are identical to other interface classes. Obtained from: TrustedBSD Project Sponsored by: DARPA, Network Associates Laboratories
-rw-r--r--sys/net/if_fddisubr.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/sys/net/if_fddisubr.c b/sys/net/if_fddisubr.c
index 997025d..680ed0d 100644
--- a/sys/net/if_fddisubr.c
+++ b/sys/net/if_fddisubr.c
@@ -40,10 +40,12 @@
#include "opt_inet.h"
#include "opt_inet6.h"
#include "opt_ipx.h"
+#include "opt_mac.h"
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/kernel.h>
+#include <sys/mac.h>
#include <sys/malloc.h>
#include <sys/mbuf.h>
#include <sys/module.h>
@@ -124,6 +126,12 @@ fddi_output(ifp, m, dst, rt0)
struct fddi_header *fh;
struct arpcom *ac = IFP2AC(ifp);
+#ifdef MAC
+ error = mac_check_ifnet_transmit(ifp, m);
+ if (error)
+ senderr(error);
+#endif
+
if ((ifp->if_flags & (IFF_UP|IFF_RUNNING)) != (IFF_UP|IFF_RUNNING))
senderr(ENETDOWN);
getmicrotime(&ifp->if_lastchange);
@@ -364,6 +372,10 @@ fddi_input(ifp, fh, m)
if ((ifp->if_flags & (IFF_UP|IFF_RUNNING)) != (IFF_UP|IFF_RUNNING))
goto dropanyway;
+#ifdef MAC
+ mac_create_mbuf_from_ifnet(ifp, m);
+#endif
+
/*
* Discard non local unicast packets when interface
* is in promiscuous mode.
OpenPOWER on IntegriCloud