mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 03:01:39 -04:00
net: l3mdev: Allow the l3mdev to be a loopback
Allow an L3 master device to act as the loopback for that L3 domain. For IPv4 the device can also have the address 127.0.0.1. Signed-off-by: David Ahern <[email protected]> Signed-off-by: David S. Miller <[email protected]>
This commit is contained in:
parent
a8e3e1a9f0
commit
5f02ce24c2
3 changed files with 19 additions and 7 deletions
|
|
@ -2558,8 +2558,16 @@ struct rt6_info *addrconf_dst_alloc(struct inet6_dev *idev,
|
|||
{
|
||||
u32 tb_id;
|
||||
struct net *net = dev_net(idev->dev);
|
||||
struct rt6_info *rt = ip6_dst_alloc(net, net->loopback_dev,
|
||||
DST_NOCOUNT);
|
||||
struct net_device *dev = net->loopback_dev;
|
||||
struct rt6_info *rt;
|
||||
|
||||
/* use L3 Master device as loopback for host routes if device
|
||||
* is enslaved and address is not link local or multicast
|
||||
*/
|
||||
if (!rt6_need_strict(addr))
|
||||
dev = l3mdev_master_dev_rcu(idev->dev) ? : dev;
|
||||
|
||||
rt = ip6_dst_alloc(net, dev, DST_NOCOUNT);
|
||||
if (!rt)
|
||||
return ERR_PTR(-ENOMEM);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue