]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
gre/sit: Don't generate link-local addr if addr_gen_mode is IN6_ADDR_GEN_MODE_NONE
authorStephen Suryaputra <ssuryaextr@gmail.com>
Wed, 20 Oct 2021 20:06:18 +0000 (16:06 -0400)
committerJakub Kicinski <kuba@kernel.org>
Fri, 22 Oct 2021 21:10:36 +0000 (14:10 -0700)
When addr_gen_mode is set to IN6_ADDR_GEN_MODE_NONE, the link-local addr
should not be generated. But it isn't the case for GRE (as well as GRE6)
and SIT tunnels. Make it so that tunnels consider the addr_gen_mode,
especially for IN6_ADDR_GEN_MODE_NONE.

Do this in add_v4_addrs() to cover both GRE and SIT only if the addr
scope is link.

Signed-off-by: Stephen Suryaputra <ssuryaextr@gmail.com>
Acked-by: Antonio Quartulli <a@unstable.cc>
Link: https://lore.kernel.org/r/20211020200618.467342-1-ssuryaextr@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
net/ipv6/addrconf.c

index d4fae16deec457a56911504874d65e33666d4e8b..9e1463a2acaedf9f00797a6ac42059782437524d 100644 (file)
@@ -3110,6 +3110,9 @@ static void add_v4_addrs(struct inet6_dev *idev)
        memcpy(&addr.s6_addr32[3], idev->dev->dev_addr + offset, 4);
 
        if (idev->dev->flags&IFF_POINTOPOINT) {
+               if (idev->cnf.addr_gen_mode == IN6_ADDR_GEN_MODE_NONE)
+                       return;
+
                addr.s6_addr32[0] = htonl(0xfe800000);
                scope = IFA_LINK;
                plen = 64;