diff options
| author | Donald Sharp <sharpd@nvidia.com> | 2023-12-06 08:24:01 -0500 |
|---|---|---|
| committer | Donald Sharp <sharpd@nvidia.com> | 2023-12-06 09:27:52 -0500 |
| commit | 466ad88ce12af8d613600717def6a17dc6283ee8 (patch) | |
| tree | 9fedf8f9faf84875d906cc14d6c87598e29035b8 | |
| parent | 04fe6df770ce83104058a77b1e072e8b16fee919 (diff) | |
zebra: Add ability to note that a address is NOPREFIXROUTE
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>
| -rw-r--r-- | zebra/if_netlink.c | 3 | ||||
| -rw-r--r-- | zebra/zebra_dplane.c | 15 | ||||
| -rw-r--r-- | zebra/zebra_dplane.h | 2 |
3 files changed, 20 insertions, 0 deletions
diff --git a/zebra/if_netlink.c b/zebra/if_netlink.c index 2cedb29960..551ef6533e 100644 --- a/zebra/if_netlink.c +++ b/zebra/if_netlink.c @@ -1423,6 +1423,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]); diff --git a/zebra/zebra_dplane.c b/zebra/zebra_dplane.c index 28319c5bdf..369394e845 100644 --- a/zebra/zebra_dplane.c +++ b/zebra/zebra_dplane.c @@ -230,6 +230,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; @@ -2541,6 +2542,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); @@ -2569,6 +2577,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); diff --git a/zebra/zebra_dplane.h b/zebra/zebra_dplane.h index 87c2e03656..6dc52ead14 100644 --- a/zebra/zebra_dplane.h +++ b/zebra/zebra_dplane.h @@ -658,6 +658,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( |
