udp: fix bcast packet reception
authorPaolo Abeni <pabeni@redhat.com>
Mon, 9 Oct 2017 12:52:10 +0000 (14:52 +0200)
committerDavid S. Miller <davem@davemloft.net>
Mon, 9 Oct 2017 17:28:25 +0000 (10:28 -0700)
commit996b44fcef8f216ea0b6b6e74468c5a77b5e341f
treee21b0278971b7764f40b74768cb51150c0d3b8c7
parent41c87425a1ac9b633e0fcc78eb1f19640c8fb5a0
udp: fix bcast packet reception

The commit bc044e8db796 ("udp: perform source validation for
mcast early demux") does not take into account that broadcast packets
lands in the same code path and they need different checks for the
source address - notably, zero source address are valid for bcast
and invalid for mcast.

As a result, 2nd and later broadcast packets with 0 source address
landing to the same socket are dropped. This breaks dhcp servers.

Since we don't have stringent performance requirements for ingress
broadcast traffic, fix it by disabling UDP early demux such traffic.

Reported-by: Hannes Frederic Sowa <hannes@stressinduktion.org>
Fixes: bc044e8db796 ("udp: perform source validation for mcast early demux")
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv4/udp.c