• Jiri Benc's avatar
    net: fix rtnetlink IFF_PROMISC and IFF_ALLMULTI handling · b1beb681
    Jiri Benc authored
    When device flags are set using rtnetlink, IFF_PROMISC and IFF_ALLMULTI
    flags are handled specially. Function dev_change_flags sets IFF_PROMISC and
    IFF_ALLMULTI bits in dev->gflags according to the passed value but
    do_setlink passes a result of rtnl_dev_combine_flags which takes those bits
    from dev->flags.
    
    This can be easily trigerred by doing:
    
    tcpdump -i eth0 &
    ip l s up eth0
    
    ip sets IFF_UP flag in ifi_flags and ifi_change, which is combined with
    IFF_PROMISC by rtnl_dev_combine_flags, causing __dev_change_flags to set
    IFF_PROMISC in gflags.
    Reported-by: default avatarMax Matveev <makc@redhat.com>
    Signed-off-by: default avatarJiri Benc <jbenc@redhat.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    b1beb681
rtnetlink.c 58 KB