Commit c2d4fbd2 authored by Linus Lüssing's avatar Linus Lüssing Committed by David S. Miller

bridge: fix igmpv3 / mldv2 report parsing

With the newly introduced helper functions the skb pulling is hidden in
the checksumming function - and undone before returning to the caller.

The IGMPv3 and MLDv2 report parsing functions in the bridge still
assumed that the skb is pointing to the beginning of the IGMP/MLD
message while it is now kept at the beginning of the IPv4/6 header,
breaking the message parsing and creating packet loss.

Fixing this by taking the offset between IP and IGMP/MLD header into
account, too.

Fixes: 9afd85c9 ("net: Export IGMP/MLD message validation code")
Reported-by: default avatarTobias Powalowski <tobias.powalowski@googlemail.com>
Tested-by: default avatarTobias Powalowski <tobias.powalowski@googlemail.com>
Signed-off-by: default avatarLinus Lüssing <linus.luessing@c0d3.blue>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent a19a19de
...@@ -1006,7 +1006,7 @@ static int br_ip4_multicast_igmp3_report(struct net_bridge *br, ...@@ -1006,7 +1006,7 @@ static int br_ip4_multicast_igmp3_report(struct net_bridge *br,
ih = igmpv3_report_hdr(skb); ih = igmpv3_report_hdr(skb);
num = ntohs(ih->ngrec); num = ntohs(ih->ngrec);
len = sizeof(*ih); len = skb_transport_offset(skb) + sizeof(*ih);
for (i = 0; i < num; i++) { for (i = 0; i < num; i++) {
len += sizeof(*grec); len += sizeof(*grec);
...@@ -1067,7 +1067,7 @@ static int br_ip6_multicast_mld2_report(struct net_bridge *br, ...@@ -1067,7 +1067,7 @@ static int br_ip6_multicast_mld2_report(struct net_bridge *br,
icmp6h = icmp6_hdr(skb); icmp6h = icmp6_hdr(skb);
num = ntohs(icmp6h->icmp6_dataun.un_data16[1]); num = ntohs(icmp6h->icmp6_dataun.un_data16[1]);
len = sizeof(*icmp6h); len = skb_transport_offset(skb) + sizeof(*icmp6h);
for (i = 0; i < num; i++) { for (i = 0; i < num; i++) {
__be16 *nsrcs, _nsrcs; __be16 *nsrcs, _nsrcs;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment