[NETFILTER 12/39]: ipt_TTL: fix checksum update bug

Patrick McHardy kaber at trash.net
Wed Sep 20 10:24:06 CEST 2006


[NETFILTER]: ipt_TTL: fix checksum update bug

Fix regression introduced by the incremental checksum patches.

Signed-off-by: Patrick McHardy <kaber at trash.net>

---
commit 0c081f02b0a8b3a08aa5ddc888f9af834585d431
tree ff630777fb523976961ac8303d680c7cc0a00975
parent 56a0ea23e536624ad1ea186289bb5d686ca19425
author Patrick McHardy <kaber at trash.net> Wed, 20 Sep 2006 09:28:47 +0200
committer Patrick McHardy <kaber at trash.net> Wed, 20 Sep 2006 09:28:47 +0200

 net/ipv4/netfilter/ipt_TTL.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/net/ipv4/netfilter/ipt_TTL.c b/net/ipv4/netfilter/ipt_TTL.c
index 214d9d9..96e79cc 100644
--- a/net/ipv4/netfilter/ipt_TTL.c
+++ b/net/ipv4/netfilter/ipt_TTL.c
@@ -54,8 +54,8 @@ ipt_ttl_target(struct sk_buff **pskb,
 	}
 
 	if (new_ttl != iph->ttl) {
-		iph->check = nf_csum_update((iph->ttl << 8) ^ 0xFFFF,
-					    new_ttl << 8,
+		iph->check = nf_csum_update(ntohs((iph->ttl << 8)) ^ 0xFFFF,
+					    ntohs(new_ttl << 8),
 					    iph->check);
 		iph->ttl = new_ttl;
 	}



More information about the netfilter-devel mailing list