]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
ipv4: do not cache looped multicasts
authorJulian Anastasov <ja@ssi.bg>
Thu, 22 Nov 2012 21:04:14 +0000 (23:04 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 17 Dec 2012 17:27:18 +0000 (09:27 -0800)
commit1322cf6f121852ba706ec7ae7dab636fe4533447
tree1ed28b31a00d18c0c92214771450272b087c10d9
parent0541e18c62297c69592160e33ce0f460ae490f5f
ipv4: do not cache looped multicasts

[ Upstream commit 636174219b52b5a8bc51bc23bbcba97cd30a65e3 ]

Starting from 3.6 we cache output routes for
multicasts only when using route to 224/4. For local receivers
we can set RTCF_LOCAL flag depending on the membership but
in such case we use maddr and saddr which are not caching
keys as before. Additionally, we can not use same place to
cache routes that differ in RTCF_LOCAL flag value.

Fix it by caching only RTCF_MULTICAST entries
without RTCF_LOCAL (send-only, no loopback). As a side effect,
we avoid unneeded lookup for fnhe when not caching because
multicasts are not redirected and they do not learn PMTU.

Thanks to Maxime Bizon for showing the caching
problems in __mkroute_output for 3.6 kernels: different
RTCF_LOCAL flag in cache can lead to wrong ip_mc_output or
ip_output call and the visible problem is that traffic can
not reach local receivers via loopback.

Reported-by: Maxime Bizon <mbizon@freebox.fr>
Tested-by: Maxime Bizon <mbizon@freebox.fr>
Signed-off-by: Julian Anastasov <ja@ssi.bg>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
net/ipv4/route.c