summaryrefslogtreecommitdiffstats
path: root/vrrpd/vrrp.c
diff options
context:
space:
mode:
authorQuentin Young <qlyoung@cumulusnetworks.com>2019-03-01 00:48:09 +0100
committerQuentin Young <qlyoung@cumulusnetworks.com>2019-05-17 02:27:08 +0200
commit3a9c6f93d4e22651d97b595ebbc4616631751e7c (patch)
treef395c903a885d90b876843609049573627d58592 /vrrpd/vrrp.c
parentvrrpd: fix autoconfig of protodown'd interfaces (diff)
downloadfrr-3a9c6f93d4e22651d97b595ebbc4616631751e7c.tar.xz
frr-3a9c6f93d4e22651d97b595ebbc4616631751e7c.zip
vrrpd: fix interface block config writes
Improper reuse of list node broke config writes of multiple instances Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
Diffstat (limited to 'vrrpd/vrrp.c')
-rw-r--r--vrrpd/vrrp.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/vrrpd/vrrp.c b/vrrpd/vrrp.c
index 4d4a66b6d..fbc738e30 100644
--- a/vrrpd/vrrp.c
+++ b/vrrpd/vrrp.c
@@ -2053,7 +2053,7 @@ void vrrp_if_address_del(struct interface *ifp)
int vrrp_config_write_interface(struct vty *vty)
{
struct list *vrs = hash_to_list(vrrp_vrouters_hash);
- struct listnode *ln;
+ struct listnode *ln, *ipln;
struct vrrp_vrouter *vr;
int writes = 0;
@@ -2088,23 +2088,24 @@ int vrrp_config_write_interface(struct vty *vty)
vty_out(vty, " vrrp %" PRIu8 " priority %" PRIu8 "\n",
vr->vrid, vr->priority);
- ln = NULL;
struct ipaddr *ip;
- for (ALL_LIST_ELEMENTS_RO(vr->v4->addrs, ln, ip)) {
+ for (ALL_LIST_ELEMENTS_RO(vr->v4->addrs, ipln, ip)) {
char ipbuf[INET6_ADDRSTRLEN];
ipaddr2str(ip, ipbuf, sizeof(ipbuf));
vty_out(vty, " vrrp %" PRIu8 " ip %s\n", vr->vrid,
ipbuf);
++writes;
}
- for (ALL_LIST_ELEMENTS_RO(vr->v6->addrs, ln, ip)) {
+
+ for (ALL_LIST_ELEMENTS_RO(vr->v6->addrs, ipln, ip)) {
char ipbuf[INET6_ADDRSTRLEN];
ipaddr2str(ip, ipbuf, sizeof(ipbuf));
vty_out(vty, " vrrp %" PRIu8 " ipv6 %s\n", vr->vrid,
ipbuf);
++writes;
}
+ vty_endframe(vty, "!\n");
}
return writes;