bostic@OKEEFFE.BERKELEY.EDU (Keith Bostic) (05/06/88)
Subject: Bug in forwarding XNS packets on Suns, CCI's Index: sys/netns/4.3BSD Description: If a system running 4.3BSD is forwarding XNS packets from one network to another, and the system is a Big-Endian machine, such as a 68000 based CPU, or CCI machine, some XNS packets will be incorrectly checksumed on the outgoing network. This depends on the length of the packet and the previous value of the checksum. This bug persists in the recently released public version of XNS. Repeat By: Not worth writing a demonstration program. Bug is obvious. Fix: *** ns_input.c.bad Wed May 4 11:46:08 1988 --- ns_input.c Wed May 4 11:45:35 1988 *************** *** 12,12 **** ! * @(#)ns_input.c 7.2 (Berkeley) 1/20/88 --- 12,12 ---- ! * @(#)ns_input.c 7.3 (Berkeley) 5/4/88 *************** *** 363,369 **** register int shift; x.l = 0; x.c[0] = agedelta; shift = (((((int)ntohs(idp->idp_len))+1)>>1)-2) & 0xf; ! x.l = idp->idp_sum + (x.l << shift); x.l = x.s[0] + x.s[1]; x.l = x.s[0] + x.s[1]; if (x.l==0xffff) idp->idp_sum = 0; else idp->idp_sum = x.l; --- 363,369 ---- register int shift; x.l = 0; x.c[0] = agedelta; shift = (((((int)ntohs(idp->idp_len))+1)>>1)-2) & 0xf; ! x.l = idp->idp_sum + (x.s[0] << shift); x.l = x.s[0] + x.s[1]; x.l = x.s[0] + x.s[1]; if (x.l==0xffff) idp->idp_sum = 0; else idp->idp_sum = x.l;