diff options
author | jhay <jhay@FreeBSD.org> | 1996-08-18 08:38:15 +0000 |
---|---|---|
committer | jhay <jhay@FreeBSD.org> | 1996-08-18 08:38:15 +0000 |
commit | d6bf2142a96b9d276a9ea0816b9ea080f60cab45 (patch) | |
tree | 7e489a029de5d1f817bc7e0b69c713f8159b6584 /sys/netipx | |
parent | a49962396afc7a266dd129af317a1b2d82006043 (diff) | |
download | FreeBSD-src-d6bf2142a96b9d276a9ea0816b9ea080f60cab45.zip FreeBSD-src-d6bf2142a96b9d276a9ea0816b9ea080f60cab45.tar.gz |
Accept odd length ipx packets. (Win95 and some dialup servers use it.)
Original idea submitted by: Atsushi Murai <amurai@spec.co.jp>
Diffstat (limited to 'sys/netipx')
-rw-r--r-- | sys/netipx/ipx_input.c | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/sys/netipx/ipx_input.c b/sys/netipx/ipx_input.c index 2abfa28..b49c79d 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 <sys/param.h> @@ -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 @@ next: 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 @@ next: */ ipxintr_swtch++; if (ipxp) { - if (oddpacketp) { + if (oddshortpacket) { m_adj(m, -1); } if ((ipxp->ipxp_flags & IPXP_ALL_PACKETS)==0) |