]> git.puffer.fish Git - matthieu/frr.git/commitdiff
vrrpd: skip binding interface after create
authorQuentin Young <qlyoung@cumulusnetworks.com>
Wed, 13 Feb 2019 22:16:56 +0000 (22:16 +0000)
committerQuentin Young <qlyoung@cumulusnetworks.com>
Fri, 17 May 2019 00:27:08 +0000 (00:27 +0000)
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 <qlyoung@cumulusnetworks.com>
vrrpd/vrrp.c

index cf0ab3d54b5b5523a447938acb8fe551744157f7..140a37308720c1b96e43aaeb2d92121459b790eb 100644 (file)
@@ -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);