summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormdodd <mdodd@FreeBSD.org>2003-03-15 23:08:40 +0000
committermdodd <mdodd@FreeBSD.org>2003-03-15 23:08:40 +0000
commit30a8fe52b5c775691b5d3e6bbfbbd9a42264d0e2 (patch)
tree3713defd246614ac3c34fb5fcb1827122f2c6310
parent08b4bf73c6d4d0df8bdd5605f5b8d8f7260fb6f2 (diff)
downloadFreeBSD-src-30a8fe52b5c775691b5d3e6bbfbbd9a42264d0e2.zip
FreeBSD-src-30a8fe52b5c775691b5d3e6bbfbbd9a42264d0e2.tar.gz
Don't strip header from packets before input routine is called.
-rw-r--r--sys/net/if_iso88025subr.c30
-rw-r--r--sys/net/iso88025.h3
2 files changed, 27 insertions, 6 deletions
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
OpenPOWER on IntegriCloud