mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-18 02:03:32 +00:00
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>
This commit is contained in:
parent
04fe6df770
commit
466ad88ce1
@ -1423,6 +1423,9 @@ int netlink_interface_addr_dplane(struct nlmsghdr *h, ns_id_t ns_id,
|
|||||||
if (kernel_flags & IFA_F_SECONDARY)
|
if (kernel_flags & IFA_F_SECONDARY)
|
||||||
dplane_ctx_intf_set_secondary(ctx);
|
dplane_ctx_intf_set_secondary(ctx);
|
||||||
|
|
||||||
|
if (kernel_flags & IFA_F_NOPREFIXROUTE)
|
||||||
|
dplane_ctx_intf_set_noprefixroute(ctx);
|
||||||
|
|
||||||
/* Label */
|
/* Label */
|
||||||
if (tb[IFA_LABEL]) {
|
if (tb[IFA_LABEL]) {
|
||||||
label = (char *)RTA_DATA(tb[IFA_LABEL]);
|
label = (char *)RTA_DATA(tb[IFA_LABEL]);
|
||||||
|
@ -230,6 +230,7 @@ struct dplane_intf_info {
|
|||||||
#define DPLANE_INTF_BROADCAST (1 << 2)
|
#define DPLANE_INTF_BROADCAST (1 << 2)
|
||||||
#define DPLANE_INTF_HAS_DEST DPLANE_INTF_CONNECTED
|
#define DPLANE_INTF_HAS_DEST DPLANE_INTF_CONNECTED
|
||||||
#define DPLANE_INTF_HAS_LABEL (1 << 4)
|
#define DPLANE_INTF_HAS_LABEL (1 << 4)
|
||||||
|
#define DPLANE_INTF_NOPREFIXROUTE (1 << 5)
|
||||||
|
|
||||||
/* Interface address/prefix */
|
/* Interface address/prefix */
|
||||||
struct prefix 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);
|
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)
|
bool dplane_ctx_intf_is_secondary(const struct zebra_dplane_ctx *ctx)
|
||||||
{
|
{
|
||||||
DPLANE_CTX_VALID(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;
|
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)
|
void dplane_ctx_intf_set_broadcast(struct zebra_dplane_ctx *ctx)
|
||||||
{
|
{
|
||||||
DPLANE_CTX_VALID(ctx);
|
DPLANE_CTX_VALID(ctx);
|
||||||
|
@ -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);
|
void dplane_ctx_intf_set_connected(struct zebra_dplane_ctx *ctx);
|
||||||
bool dplane_ctx_intf_is_secondary(const 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);
|
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);
|
bool dplane_ctx_intf_is_broadcast(const struct zebra_dplane_ctx *ctx);
|
||||||
void dplane_ctx_intf_set_broadcast(struct zebra_dplane_ctx *ctx);
|
void dplane_ctx_intf_set_broadcast(struct zebra_dplane_ctx *ctx);
|
||||||
const struct prefix *dplane_ctx_get_intf_addr(
|
const struct prefix *dplane_ctx_get_intf_addr(
|
||||||
|
Loading…
Reference in New Issue
Block a user