]> git.puffer.fish Git - matthieu/frr.git/commitdiff
zebra: Add ability to note that a address is NOPREFIXROUTE
authorDonald Sharp <sharpd@nvidia.com>
Wed, 6 Dec 2023 13:24:01 +0000 (08:24 -0500)
committerMergify <37929162+mergify[bot]@users.noreply.github.com>
Thu, 7 Dec 2023 13:25:49 +0000 (13:25 +0000)
The linux kernel can send up a flag that tells us that the
connected address is not a PREFIXROUTE.  Add the ability
to note this and pass it up from the data plane.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
(cherry picked from commit 466ad88ce12af8d613600717def6a17dc6283ee8)

zebra/if_netlink.c
zebra/zebra_dplane.c
zebra/zebra_dplane.h

index fcb692b715fe589c74324c8cb528af8d2f92f6aa..22a78cb0f336fe531dc7ebda437d7890643bc6e5 100644 (file)
@@ -1930,6 +1930,9 @@ int netlink_interface_addr_dplane(struct nlmsghdr *h, ns_id_t ns_id,
        if (kernel_flags & IFA_F_SECONDARY)
                dplane_ctx_intf_set_secondary(ctx);
 
+       if (kernel_flags & IFA_F_NOPREFIXROUTE)
+               dplane_ctx_intf_set_noprefixroute(ctx);
+
        /* Label */
        if (tb[IFA_LABEL]) {
                label = (char *)RTA_DATA(tb[IFA_LABEL]);
index 31ce4d8265a7043365dbad63c914f05b95cc0861..34ff53dcfd09bbedcd795fef080191a901faef28 100644 (file)
@@ -191,6 +191,7 @@ struct dplane_intf_info {
 #define DPLANE_INTF_BROADCAST   (1 << 2)
 #define DPLANE_INTF_HAS_DEST    DPLANE_INTF_CONNECTED
 #define DPLANE_INTF_HAS_LABEL   (1 << 4)
+#define DPLANE_INTF_NOPREFIXROUTE (1 << 5)
 
        /* Interface address/prefix */
        struct prefix prefix;
@@ -2068,6 +2069,13 @@ bool dplane_ctx_intf_is_connected(const struct zebra_dplane_ctx *ctx)
        return (ctx->u.intf.flags & DPLANE_INTF_CONNECTED);
 }
 
+bool dplane_ctx_intf_is_noprefixroute(const struct zebra_dplane_ctx *ctx)
+{
+       DPLANE_CTX_VALID(ctx);
+
+       return (ctx->u.intf.flags & DPLANE_INTF_NOPREFIXROUTE);
+}
+
 bool dplane_ctx_intf_is_secondary(const struct zebra_dplane_ctx *ctx)
 {
        DPLANE_CTX_VALID(ctx);
@@ -2096,6 +2104,13 @@ void dplane_ctx_intf_set_secondary(struct zebra_dplane_ctx *ctx)
        ctx->u.intf.flags |= DPLANE_INTF_SECONDARY;
 }
 
+void dplane_ctx_intf_set_noprefixroute(struct zebra_dplane_ctx *ctx)
+{
+       DPLANE_CTX_VALID(ctx);
+
+       ctx->u.intf.flags |= DPLANE_INTF_NOPREFIXROUTE;
+}
+
 void dplane_ctx_intf_set_broadcast(struct zebra_dplane_ctx *ctx)
 {
        DPLANE_CTX_VALID(ctx);
index 6716c0ffb6c9720d902ec2280748d7241decf90f..c61fae51434b3c5930560f86f11c4b5eb2fa74f0 100644 (file)
@@ -533,6 +533,8 @@ bool dplane_ctx_intf_is_connected(const struct zebra_dplane_ctx *ctx);
 void dplane_ctx_intf_set_connected(struct zebra_dplane_ctx *ctx);
 bool dplane_ctx_intf_is_secondary(const struct zebra_dplane_ctx *ctx);
 void dplane_ctx_intf_set_secondary(struct zebra_dplane_ctx *ctx);
+bool dplane_ctx_intf_is_noprefixroute(const struct zebra_dplane_ctx *ctx);
+void dplane_ctx_intf_set_noprefixroute(struct zebra_dplane_ctx *ctx);
 bool dplane_ctx_intf_is_broadcast(const struct zebra_dplane_ctx *ctx);
 void dplane_ctx_intf_set_broadcast(struct zebra_dplane_ctx *ctx);
 const struct prefix *dplane_ctx_get_intf_addr(