]> git.baikalelectronics.ru Git - kernel.git/commit
ipv4: Fix ip_queue_xmit to pass sk into ip_local_out_sk
authorEric W. Biederman <ebiederm@xmission.com>
Wed, 7 Oct 2015 21:48:33 +0000 (16:48 -0500)
committerDavid S. Miller <davem@davemloft.net>
Thu, 8 Oct 2015 11:26:52 +0000 (04:26 -0700)
commit1c3b8af857547e75ae484b413bbfab8fe3e5b753
tree623983d4d59ea7de05c200006e112e2640d4fb2c
parent4a255b05c495df15238331c891a2a4a97a7ba6b3
ipv4: Fix ip_queue_xmit to pass sk into ip_local_out_sk

After a packet has been encapsulated by a tunnel we should use the
tunnel sockets local multicast loopback flag to control if the
encapsulated packet should be locally loopback back.

Pass sk into ip_local_out_sk so that in the rare case we are dealing
with a tunneled packet whose tunnel destination address is a multicast
address the kernel properly decides to loopback this packet.

In practice I don't think this matters as ip_queue_xmit is used by
tcp, l2tp and sctp none of which I am aware of uses ip level
multicasting as they are all point to point communications protocols.
Let's fix this before someone uses ip_queue_xmit for a tunnel protocol
that does use multicast.

Fixes: be79d4f0d2cc ("ipv4: add a sock pointer to dst->output() path.")
Fixes: 0efbd23ade8b ("ipv4: add a sock pointer to ip_queue_xmit()")
Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv4/ip_output.c