]> www.infradead.org Git - users/jedix/linux-maple.git/commit
net: fix rtnetlink IFF_PROMISC and IFF_ALLMULTI handling
authorJiri Benc <jbenc@redhat.com>
Fri, 27 Jul 2012 02:58:22 +0000 (02:58 +0000)
committerJerry Snitselaar <jerry.snitselaar@oracle.com>
Sun, 7 Oct 2012 06:29:20 +0000 (23:29 -0700)
commita93bd8b6be1187a9f2f6190601c44cd11a0152aa
tree434e6c46fbfe3c6765febf11863d06b1e9368879
parent996412ab4dbcf5563aacac1d5d37ee73bf225baf
net: fix rtnetlink IFF_PROMISC and IFF_ALLMULTI handling

[ Upstream commit b1beb681cba5358f62e6187340660ade226a5fcc ]

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: Max Matveev <makc@redhat.com>
Signed-off-by: Jiri Benc <jbenc@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit c94eb3f964dd7c08486d7c1227c7b5b69d09aabe)

Signed-off-by: Jerry Snitselaar <jerry.snitselaar@oracle.com>
net/core/rtnetlink.c