zebra: update dataplane flowspec address family in ipset_info

It is needed for the ipset entry to know for which address family
this ipset entry applies to. Actually, the family is in the original
ipset structure and was not passed as attribute in the dataplane
ipset_info structure. Add it.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
This commit is contained in:
Philippe Guibert 2021-10-28 18:28:42 +02:00
parent 8f065cd36f
commit 85b02353a9
2 changed files with 4 additions and 0 deletions

View File

@ -2166,6 +2166,7 @@ bool dplane_ctx_get_pbr_ipset(const struct zebra_dplane_ctx *ctx,
ctx->zd_op == DPLANE_OP_IPSET_ENTRY_DELETE) {
memset(ipset, 0, sizeof(struct zebra_pbr_ipset));
ipset->type = ctx->u.ipset_entry.info.type;
ipset->family = ctx->u.ipset_entry.info.family;
memcpy(&ipset->ipset_name, &ctx->u.ipset_entry.info.ipset_name,
ZEBRA_IPSET_NAME_SIZE);
} else
@ -2943,6 +2944,7 @@ dplane_ctx_ipset_entry_init(struct zebra_dplane_ctx *ctx, enum dplane_op_e op,
sizeof(struct zebra_pbr_ipset_entry));
ctx->u.ipset_entry.entry.backpointer = NULL;
ctx->u.ipset_entry.info.type = ipset->type;
ctx->u.ipset_entry.info.family = ipset->family;
memcpy(&ctx->u.ipset_entry.info.ipset_name, &ipset->ipset_name,
ZEBRA_IPSET_NAME_SIZE);

View File

@ -70,6 +70,8 @@ struct zebra_pbr_ipset_info {
*/
uint32_t type;
uint8_t family;
char ipset_name[ZEBRA_IPSET_NAME_SIZE];
};