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
|
|
@ -2018,7 +2018,9 @@ static struct rtable *__mkroute_output(const struct fib_result *res,
|
|||
return ERR_PTR(-EINVAL);
|
||||
|
||||
if (likely(!IN_DEV_ROUTE_LOCALNET(in_dev)))
|
||||
if (ipv4_is_loopback(fl4->saddr) && !(dev_out->flags & IFF_LOOPBACK))
|
||||
if (ipv4_is_loopback(fl4->saddr) &&
|
||||
!(dev_out->flags & IFF_LOOPBACK) &&
|
||||
!netif_is_l3_master(dev_out))
|
||||
return ERR_PTR(-EINVAL);
|
||||
|
||||
if (ipv4_is_lbcast(fl4->daddr))
|
||||
|
|
@ -2302,7 +2304,9 @@ struct rtable *__ip_route_output_key_hash(struct net *net, struct flowi4 *fl4,
|
|||
else
|
||||
fl4->saddr = fl4->daddr;
|
||||
}
|
||||
dev_out = net->loopback_dev;
|
||||
|
||||
/* L3 master device is the loopback for that domain */
|
||||
dev_out = l3mdev_master_dev_rcu(dev_out) ? : net->loopback_dev;
|
||||
fl4->flowi4_oif = dev_out->ifindex;
|
||||
flags |= RTCF_LOCAL;
|
||||
goto make_route;
|
||||
|
|
|
|||
Loading…
Reference in a new issue