• Tim Beale's avatar
    udp: only choose unbound UDP socket for multicast when not in a VRF · 82ba25c6
    Tim Beale authored
    By default, packets received in another VRF should not be passed to an
    unbound socket in the default VRF. This patch updates the IPv4 UDP
    multicast logic to match the unicast VRF logic (in compute_score()),
    as well as the IPv6 mcast logic (in __udp_v6_is_mcast_sock()).
    
    The particular case I noticed was DHCP discover packets going
    to the 255.255.255.255 address, which are handled by
    __udp4_lib_mcast_deliver(). The previous code meant that running
    multiple different DHCP server or relay agent instances across VRFs
    did not work correctly - any server/relay agent in the default VRF
    received DHCP discover packets for all other VRFs.
    
    Fixes: 6da5b0f0 ("net: ensure unbound datagram socket to be chosen when not in a VRF")
    Signed-off-by: default avatarTim Beale <timbeale@catalyst.net.nz>
    Reviewed-by: default avatarDavid Ahern <dsahern@gmail.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    82ba25c6
udp.c 77.4 KB