patch-2.2.18 linux/include/net/ip.h
Next file: linux/include/net/ipconfig.h
Previous file: linux/include/net/af_unix.h
Back to the patch index
Back to the overall index
- Lines: 13
- Date:
Thu Dec 7 15:11:17 2000
- Orig file:
v2.2.17/include/net/ip.h
- Orig date:
Fri Apr 21 23:11:52 2000
diff -u --new-file --recursive --exclude-from /usr/src/exclude v2.2.17/include/net/ip.h linux/include/net/ip.h
@@ -171,10 +171,8 @@
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);
+ check += __constant_htons(0x0100);
+ iph->check = check + (check>=0xFFFF);
return --iph->ttl;
}
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)