ipv4: igmp: fix v3 general query drop monitor false positive
authorDaniel Borkmann <dborkman@redhat.com>
Sun, 5 Oct 2014 15:27:50 +0000 (17:27 +0200)
committerDavid S. Miller <davem@davemloft.net>
Mon, 6 Oct 2014 21:14:54 +0000 (17:14 -0400)
In case we find a general query with non-zero number of sources, we
are dropping the skb as it's malformed.

RFC3376, section 4.1.8. Number of Sources (N):

  This number is zero in a General Query or a Group-Specific Query,
  and non-zero in a Group-and-Source-Specific Query.

Therefore, reflect that by using kfree_skb() instead of consume_skb().

Fixes: d679c5324d9a ("igmp: avoid drop_monitor false positives")
Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
Acked-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv4/igmp.c

index 4146153d875d3ea9a35fa1b53ac01f76bf420e45..fb70e3ecc3e4d58da5db9756db9b6da027369288 100644 (file)
@@ -931,7 +931,7 @@ static bool igmp_heard_query(struct in_device *in_dev, struct sk_buff *skb,
                        in_dev->mr_qrv = ih3->qrv;
                if (!group) { /* general query */
                        if (ih3->nsrcs)
-                               return false;   /* no sources allowed */
+                               return true;    /* no sources allowed */
                        igmp_gq_start_timer(in_dev);
                        return false;
                }