From 30a8fe52b5c775691b5d3e6bbfbbd9a42264d0e2 Mon Sep 17 00:00:00 2001 From: mdodd Date: Sat, 15 Mar 2003 23:08:40 +0000 Subject: Don't strip header from packets before input routine is called. --- sys/net/if_iso88025subr.c | 30 ++++++++++++++++++++++++++---- sys/net/iso88025.h | 3 +-- 2 files changed, 27 insertions(+), 6 deletions(-) (limited to 'sys/net') diff --git a/sys/net/if_iso88025subr.c b/sys/net/if_iso88025subr.c index 3548c2b..0062f83 100644 --- a/sys/net/if_iso88025subr.c +++ b/sys/net/if_iso88025subr.c @@ -420,13 +420,22 @@ bad: * ISO 88025 de-encapsulation */ void -iso88025_input(ifp, th, m) +iso88025_input(ifp, m) struct ifnet *ifp; - struct iso88025_header *th; struct mbuf *m; { - int isr; + struct iso88025_header *th; struct llc *l; + int isr; + int mac_hdr_len; + + m = m_pullup(m, ISO88025_HDR_LEN); + if (m == NULL) { + ifp->if_ierrors++; + goto dropanyway; + } + th = mtod(m, struct iso88025_header *); + m->m_pkthdr.header = (void *)th; /* * Discard packet if interface is not up. @@ -441,7 +450,7 @@ iso88025_input(ifp, th, m) /* * Update interface statistics. */ - ifp->if_ibytes += m->m_pkthdr.len + sizeof(*th); + ifp->if_ibytes += m->m_pkthdr.len; getmicrotime(&ifp->if_lastchange); /* @@ -466,6 +475,19 @@ iso88025_input(ifp, th, m) ifp->if_imcasts++; } + mac_hdr_len = ISO88025_HDR_LEN; + /* Check for source routing info */ + if (th->iso88025_shost[0] & TR_RII) + mac_hdr_len += TR_RCF_RIFLEN(th->rcf); + + /* Strip off ISO88025 header. */ + m_adj(m, mac_hdr_len); + + m = m_pullup(m, LLC_SNAPFRAMELEN); + if (m == 0) { + ifp->if_ierrors++; + goto dropanyway; + } l = mtod(m, struct llc *); switch (l->llc_dsap) { diff --git a/sys/net/iso88025.h b/sys/net/iso88025.h index f463647..6378bb4 100644 --- a/sys/net/iso88025.h +++ b/sys/net/iso88025.h @@ -139,7 +139,6 @@ void iso88025_ifdetach (struct ifnet *, int); int iso88025_ioctl (struct ifnet *, int , caddr_t ); int iso88025_output (struct ifnet *, struct mbuf *, struct sockaddr *, struct rtentry *); -void iso88025_input (struct ifnet *, struct iso88025_header *, - struct mbuf *); +void iso88025_input (struct ifnet *, struct mbuf *); #endif -- cgit v1.1