Subject: PR/32644 CVS commit: src/sys/dev/pci
To: None <kern-bug-people@netbsd.org, gnats-admin@netbsd.org,>
From: Pavel Cahyna <pavel@netbsd.org>
List: netbsd-bugs
Date: 04/18/2006 13:10:02
The following reply was made to PR kern/32644; it has been noted by GNATS.

From: Pavel Cahyna <pavel@netbsd.org>
To: gnats-bugs@netbsd.org
Cc: 
Subject: PR/32644 CVS commit: src/sys/dev/pci
Date: Tue, 18 Apr 2006 13:07:03 +0000 (UTC)

 Module Name:	src
 Committed By:	pavel
 Date:		Tue Apr 18 13:07:03 UTC 2006
 
 Modified Files:
 	src/sys/dev/pci: if_sip.c
 
 Log Message:
 VLAN tags were sent byte-swapped by the gsip driver, because the driver
 forgets to convert them from the host to the network byte order. Use
 bswap16 to convert them. (Not htons, because on a big-endian machine, they
 are in the correct byte order initially, but then, they are byte-swapped
 by a htole32 call when written to the transmit descriptor. So
 byte-swapping is needed in this case too, to compensate for this htole32
 call.)
 
 For a similar reason, tags were seen byte-swapped when received on a
 big-endian machine. Replace ntohs by bswap16 in the input path too.
 (Again, it is needed to compensate for a le32toh call when the receive
 descriptor is read.)
 
 Fixes PR 32644.
 
 Tested on 3.0/i386, 3.0/sgimips and current/alpha.
 
 OK by martin@.
 
 
 To generate a diff of this commit:
 cvs rdiff -r1.106 -r1.107 src/sys/dev/pci/if_sip.c
 
 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.