diff options
author | Robert Shearman <rshearma@vyatta.att-mail.com> | 2018-10-01 10:40:23 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2018-10-03 07:28:17 +0200 |
commit | 854da991733d1b4f60042423875e32be7f8f0421 (patch) | |
tree | cb646dc4e274a9b6472f6b1d66f5d2e299a21574 /net/ipv4/raw.c | |
parent | bridge: mcast: Default back to multicast enabled state (diff) | |
download | linux-854da991733d1b4f60042423875e32be7f8f0421.tar.xz linux-854da991733d1b4f60042423875e32be7f8f0421.zip |
ipv4: Allow sending multicast packets on specific i/f using VRF socket
It is useful to be able to use the same socket for listening in a
specific VRF, as for sending multicast packets out of a specific
interface. However, the bound device on the socket currently takes
precedence and results in the packets not being sent.
Relax the condition on overriding the output interface to use for
sending packets out of UDP, raw and ping sockets to allow multicast
packets to be sent using the specified multicast interface.
Signed-off-by: Robert Shearman <rshearma@vyatta.att-mail.com>
Signed-off-by: Mike Manning <mmanning@vyatta.att-mail.com>
Reviewed-by: David Ahern <dsahern@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/raw.c')
-rw-r--r-- | net/ipv4/raw.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/net/ipv4/raw.c b/net/ipv4/raw.c index 33df4d76db2d..8ca3eb06ba04 100644 --- a/net/ipv4/raw.c +++ b/net/ipv4/raw.c @@ -608,7 +608,7 @@ static int raw_sendmsg(struct sock *sk, struct msghdr *msg, size_t len) tos |= RTO_ONLINK; if (ipv4_is_multicast(daddr)) { - if (!ipc.oif) + if (!ipc.oif || netif_index_is_l3_master(sock_net(sk), ipc.oif)) ipc.oif = inet->mc_index; if (!saddr) saddr = inet->mc_addr; |