From d6bf2142a96b9d276a9ea0816b9ea080f60cab45 Mon Sep 17 00:00:00 2001 From: jhay Date: Sun, 18 Aug 1996 08:38:15 +0000 Subject: [PATCH] Accept odd length ipx packets. (Win95 and some dialup servers use it.) Original idea submitted by: Atsushi Murai --- sys/netipx/ipx_input.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/sys/netipx/ipx_input.c b/sys/netipx/ipx_input.c index 2abfa2874711..b49c79d95779 100644 --- a/sys/netipx/ipx_input.c +++ b/sys/netipx/ipx_input.c @@ -33,7 +33,7 @@ * * @(#)ipx_input.c * - * $Id: ipx_input.c,v 1.7 1996/01/05 20:47:04 wollman Exp $ + * $Id: ipx_input.c,v 1.8 1996/03/11 15:13:48 davidg Exp $ */ #include @@ -138,7 +138,7 @@ ipxintr() register struct ipxpcb *ipxp; register int i; int len, s, error; - char oddpacketp; + char oddshortpacket = 0; next: /* @@ -167,9 +167,13 @@ ipxintr() ipx = mtod(m, struct ipx *); len = ntohs(ipx->ipx_len); - if (oddpacketp = len & 1) { - len++; /* If this packet is of odd length, - preserve garbage byte for checksum */ + if ((len < m->m_pkthdr.len) && (oddshortpacket = len & 1)) { + /* + * If this packet is of odd length, and the length + * inside the header is less than the received packet + * length, preserve garbage byte for possible checksum. + */ + len++; } /* @@ -241,7 +245,7 @@ ipxintr() */ ipxintr_swtch++; if (ipxp) { - if (oddpacketp) { + if (oddshortpacket) { m_adj(m, -1); } if ((ipxp->ipxp_flags & IPXP_ALL_PACKETS)==0)