From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?UTF-8?q?Linus=20L=C3=BCssing?= Subject: [PATCH net] bridge: fix igmpv3 / mldv2 report parsing Date: Fri, 11 Sep 2015 18:39:48 +0200 Message-ID: <1441989588-26312-1-git-send-email-linus.luessing@c0d3.blue> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cc: bridge@lists.linux-foundation.org, Tobias Powalowski , linux-kernel@vger.kernel.org, "David S. Miller" To: netdev@vger.kernel.org Return-path: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: bridge-bounces@lists.linux-foundation.org Errors-To: bridge-bounces@lists.linux-foundation.org List-Id: netdev.vger.kernel.org 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: 9afd85c9e455 ("net: Export IGMP/MLD message validation code") Reported-by: Tobias Powalowski Tested-by: Tobias Powalowski Signed-off-by: Linus L=C3=BCssing --- net/bridge/br_multicast.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/net/bridge/br_multicast.c b/net/bridge/br_multicast.c index 66efdc2..480b3de 100644 --- a/net/bridge/br_multicast.c +++ b/net/bridge/br_multicast.c @@ -1006,7 +1006,7 @@ static int br_ip4_multicast_igmp3_report(struct net= _bridge *br, =20 ih =3D igmpv3_report_hdr(skb); num =3D ntohs(ih->ngrec); - len =3D sizeof(*ih); + len =3D skb_transport_offset(skb) + sizeof(*ih); =20 for (i =3D 0; i < num; i++) { len +=3D sizeof(*grec); @@ -1067,7 +1067,7 @@ static int br_ip6_multicast_mld2_report(struct net_= bridge *br, =20 icmp6h =3D icmp6_hdr(skb); num =3D ntohs(icmp6h->icmp6_dataun.un_data16[1]); - len =3D sizeof(*icmp6h); + len =3D skb_transport_offset(skb) + sizeof(*icmp6h); =20 for (i =3D 0; i < num; i++) { __be16 *nsrcs, _nsrcs; --=20 1.7.10.4