From 2198a5bbc90bb3fc4ec4626ff627a6df5b1081e4 Mon Sep 17 00:00:00 2001 From: Quentin Young Date: Wed, 13 Feb 2019 22:16:56 +0000 Subject: [PATCH] vrrpd: skip binding interface after create When automatically creating new VRRP instances, we don't need to try to bind them to macvlan interfaces again. We only need to do that when we got notified that a new interface came up and want an existing VRRP instance to update its interface bindings. Signed-off-by: Quentin Young --- vrrpd/vrrp.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/vrrpd/vrrp.c b/vrrpd/vrrp.c index cf0ab3d54b..140a373087 100644 --- a/vrrpd/vrrp.c +++ b/vrrpd/vrrp.c @@ -1463,25 +1463,28 @@ static struct vrrp_vrouter *vrrp_lookup_by_mvlif(struct interface *mvl_ifp) int vrrp_autoconfig_if_add(struct interface *ifp) { + bool created = false; + struct vrrp_vrouter *vr; + if (!vrrp_autoconfig_is_on) return 0; - struct vrrp_vrouter *vr; - if (!ifp || !ifp->link_ifindex || !vrrp_ifp_has_vrrp_mac(ifp)) return -1; vr = vrrp_lookup_by_mvlif(ifp); - if (!vr) + if (!vr) { vr = vrrp_autoconfig_autocreate(ifp); + created = true; + } if (!vr) return -1; if (vr->autoconf == false) return 0; - else { + else if (!created) { vrrp_attach_interface(vr->v4); vrrp_attach_interface(vr->v6); vrrp_autoconfig_autoaddrupdate(vr); -- 2.39.5