From: Carmine Scarpitta Date: Mon, 20 Mar 2023 20:49:07 +0000 (+0100) Subject: zebra: Resolve default values for SRv6 flavor attr X-Git-Tag: base_9.1~88^2~105 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=c9f0452a1467f8c449692351902321712abf51f1;p=mirror%2Ffrr.git zebra: Resolve default values for SRv6 flavor attr When zebra receives a Netlink message containing a seg6local nexthop, let's use the default values for optional attributes `lcblock_len` and `lcnode_fn_len`, if they are not specified. Signed-off-by: Carmine Scarpitta --- diff --git a/zebra/rt_netlink.c b/zebra/rt_netlink.c index 3ea7252ca1..00f809b80d 100644 --- a/zebra/rt_netlink.c +++ b/zebra/rt_netlink.c @@ -567,6 +567,16 @@ parse_nexthop_unicast(ns_id_t ns_id, struct rtmsg *rtm, struct rtattr **tb, if (num_labels) nexthop_add_labels(&nh, ZEBRA_LSP_STATIC, num_labels, labels); + /* Resolve default values for SRv6 flavors */ + if (seg6l_ctx.flv.flv_ops != ZEBRA_SEG6_LOCAL_FLV_OP_UNSPEC) { + if (seg6l_ctx.flv.lcblock_len == 0) + seg6l_ctx.flv.lcblock_len = + ZEBRA_DEFAULT_SEG6_LOCAL_FLV_LCBLOCK_LEN; + if (seg6l_ctx.flv.lcnode_func_len == 0) + seg6l_ctx.flv.lcnode_func_len = + ZEBRA_DEFAULT_SEG6_LOCAL_FLV_LCNODE_FN_LEN; + } + if (seg6l_act != ZEBRA_SEG6_LOCAL_ACTION_UNSPEC) nexthop_add_srv6_seg6local(&nh, seg6l_act, &seg6l_ctx);