mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-04-30 13:14:46 +00:00
staticd: handle distance
value
Signed-off-by: Christian Hopps <chopps@labn.net>
This commit is contained in:
parent
f637ac0170
commit
1462450eaa
@ -285,8 +285,7 @@ static int static_route_nb_run(struct vty *vty, struct static_route_args *args)
|
|||||||
nb_cli_enqueue_change(vty, ab_xpath,
|
nb_cli_enqueue_change(vty, ab_xpath,
|
||||||
NB_OP_MODIFY, "false");
|
NB_OP_MODIFY, "false");
|
||||||
}
|
}
|
||||||
if (type == STATIC_IPV4_GATEWAY
|
if (type == STATIC_IPV4_GATEWAY || type == STATIC_IPV6_GATEWAY
|
||||||
|| type == STATIC_IPV6_GATEWAY
|
|
||||||
|| type == STATIC_IPV4_GATEWAY_IFNAME
|
|| type == STATIC_IPV4_GATEWAY_IFNAME
|
||||||
|| type == STATIC_IPV6_GATEWAY_IFNAME) {
|
|| type == STATIC_IPV6_GATEWAY_IFNAME) {
|
||||||
strlcpy(ab_xpath, xpath_nexthop, sizeof(ab_xpath));
|
strlcpy(ab_xpath, xpath_nexthop, sizeof(ab_xpath));
|
||||||
@ -368,8 +367,21 @@ static int static_route_nb_run(struct vty *vty, struct static_route_args *args)
|
|||||||
|
|
||||||
ret = nb_cli_apply_changes(vty, "%s", xpath_prefix);
|
ret = nb_cli_apply_changes(vty, "%s", xpath_prefix);
|
||||||
} else {
|
} else {
|
||||||
if (args->source)
|
if (args->source) {
|
||||||
snprintf(ab_xpath, sizeof(ab_xpath),
|
if (args->distance)
|
||||||
|
snprintf(
|
||||||
|
ab_xpath, sizeof(ab_xpath),
|
||||||
|
FRR_DEL_S_ROUTE_SRC_NH_KEY_XPATH,
|
||||||
|
"frr-staticd:staticd", "staticd", args->vrf,
|
||||||
|
buf_prefix,
|
||||||
|
yang_afi_safi_value2identity(args->afi,
|
||||||
|
args->safi),
|
||||||
|
buf_src_prefix, table_id, distance,
|
||||||
|
buf_nh_type, args->nexthop_vrf, buf_gate_str,
|
||||||
|
args->interface_name);
|
||||||
|
else
|
||||||
|
snprintf(
|
||||||
|
ab_xpath, sizeof(ab_xpath),
|
||||||
FRR_DEL_S_ROUTE_SRC_NH_KEY_NO_DISTANCE_XPATH,
|
FRR_DEL_S_ROUTE_SRC_NH_KEY_NO_DISTANCE_XPATH,
|
||||||
"frr-staticd:staticd", "staticd", args->vrf,
|
"frr-staticd:staticd", "staticd", args->vrf,
|
||||||
buf_prefix,
|
buf_prefix,
|
||||||
@ -378,15 +390,29 @@ static int static_route_nb_run(struct vty *vty, struct static_route_args *args)
|
|||||||
buf_src_prefix, table_id, buf_nh_type,
|
buf_src_prefix, table_id, buf_nh_type,
|
||||||
args->nexthop_vrf, buf_gate_str,
|
args->nexthop_vrf, buf_gate_str,
|
||||||
args->interface_name);
|
args->interface_name);
|
||||||
|
} else {
|
||||||
|
if (args->distance)
|
||||||
|
snprintf(
|
||||||
|
ab_xpath, sizeof(ab_xpath),
|
||||||
|
FRR_DEL_S_ROUTE_NH_KEY_XPATH,
|
||||||
|
"frr-staticd:staticd", "staticd",
|
||||||
|
args->vrf, buf_prefix,
|
||||||
|
yang_afi_safi_value2identity(args->afi,
|
||||||
|
args->safi),
|
||||||
|
table_id, distance, buf_nh_type,
|
||||||
|
args->nexthop_vrf, buf_gate_str,
|
||||||
|
args->interface_name);
|
||||||
else
|
else
|
||||||
snprintf(ab_xpath, sizeof(ab_xpath),
|
snprintf(
|
||||||
|
ab_xpath, sizeof(ab_xpath),
|
||||||
FRR_DEL_S_ROUTE_NH_KEY_NO_DISTANCE_XPATH,
|
FRR_DEL_S_ROUTE_NH_KEY_NO_DISTANCE_XPATH,
|
||||||
"frr-staticd:staticd", "staticd", args->vrf,
|
"frr-staticd:staticd", "staticd",
|
||||||
buf_prefix,
|
args->vrf, buf_prefix,
|
||||||
yang_afi_safi_value2identity(args->afi,
|
yang_afi_safi_value2identity(args->afi,
|
||||||
args->safi),
|
args->safi),
|
||||||
table_id, buf_nh_type, args->nexthop_vrf,
|
table_id, buf_nh_type, args->nexthop_vrf,
|
||||||
buf_gate_str, args->interface_name);
|
buf_gate_str, args->interface_name);
|
||||||
|
}
|
||||||
|
|
||||||
dnode = yang_dnode_get(vty->candidate_config->dnode, ab_xpath);
|
dnode = yang_dnode_get(vty->candidate_config->dnode, ab_xpath);
|
||||||
if (!dnode) {
|
if (!dnode) {
|
||||||
|
Loading…
Reference in New Issue
Block a user