diff options
author | David S. Miller <davem@davemloft.net> | 2020-08-05 12:19:52 -0700 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2020-08-05 12:19:52 -0700 |
commit | 273d405b4d5657dd2ad9aa6381e94ef63bb71423 (patch) | |
tree | 6ad38dd8f878d015d35e6785416c4043070a4aec /net/tipc/udp_media.c | |
parent | 5845589ed652da9b65833044bd2d0bcb1d676ed0 (diff) | |
parent | 5a6f6f579178dbeb33002d93b4f646c31348fac9 (diff) |
Merge branch 'net-fix-a-mcast-issue-for-tipc-udp-media'
Xin Long says:
====================
net: fix a mcast issue for tipc udp media
Patch 1 is to add a function to get the dev by source address,
which will be used by Patch 2.
====================
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/tipc/udp_media.c')
-rw-r--r-- | net/tipc/udp_media.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/net/tipc/udp_media.c b/net/tipc/udp_media.c index d91b7c543e39..53f0de0676b7 100644 --- a/net/tipc/udp_media.c +++ b/net/tipc/udp_media.c @@ -738,6 +738,13 @@ static int tipc_udp_enable(struct net *net, struct tipc_bearer *b, b->mtu = b->media->mtu; #if IS_ENABLED(CONFIG_IPV6) } else if (local.proto == htons(ETH_P_IPV6)) { + struct net_device *dev; + + dev = ipv6_dev_find(net, &local.ipv6); + if (!dev) { + err = -ENODEV; + goto err; + } udp_conf.family = AF_INET6; udp_conf.use_udp6_tx_checksums = true; udp_conf.use_udp6_rx_checksums = true; @@ -745,6 +752,7 @@ static int tipc_udp_enable(struct net *net, struct tipc_bearer *b, udp_conf.local_ip6 = in6addr_any; else udp_conf.local_ip6 = local.ipv6; + ub->ifindex = dev->ifindex; b->mtu = 1280; #endif } else { |