summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorGaoChX <chiso.gao@gmail.com>2022-06-28 16:25:03 +0800
committerMatthew Smith <mgsmith@netgate.com>2022-06-30 17:27:46 +0000
commit5b3d543878c7a09a3ddcc617b5d2978e710d0861 (patch)
tree0ab858b3f28fecbcae52ab7c7a2240c1b0ac6a86 /src
parentd50e661d661ba96dd5e8b64f47d5d252dea8284b (diff)
vrrp: while delete vr can't delete multi virtual address.
Here is bug example: vpp# create loopback interface loop0 vpp# vrrp vr add loop0 vr_id 1 priority 100 192.168.1.1 192.168.1.2 vpp# vrrp vr del loop0 vr_id 1 vpp# vrrp vr add loop0 vr_id 1 priority 100 192.168.1.1 192.168.1.2 vrrp vr add: vrrp_vr_add_del returned -105 Type: fix Signed-off-by: GaoChX <chiso.gao@gmail.com> Change-Id: I3e0d086ac8fb52756339cff19b9a83911ec9748b
Diffstat (limited to 'src')
-rw-r--r--src/plugins/vrrp/vrrp.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/plugins/vrrp/vrrp.c b/src/plugins/vrrp/vrrp.c
index d28905379b2..f1ab1b27185 100644
--- a/src/plugins/vrrp/vrrp.c
+++ b/src/plugins/vrrp/vrrp.c
@@ -813,10 +813,13 @@ static void
vrrp_vr_del_common (vrrp_vr_t *vr, vrrp_vr_key_t *key)
{
vrrp_main_t *vrm = &vrrp_main;
+ ip46_address_t *vr_addrs_del_copy;
vrrp_vr_tracking_ifs_add_del (vr, vr->tracking.interfaces, 0);
- vrrp_vr_addrs_add_del (vr, 0, vr->config.vr_addrs);
+ vr_addrs_del_copy = vec_dup (vr->config.vr_addrs);
+ vrrp_vr_addrs_add_del (vr, 0, vr_addrs_del_copy);
mhash_unset (&vrm->vr_index_by_key, key, 0);
+ vec_free (vr_addrs_del_copy);
vec_free (vr->config.peer_addrs);
vec_free (vr->config.vr_addrs);
vec_free (vr->tracking.interfaces);