diff options
author | Robert Shearman <rshearma@vyatta.att-mail.com> | 2018-09-19 13:56:53 +0100 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2018-09-19 21:23:01 -0700 |
commit | 3ede0bbcdfc94ccdbe56bed4e66beb3f4f4f6b00 (patch) | |
tree | e69ccbacf5b23bbe283999f823fbbd344857ac45 /net/ipv6/addrconf.c | |
parent | 1e6a4bc874db9489146edb78aea281f1cfafcee0 (diff) | |
download | linux-stable-3ede0bbcdfc94ccdbe56bed4e66beb3f4f4f6b00.tar.gz linux-stable-3ede0bbcdfc94ccdbe56bed4e66beb3f4f4f6b00.tar.bz2 linux-stable-3ede0bbcdfc94ccdbe56bed4e66beb3f4f4f6b00.zip |
ipv6: Allow the l3mdev to be a loopback
There is no way currently for an IPv6 client connect using a loopback
address in a VRF, whereas for IPv4 the loopback address can be added:
$ sudo ip addr add dev vrfred 127.0.0.1/8
$ sudo ip -6 addr add ::1/128 dev vrfred
RTNETLINK answers: Cannot assign requested address
So allow ::1 to be configured on an L3 master device. In order for
this to be usable ip_route_output_flags needs to not consider ::1 to
be a link scope address (since oif == l3mdev and so it would be
dropped), and ipv6_rcv needs to consider the l3mdev to be a loopback
device so that it doesn't drop the packets.
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/ipv6/addrconf.c')
-rw-r--r-- | net/ipv6/addrconf.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c index d4733160e6b7..bfe3ec7ecb14 100644 --- a/net/ipv6/addrconf.c +++ b/net/ipv6/addrconf.c @@ -997,6 +997,7 @@ ipv6_add_addr(struct inet6_dev *idev, struct ifa6_config *cfg, if (addr_type == IPV6_ADDR_ANY || addr_type & IPV6_ADDR_MULTICAST || (!(idev->dev->flags & IFF_LOOPBACK) && + !netif_is_l3_master(idev->dev) && addr_type & IPV6_ADDR_LOOPBACK)) return ERR_PTR(-EADDRNOTAVAIL); |