summaryrefslogtreecommitdiff
path: root/zebra/kernel_socket.c
diff options
context:
space:
mode:
authorRenato Westphal <renato@opensourcerouting.org>2021-07-21 01:06:42 -0300
committerGitHub <noreply@github.com>2021-07-21 01:06:42 -0300
commit2e69d1e4f340b53cb5bd6bd50f490121aef689d8 (patch)
tree56a5332c1c075519ab5c70b6c4a41fc568833c96 /zebra/kernel_socket.c
parente2d17cd9b0accc91843e340f9dd46185c963681e (diff)
parentecff5258a01beca71b50299a993372bdfd7b559a (diff)
Merge pull request #9098 from donaldsharp/if_secondary_bsd
zebra: Mark some bsd interface prefixes as SECONDARY
Diffstat (limited to 'zebra/kernel_socket.c')
-rw-r--r--zebra/kernel_socket.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/zebra/kernel_socket.c b/zebra/kernel_socket.c
index 252bf04782..5c060ac6f8 100644
--- a/zebra/kernel_socket.c
+++ b/zebra/kernel_socket.c
@@ -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