• Martin Willi's avatar
    macvlan: Fix leaking skb in source mode with nodst option · e16b8598
    Martin Willi authored
    The MACVLAN receive handler clones skbs to all matching source MACVLAN
    interfaces, before it passes the packet along to match on destination
    based MACVLANs.
    
    When using the MACVLAN nodst mode, passing the packet to destination based
    MACVLANs is omitted and the handler returns with RX_HANDLER_CONSUMED.
    However, the passed skb is not freed, leaking for any packet processed
    with the nodst option.
    
    Properly free the skb when consuming packets to fix that leak.
    
    Fixes: 427f0c8c ("macvlan: Add nodst option to macvlan type source")
    Signed-off-by: default avatarMartin Willi <martin@strongswan.org>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    e16b8598
macvlan.c 46.7 KB