patch-2.3.49 linux/include/net/ip.h

Next file: linux/include/net/ipv6.h
Previous file: linux/include/net/dn_neigh.h
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.3.48/linux/include/net/ip.h linux/include/net/ip.h
@@ -170,11 +170,9 @@
 extern __inline__
 int ip_decrease_ttl(struct iphdr *iph)
 {
-	u16 check = iph->check;
-	check = ntohs(check) + 0x0100;
-	if ((check & 0xFF00) == 0)
-		check++;		/* carry overflow */
-	iph->check = htons(check);
+	u32 check = iph->check;
+	check += __constant_htons(0x0100);
+	iph->check = check + (check>>16);
 	return --iph->ttl;
 }
 

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)