summaryrefslogtreecommitdiffstats
path: root/vrrpd/vrrp_vty.c
diff options
context:
space:
mode:
Diffstat (limited to 'vrrpd/vrrp_vty.c')
-rw-r--r--vrrpd/vrrp_vty.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/vrrpd/vrrp_vty.c b/vrrpd/vrrp_vty.c
index bbdf48b32..fd6cbc8b6 100644
--- a/vrrpd/vrrp_vty.c
+++ b/vrrpd/vrrp_vty.c
@@ -200,7 +200,11 @@ DEFPY_YANG(vrrp_ip,
VRRP_IP_STR)
{
int op = no ? NB_OP_DESTROY : NB_OP_CREATE;
- nb_cli_enqueue_change(vty, "./v4/virtual-address", op, ip_str);
+ char xpath[XPATH_MAXLEN];
+
+ snprintf(xpath, sizeof(xpath), "./v4/virtual-address[.='%s']", ip_str);
+
+ nb_cli_enqueue_change(vty, xpath, op, NULL);
return nb_cli_apply_changes(vty, VRRP_XPATH_ENTRY, vrid);
}
@@ -228,7 +232,11 @@ DEFPY_YANG(vrrp_ip6,
VRRP_IP_STR)
{
int op = no ? NB_OP_DESTROY : NB_OP_CREATE;
- nb_cli_enqueue_change(vty, "./v6/virtual-address", op, ipv6_str);
+ char xpath[XPATH_MAXLEN];
+
+ snprintf(xpath, sizeof(xpath), "./v6/virtual-address[.='%s']", ipv6_str);
+
+ nb_cli_enqueue_change(vty, xpath, op, NULL);
return nb_cli_apply_changes(vty, VRRP_XPATH_ENTRY, vrid);
}