summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorsam <sam@FreeBSD.org>2008-04-25 19:45:42 +0000
committersam <sam@FreeBSD.org>2008-04-25 19:45:42 +0000
commitbc02c73d03dd05b60135c9d272ce6c154d146235 (patch)
treeda68c3e158210582fccb70234c6db5b6e3703072 /sys
parent9f3b3ed8241ecf4aebd7e67d040cbb71ff91e95e (diff)
downloadFreeBSD-src-bc02c73d03dd05b60135c9d272ce6c154d146235.zip
FreeBSD-src-bc02c73d03dd05b60135c9d272ce6c154d146235.tar.gz
hookup the parent device's if_input and if_output to stub routines
to catch unintended use (one might argue about if_output but it's behaviour is ill-defined without vap context) Noticed by: Paul B. Mahol
Diffstat (limited to 'sys')
-rw-r--r--sys/net80211/ieee80211.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/sys/net80211/ieee80211.c b/sys/net80211/ieee80211.c
index 952f420..e488bce 100644
--- a/sys/net80211/ieee80211.c
+++ b/sys/net80211/ieee80211.c
@@ -181,6 +181,22 @@ null_update_promisc(struct ifnet *ifp)
if_printf(ifp, "need promiscuous mode update callback\n");
}
+static int
+null_output(struct ifnet *ifp, struct mbuf *m,
+ struct sockaddr *dst, struct rtentry *rt0)
+{
+ if_printf(ifp, "discard raw packet\n");
+ m_freem(m);
+ return EIO;
+}
+
+static void
+null_input(struct ifnet *ifp, struct mbuf *m)
+{
+ if_printf(ifp, "if_input should not be called\n");
+ m_freem(m);
+}
+
/*
* Attach/setup the common net80211 state. Called by
* the driver on attach to prior to creating any vap's.
@@ -225,6 +241,9 @@ ieee80211_ifattach(struct ieee80211com *ic)
if_attach(ifp);
ifp->if_mtu = IEEE80211_MTU_MAX;
ifp->if_broadcastaddr = ieee80211broadcastaddr;
+ ifp->if_output = null_output;
+ ifp->if_input = null_input; /* just in case */
+ ifp->if_resolvemulti = NULL; /* NB: callers check */
ifa = ifaddr_byindex(ifp->if_index);
KASSERT(ifa != NULL, ("%s: no lladdr!\n", __func__));
OpenPOWER on IntegriCloud