]> git.puffer.fish Git - matthieu/frr.git/commitdiff
zebra: Mark some bsd interface prefixes as SECONDARY
authorDonald Sharp <sharpd@nvidia.com>
Tue, 20 Jul 2021 14:12:04 +0000 (10:12 -0400)
committerDonald Sharp <sharpd@nvidia.com>
Tue, 20 Jul 2021 14:12:04 +0000 (10:12 -0400)
Notice when a ip address on a bsd interface is considered
an alias, let's mark the connected prefix we generate as
a SECONDARY.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
zebra/kernel_socket.c

index 252bf04782b294796b3db6b13ffc24dfc8e88aa6..5c060ac6f86015a4445a7049bd03925abdb9069b 100644 (file)
@@ -849,8 +849,8 @@ int ifam_read(struct ifa_msghdr *ifam)
        bool dest_same = false;
        char ifname[INTERFACE_NAMSIZ];
        short ifnlen = 0;
-       char isalias = 0;
-       int flags = 0;
+       bool isalias = false;
+       uint32_t flags = 0;
 
        ifname[0] = ifname[INTERFACE_NAMSIZ - 1] = '\0';
 
@@ -865,7 +865,13 @@ int ifam_read(struct ifa_msghdr *ifam)
        }
 
        if (ifnlen && strncmp(ifp->name, ifname, INTERFACE_NAMSIZ))
-               isalias = 1;
+               isalias = true;
+
+       /*
+        * Mark the alias prefixes as secondary
+        */
+       if (isalias)
+               SET_FLAG(flags, ZEBRA_IFA_SECONDARY);
 
        /* N.B. The info in ifa_msghdr does not tell us whether the RTA_BRD
           field contains a broadcast address or a peer address, so we are