]> git.puffer.fish Git - matthieu/frr.git/commitdiff
vrrpd: only bind to link locals for v6 adverts
authorQuentin Young <qlyoung@cumulusnetworks.com>
Thu, 14 Feb 2019 23:40:20 +0000 (23:40 +0000)
committerQuentin Young <qlyoung@cumulusnetworks.com>
Fri, 17 May 2019 00:27:08 +0000 (00:27 +0000)
Was missing a check to make sure that the v6 address we select as the
source IP for advertisements was a link local address

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
vrrpd/vrrp.c

index bf4f0f1ec90a7441376a935f0e822728a99103ae..113e42490d5e91caeb105ed2154fd88989b31bbb 100644 (file)
@@ -851,8 +851,13 @@ static int vrrp_bind_to_primary_connected(struct vrrp_router *r)
        struct listnode *ln;
        struct connected *c = NULL;
        for (ALL_LIST_ELEMENTS_RO(ifp->connected, ln, c))
-               if (c->address->family == r->family)
-                       break;
+               if (c->address->family == r->family) {
+                       if (r->family == AF_INET6
+                           && IN6_IS_ADDR_LINKLOCAL(&c->address->u.prefix6))
+                               break;
+                       else if (r->family == AF_INET)
+                               break;
+               }
 
        if (c == NULL) {
                zlog_err(VRRP_LOGPFX VRRP_LOGPFX_VRID