diff options
author | Quentin Young <qlyoung@cumulusnetworks.com> | 2019-02-28 23:12:23 +0100 |
---|---|---|
committer | Quentin Young <qlyoung@cumulusnetworks.com> | 2019-05-17 02:27:08 +0200 |
commit | c7e65c4f805d2378c710836877eb8db5f8211ef6 (patch) | |
tree | 323142166917584855855cadc94db478b272b37f /vrrpd | |
parent | vrrpd: fix unsigned - signed cmp (diff) | |
download | frr-c7e65c4f805d2378c710836877eb8db5f8211ef6.tar.xz frr-c7e65c4f805d2378c710836877eb8db5f8211ef6.zip |
vrrpd: add more debugging info
* Add reason why we are discarding adverts
* Add primary IP to show vrrp output
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
Diffstat (limited to 'vrrpd')
-rw-r--r-- | vrrpd/vrrp.c | 14 | ||||
-rw-r--r-- | vrrpd/vrrp_vty.c | 6 |
2 files changed, 16 insertions, 4 deletions
diff --git a/vrrpd/vrrp.c b/vrrpd/vrrp.c index 84ff84b8a..55ae7ce7a 100644 --- a/vrrpd/vrrp.c +++ b/vrrpd/vrrp.c @@ -668,6 +668,8 @@ static int vrrp_recv_advertisement(struct vrrp_router *r, struct ipaddr *src, { char sipstr[INET6_ADDRSTRLEN]; ipaddr2str(src, sipstr, sizeof(sipstr)); + char dipstr[INET6_ADDRSTRLEN]; + ipaddr2str(&r->src, dipstr, sizeof(dipstr)); char dumpbuf[BUFSIZ]; vrrp_pkt_adver_dump(dumpbuf, sizeof(dumpbuf), pkt); @@ -758,8 +760,10 @@ static int vrrp_recv_advertisement(struct vrrp_router *r, struct ipaddr *src, /* Discard advertisement */ DEBUGD(&vrrp_dbg_proto, VRRP_LOGPFX VRRP_LOGPFX_VRID - "Discarding advertisement from %s", - r->vr->vrid, sipstr); + "Discarding advertisement from %s (%" PRIu8 + " = %" PRIu8 " & %s <= %s)", + r->vr->vrid, sipstr, pkt->hdr.priority, + r->priority, sipstr, dipstr); } break; case VRRP_STATE_BACKUP: @@ -785,8 +789,10 @@ static int vrrp_recv_advertisement(struct vrrp_router *r, struct ipaddr *src, /* Discard advertisement */ DEBUGD(&vrrp_dbg_proto, VRRP_LOGPFX VRRP_LOGPFX_VRID - "Discarding advertisement from %s", - r->vr->vrid, sipstr); + "Discarding advertisement from %s (%" PRIu8 + " < %" PRIu8 " & preempt = true)", + r->vr->vrid, sipstr, pkt->hdr.priority, + r->priority); } break; case VRRP_STATE_INITIALIZE: diff --git a/vrrpd/vrrp_vty.c b/vrrpd/vrrp_vty.c index 3f6918539..2a7a6ecfc 100644 --- a/vrrpd/vrrp_vty.c +++ b/vrrpd/vrrp_vty.c @@ -444,6 +444,8 @@ static void vrrp_show(struct vty *vty, struct vrrp_vrouter *vr) char ipstr[INET6_ADDRSTRLEN]; const char *stastr4 = vrrp_state_names[vr->v4->fsm.state]; const char *stastr6 = vrrp_state_names[vr->v6->fsm.state]; + char sipstr4[INET6_ADDRSTRLEN]; + char sipstr6[INET6_ADDRSTRLEN]; struct listnode *ln; struct ipaddr *ip; @@ -461,6 +463,10 @@ static void vrrp_show(struct vty *vty, struct vrrp_vrouter *vr) vr->v4->mvl_ifp ? vr->v4->mvl_ifp->name : "None"); ttable_add_row(tt, "%s|%s", "VRRP interface (v6)", vr->v6->mvl_ifp ? vr->v6->mvl_ifp->name : "None"); + ipaddr2str(&vr->v4->src, sipstr4, sizeof(sipstr4)); + ipaddr2str(&vr->v6->src, sipstr6, sizeof(sipstr6)); + ttable_add_row(tt, "%s|%s", "Primary IP (v4)", sipstr4); + ttable_add_row(tt, "%s|%s", "Primary IP (v6)", sipstr6); ttable_add_row(tt, "%s|%s", "Virtual MAC (v4)", ethstr4); ttable_add_row(tt, "%s|%s", "Virtual MAC (v6)", ethstr6); ttable_add_row(tt, "%s|%s", "Status (v4)", stastr4); |