lkml.org 
[lkml]   [2016]   [Mar]   [31]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 4.2.y-ckt 189/218] ipv4: fix broadcast packets reception
    Date
    4.2.8-ckt7 -stable review patch.  If anyone has any objections, please let me know.

    ---8<------------------------------------------------------------

    From: Paolo Abeni <pabeni@redhat.com>

    commit ad0ea1989cc4d5905941d0a9e62c63ad6d859cef upstream.

    Currently, ingress ipv4 broadcast datagrams are dropped since,
    in udp_v4_early_demux(), ip_check_mc_rcu() is invoked even on
    bcast packets.

    This patch addresses the issue, invoking ip_check_mc_rcu()
    only for mcast packets.

    Fixes: 6e5403093261 ("ipv4/udp: Verify multicast group is ours in upd_v4_early_demux()")
    Signed-off-by: Paolo Abeni <pabeni@redhat.com>
    Acked-by: Hannes Frederic Sowa <hannes@stressinduktion.org>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Signed-off-by: Kamal Mostafa <kamal@canonical.com>
    ---
    net/ipv4/udp.c | 12 ++++++++----
    1 file changed, 8 insertions(+), 4 deletions(-)

    diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c
    index a390174..031752e 100644
    --- a/net/ipv4/udp.c
    +++ b/net/ipv4/udp.c
    @@ -1979,10 +1979,14 @@ void udp_v4_early_demux(struct sk_buff *skb)
    if (!in_dev)
    return;

    - ours = ip_check_mc_rcu(in_dev, iph->daddr, iph->saddr,
    - iph->protocol);
    - if (!ours)
    - return;
    + /* we are supposed to accept bcast packets */
    + if (skb->pkt_type == PACKET_MULTICAST) {
    + ours = ip_check_mc_rcu(in_dev, iph->daddr, iph->saddr,
    + iph->protocol);
    + if (!ours)
    + return;
    + }
    +
    sk = __udp4_lib_mcast_demux_lookup(net, uh->dest, iph->daddr,
    uh->source, iph->saddr, dif);
    } else if (skb->pkt_type == PACKET_HOST) {
    --
    2.7.4
    \
     
     \ /
      Last update: 2016-03-31 22:41    [W:4.036 / U:0.024 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site