bridge: Pseudo-header required for the checksum of ICMP6 header of MLD
Subsystems (3)
PATCH 1/1 bridge: Pseudo-header required for the checksum of ICMP6 header of MLD
Just saw Eric's patch for icmp6_type. Suspect this patch may have issue for reference of ip6h after pskb_trim_rcsum()?
Checksum of ICMPv6 is not properly computed because the pseudo header is not used. Thus, the MLD packet gets dropped by the bridge. This patch fixes the problem for my testbed. This bug was made visible by commit ff9a57a62afbbe2d0f3a09af321f1fd7645f38a.
This patch has been tested on 3.0.3. Due to lack of understanding on the checksum optimization and multicast snooping of the kernel stack, can someone please verify the correctness of this patch?
---
index 2d85ca7..bbf361b 100644
net/bridge/br_multicast.c +5 -2
@@ -1528,9 +1528,12 @@ static int br_multicast_ipv6_rcv(struct net_bridge *br,break ;/*FALLTHROUGH*/ case CHECKSUM_NONE : - skb2->csum =0 ; -if (skb_checksum_complete (skb2)) +if (!skb_csum_unnecessary (skb2) &&csum_ipv6_magic (&ip6h->saddr, + &ip6h->daddr, skb2->len,IPPROTO_ICMPV6 , +skb_checksum (skb2,0 , skb2->len,0 ))) { + err = -EINVAL ; goto out; + } } err =0 ;
---
Quoted 3 lines · Ang Way Chuang
Just saw Eric's patch for
icmp6_type. Suspect this patch may have issue for reference of ip6h afterpskb_trim_rcsum()?
I dont think so, because ip6h is against skb header, not skb2 one.
Quoted 19 lines
Checksum of ICMPv6 is not properly computed because the pseudo header is not used. Thus, the MLD packet gets dropped by the bridge. This patch fixes the problem for my testbed. This bug was made visible by commit
ff9a57a62afbbe2d0f3a09af321f1fd7645f38a.This patch has been tested on 3.0.3. Due to lack of understanding on the checksum optimization and multicast snooping of the kernel stack, can someone please verify the correctness of this patch?
Signed-off-by Ang Way Chuang <[email protected]>---
index 2d85ca7..bbf361b 100644net/bridge/br_multicast.c +0
-2@@ -1528,9 +1528,12 @@ static int br_multicast_ipv6_rcv(struct net_bridge *br,break ;/*FALLTHROUGH*/ case CHECKSUM_NONE : - skb2->csum =0 ; -if (skb_checksum_complete (skb2))
net/bridge/br_multicast.c static int br_multicast_ipv6_rcv(struct net_bridge *br,
Quoted 10 lines
net/bridge/br_multicast.c +5
-1+if (!skb_csum_unnecessary (skb2) &&csum_ipv6_magic (&ip6h->saddr, + &ip6h->daddr, skb2->len,IPPROTO_ICMPV6 , +skb_checksum (skb2,0 , skb2->len,0 ))) { + err = -EINVAL ; goto out; + } } err =0 ; ---
Sorry, I cannot comment on this, checksum games are hard :(