Skip to contentSkip to conversation

IPVS: ICMPv6 checksum calculation

PATCH Superseded Simon Horman 2 participants 2 messages Aug 25, 2010

Subsystems (4)
lore
Share & tools
lore

Simon Horman

author maintainer
#0 lore raw

PATCH v2 1/1 IPVS: ICMPv6 checksum calculation

Cc Xiaoyu Du <[email protected]>
Cc Julian Anastasov <[email protected]>

--

Xiaoyu, is this the change that you tested?
If so could you give me a Tested-by line?

Julian, could I get an ack from you? Alternatively, if you want to take ownership of the patch, can I get a signed-off-by from you? In that case I'll change the From accordingly.

net/netfilter/ipvs/ip_vs_core.c +5 -3
Index: nf-next-2.6/net/netfilter/ipvs/ip_vs_core.c
===================================================================
@@ -637,9 +637,11 @@ void ip_vs_nat_icmp_v6(struct sk_buff *s
 	}
 
 	/* And finally the ICMP checksum */
-	icmph->icmp6_cksum = 0;
-	/* TODO IPv6: is this correct for ICMPv6? */
-	ip_vs_checksum_complete(skb, icmp_offset);
+	icmph->icmp6_cksum = ~csum_ipv6_magic(&iph->saddr, &iph->daddr,
+					      skb->len - icmp_offset,
+					      IPPROTO_ICMPV6, 0);
+	skb->csum_start = skb_network_header(skb) - skb->head + icmp_offset;
+	skb->csum_offset = offsetof(struct icmp6hdr, icmp6_cksum);
 	skb->ip_summed = CHECKSUM_UNNECESSARY;
 
 	if (inout)
maintainer
#1 lore raw

Hello,

Quoted 2 lines · Simon Horman
Cc Xiaoyu Du <[email protected]>
Cc Julian Anastasov <[email protected]>

should be enough

Quoted 22 lines

--

Xiaoyu, is this the change that you tested?
If so could you give me a Tested-by line?

Julian, could I get an ack from you? Alternatively, if you want to take ownership of the patch, can I get a signed-off-by from you? In that case I'll change the From accordingly.

Index: nf-next-2.6/net/netfilter/ipvs/ip_vs_core.c
===================================================================

net/netfilter/ipvs/ip_vs_core.c +0 -1
@@ -637,9 +637,11 @@ void ip_vs_nat_icmp_v6(struct sk_buff *s
 	}
 
 	/* And finally the ICMP checksum */
-	icmph->icmp6_cksum = 0;

net/netfilter/ipvs/ip_vs_core.c void ip_vs_nat_icmp_v6(struct sk_buff *s · line 647

Quoted 10 lines
net/netfilter/ipvs/ip_vs_core.c +5 -2
-	/* TODO IPv6: is this correct for ICMPv6? */
-	ip_vs_checksum_complete(skb, icmp_offset);
+	icmph->icmp6_cksum = ~csum_ipv6_magic(&iph->saddr, &iph->daddr,
+					      skb->len - icmp_offset,
+					      IPPROTO_ICMPV6, 0);
+	skb->csum_start = skb_network_header(skb) - skb->head + icmp_offset;
+	skb->csum_offset = offsetof(struct icmp6hdr, icmp6_cksum);
 	skb->ip_summed = CHECKSUM_UNNECESSARY;
 
 	if (inout)

Regards

--
Julian Anastasov <[email protected]>