diff options
Diffstat (limited to 'zebra/zebra_srv6_vty.c')
| -rw-r--r-- | zebra/zebra_srv6_vty.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/zebra/zebra_srv6_vty.c b/zebra/zebra_srv6_vty.c index 62ce17326c..daac4cade0 100644 --- a/zebra/zebra_srv6_vty.c +++ b/zebra/zebra_srv6_vty.c @@ -271,7 +271,7 @@ DEFUN (no_srv6_locator, DEFPY (locator_prefix, locator_prefix_cmd, - "prefix X:X::X:X/M$prefix [func-bits (16-64)$func_bit_len]", + "prefix X:X::X:X/M$prefix [func-bits (0-64)$func_bit_len]", "Configure SRv6 locator prefix\n" "Specify SRv6 locator prefix\n" "Configure SRv6 locator function length in bits\n" @@ -281,7 +281,14 @@ DEFPY (locator_prefix, struct srv6_locator_chunk *chunk = NULL; struct listnode *node = NULL; + if (prefix->prefixlen != 64) { + vty_out(vty, + "%% Invalid argument: Unsupported locator format\n"); + return CMD_WARNING_CONFIG_FAILED; + } + locator->prefix = *prefix; + func_bit_len = func_bit_len ?: ZEBRA_SRV6_FUNCTION_LENGTH; /* * TODO(slankdev): please support variable node-bit-length. @@ -298,8 +305,8 @@ DEFPY (locator_prefix, * user should use a pattern of zeros as a filler. * (3) The Node Id portion (LSBs) cannot exceed 24 bits. */ - locator->block_bits_length = prefix->prefixlen - 24; - locator->node_bits_length = 24; + locator->block_bits_length = ZEBRA_SRV6_LOCATOR_BLOCK_LENGTH; + locator->node_bits_length = ZEBRA_SRV6_LOCATOR_NODE_LENGTH; locator->function_bits_length = func_bit_len; locator->argument_bits_length = 0; |
