[kernel] r8311 - in dists/sid/linux-2.6/debian: . patches/bugfix patches/series

maximilian attems maks-guest at alioth.debian.org
Fri Feb 16 11:43:09 UTC 2007


Author: maks-guest
Date: Fri Feb 16 12:43:09 2007
New Revision: 8311

Added:
   dists/sid/linux-2.6/debian/patches/bugfix/net-ipx-annotation-checksum.patch
Modified:
   dists/sid/linux-2.6/debian/changelog
   dists/sid/linux-2.6/debian/patches/series/11
Log:
Fix the last remaining 2.6.16.X patch
bigger IPX patch got splitted as needed forward port


Modified: dists/sid/linux-2.6/debian/changelog
==============================================================================
--- dists/sid/linux-2.6/debian/changelog	(original)
+++ dists/sid/linux-2.6/debian/changelog	Fri Feb 16 12:43:09 2007
@@ -16,8 +16,9 @@
   [ maximilian attems ]
   * Fix incomplete ipv6 multicast patch from 2.6.16.38. (closes: #410375)
   * UML compile 2.6.16.38 fix forward port completed.
+  * Forward port complete IPX checksum patch 2.6.16.34
 
- -- maximilian attems <maks at sternwelten.at>  Fri, 16 Feb 2007 12:35:02 +0100
+ -- maximilian attems <maks at sternwelten.at>  Fri, 16 Feb 2007 12:42:30 +0100
 
 linux-2.6 (2.6.18.dfsg.1-10) unstable; urgency=low
 

Added: dists/sid/linux-2.6/debian/patches/bugfix/net-ipx-annotation-checksum.patch
==============================================================================
--- (empty file)
+++ dists/sid/linux-2.6/debian/patches/bugfix/net-ipx-annotation-checksum.patch	Fri Feb 16 12:43:09 2007
@@ -0,0 +1,98 @@
+commit d6042b2ec9446e7955d72a2155a4dff473ccc511
+Author: Al Viro <viro at zeniv.linux.org.uk>
+Date:   Fri Nov 24 03:03:34 2006 +0100
+
+    [IPX]: Annotate and fix IPX checksum
+    
+    Calculation of IPX checksum got buggered about 2.4.0.  The old variant
+    mangled the packet; that got fixed, but calculation itself got buggered.
+    Restored the correct logics, fixed a subtle breakage we used to have even
+    back then: if the sum is 0 mod 0xffff, we want to return 0, not 0xffff.
+    The latter has special meaning for IPX (cheksum disabled).  Observation
+    (and obvious fix) nicked from history of FreeBSD ipx_cksum.c...
+    
+    Signed-off-by: Al Viro <viro at zeniv.linux.org.uk>
+    Signed-off-by: David S. Miller <davem at davemloft.net>
+    Signed-off-by: Adrian Bunk <bunk at stusta.de>
+
+diff --git a/net/ipx/af_ipx.c b/net/ipx/af_ipx.c
+index c55b2a9..8b0c25f 100644
+--- a/net/ipx/af_ipx.c
++++ b/net/ipx/af_ipx.c
+@@ -1235,27 +1235,27 @@ static int ipxitf_ioctl(unsigned int cmd, void __user *arg)
+ /* Note: We assume ipx_tctrl==0 and htons(length)==ipx_pktsize */
+ /* This functions should *not* mess with packet contents */
+ 
+-__u16 ipx_cksum(struct ipxhdr *packet, int length) 
++__be16 ipx_cksum(struct ipxhdr *packet, int length)
+ {
+ 	/* 
+ 	 *	NOTE: sum is a net byte order quantity, which optimizes the 
+ 	 *	loop. This only works on big and little endian machines. (I
+ 	 *	don't know of a machine that isn't.)
+ 	 */
+-	/* start at ipx_dest - We skip the checksum field and start with
+-	 * ipx_type before the loop, not considering ipx_tctrl in the calc */
+-	__u16 *p = (__u16 *)&packet->ipx_dest;
+-	__u32 i = (length >> 1) - 1; /* Number of complete words */
+-	__u32 sum = packet->ipx_type << sizeof(packet->ipx_tctrl); 
+-
+-	/* Loop through all complete words except the checksum field,
+-	 * ipx_type (accounted above) and ipx_tctrl (not used in the cksum) */
+-	while (--i)
++	/* handle the first 3 words separately; checksum should be skipped
++	 * and ipx_tctrl masked out */
++	__u16 *p = (__u16 *)packet;
++	__u32 sum = p[1] + (p[2] & (__force u16)htons(0x00ff));
++	__u32 i = (length >> 1) - 3; /* Number of remaining complete words */
++
++	/* Loop through them */
++	p += 3;
++	while (i--)
+ 		sum += *p++;
+ 
+ 	/* Add on the last part word if it exists */
+ 	if (packet->ipx_pktsize & htons(1))
+-		sum += ntohs(0xff00) & *p;
++		sum += (__force u16)htons(0xff00) & *p;
+ 
+ 	/* Do final fixup */
+ 	sum = (sum & 0xffff) + (sum >> 16);
+@@ -1264,7 +1264,14 @@ __u16 ipx_cksum(struct ipxhdr *packet, int length)
+ 	if (sum >= 0x10000)
+ 		sum++;
+ 
+-	return ~sum;
++	/*
++	 * Leave 0 alone; we don't want 0xffff here.  Note that we can't get
++	 * here with 0x10000, so this check is the same as ((__u16)sum)
++	 */
++	if (sum)
++		sum = ~sum;
++
++	return (__force __be16)sum;
+ }
+ 
+ const char *ipx_frame_name(unsigned short frame)
+diff --git a/net/ipx/ipx_route.c b/net/ipx/ipx_route.c
+index 6777444..5d4ddf7 100644
+--- a/net/ipx/ipx_route.c
++++ b/net/ipx/ipx_route.c
+@@ -20,7 +20,7 @@ DEFINE_RWLOCK(ipx_routes_lock);
+ 
+ extern struct ipx_interface *ipx_internal_net;
+ 
+-extern __u16 ipx_cksum(struct ipxhdr *packet, int length);
++extern __be16 ipx_cksum(struct ipxhdr *packet, int length);
+ extern struct ipx_interface *ipxitf_find_using_net(__u32 net);
+ extern int ipxitf_demux_socket(struct ipx_interface *intrfc,
+ 			       struct sk_buff *skb, int copy);
+@@ -239,7 +239,7 @@ int ipxrtr_route_packet(struct sock *sk, struct sockaddr_ipx *usipx,
+ 
+ 	/* Apply checksum. Not allowed on 802.3 links. */
+ 	if (sk->sk_no_check || intrfc->if_dlink_type == htons(IPX_FRAME_8023))
+-		ipx->ipx_checksum = 0xFFFF;
++		ipx->ipx_checksum = htons(0xFFFF);
+ 	else
+ 		ipx->ipx_checksum = ipx_cksum(ipx, len + sizeof(struct ipxhdr));
+ 

Modified: dists/sid/linux-2.6/debian/patches/series/11
==============================================================================
--- dists/sid/linux-2.6/debian/patches/series/11	(original)
+++ dists/sid/linux-2.6/debian/patches/series/11	Fri Feb 16 12:43:09 2007
@@ -1,5 +1,5 @@
-- bugfix/2.6.16.34
 + bugfix/atiixp-only-one-channel.patch
 + bugfix/atiixp-cable-detection-support.patch
 + bugfix/net-ipv6-mcast.patch
 + bugfix/uml-compilation.patch
++ bugfix/net-ipx-annotation-checksum.patch



More information about the Kernel-svn-changes mailing list