From 0b03acb80bcb6b1aeda47e1e659fb29a80fc837f Mon Sep 17 00:00:00 2001 From: dlg Date: Thu, 4 Jan 2018 00:33:54 +0000 Subject: [PATCH] remove support for decapsulating LLC/SNAP frames. the code was broken and noone noticed. this argues that we don't need it. ok mpi@ --- sys/net/if_ethersubr.c | 29 ++--------------------------- 1 file changed, 2 insertions(+), 27 deletions(-) diff --git a/sys/net/if_ethersubr.c b/sys/net/if_ethersubr.c index f0dadddfbfc..f6376883b54 100644 --- a/sys/net/if_ethersubr.c +++ b/sys/net/if_ethersubr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_ethersubr.c,v 1.247 2018/01/03 19:39:36 denis Exp $ */ +/* $OpenBSD: if_ethersubr.c,v 1.248 2018/01/04 00:33:54 dlg Exp $ */ /* $NetBSD: if_ethersubr.c,v 1.19 1996/05/07 02:40:30 thorpej Exp $ */ /* @@ -317,8 +317,6 @@ ether_input(struct ifnet *ifp, struct mbuf *m, void *cookie) struct ether_header *eh; struct niqueue *inq; u_int16_t etype; - int llcfound = 0; - struct llc *l; struct arpcom *ac; #if NPPPOE > 0 struct ether_header *eh_tmp; @@ -376,7 +374,6 @@ ether_input(struct ifnet *ifp, struct mbuf *m, void *cookie) etype = ntohs(eh->ether_type); -decapsulate: switch (etype) { case ETHERTYPE_IP: ipv4_input(ifp, m); @@ -441,29 +438,7 @@ decapsulate: return (1); #endif default: - if (llcfound || etype > ETHERMTU || - m->m_len < sizeof(struct llc)) - goto dropanyway; - llcfound = 1; - l = mtod(m, struct llc *); - switch (l->llc_dsap) { - case LLC_SNAP_LSAP: - if (l->llc_control == LLC_UI && - l->llc_dsap == LLC_SNAP_LSAP && - l->llc_ssap == LLC_SNAP_LSAP) { - /* SNAP */ - if (m->m_pkthdr.len > etype) - m_adj(m, etype - m->m_pkthdr.len); - m_adj(m, 6); - M_PREPEND(m, sizeof(*eh), M_DONTWAIT); - if (m == NULL) - return (1); - *mtod(m, struct ether_header *) = *eh; - goto decapsulate; - } - default: - goto dropanyway; - } + goto dropanyway; } niq_enqueue(inq, m); -- 2.20.1