]> git.karo-electronics.de Git - karo-tx-linux.git/commit
netfilter: xt_rpfilter: skip locally generated broadcast/multicast, too
authorFlorian Westphal <fw@strlen.de>
Wed, 17 Apr 2013 22:45:24 +0000 (22:45 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 11 May 2013 20:53:56 +0000 (13:53 -0700)
commit6fc08dc6f89960aaf27149f8031009fdc8062a70
tree603d6cb0b0d19b86fe2b8beac64f01290857b25e
parent79293de3160850689a436a072f51037493db73b8
netfilter: xt_rpfilter: skip locally generated broadcast/multicast, too

commit f83a7ea2075ca896f2dbf07672bac9cf3682ff74 upstream.

Alex Efros reported rpfilter module doesn't match following packets:
IN=br.qemu SRC=192.168.2.1 DST=192.168.2.255 [ .. ]
(netfilter bugzilla #814).

Problem is that network stack arranges for the locally generated broadcasts
to appear on the interface they were sent out, so the IFF_LOOPBACK check
doesn't trigger.

As -m rpfilter is restricted to PREROUTING, we can check for existing
rtable instead, it catches locally-generated broad/multicast case, too.

Signed-off-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
net/ipv4/netfilter/ipt_rpfilter.c
net/ipv6/netfilter/ip6t_rpfilter.c