-/* $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 $ */
/*
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;
etype = ntohs(eh->ether_type);
-decapsulate:
switch (etype) {
case ETHERTYPE_IP:
ipv4_input(ifp, m);
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);