diff options
author | Quentin Young <qlyoung@cumulusnetworks.com> | 2019-08-05 18:24:45 +0200 |
---|---|---|
committer | Quentin Young <qlyoung@cumulusnetworks.com> | 2019-08-05 18:24:45 +0200 |
commit | c257cce4d6d0fe5b9bbb4d4af761c35aeb201b32 (patch) | |
tree | 130cbc43893fd434beb7a216ec8f149b15dab44f /vrrpd | |
parent | vrrpd: try to bind interfaces on if_down notifications (diff) | |
download | frr-c257cce4d6d0fe5b9bbb4d4af761c35aeb201b32.tar.xz frr-c257cce4d6d0fe5b9bbb4d4af761c35aeb201b32.zip |
vrrpd: eliminate potential null deref
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
Diffstat (limited to 'vrrpd')
-rw-r--r-- | vrrpd/vrrp.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/vrrpd/vrrp.c b/vrrpd/vrrp.c index da039f7a0..951ad3f58 100644 --- a/vrrpd/vrrp.c +++ b/vrrpd/vrrp.c @@ -196,14 +196,14 @@ static struct vrrp_vrouter *vrrp_lookup_by_if_mvl(struct interface *mvl_ifp) { struct interface *p; - if (!mvl_ifp || !mvl_ifp->link_ifindex + if (!mvl_ifp || mvl_ifp->link_ifindex == 0 || !vrrp_ifp_has_vrrp_mac(mvl_ifp)) { - if (!mvl_ifp->link_ifindex) + if (mvl_ifp && mvl_ifp->link_ifindex == 0) DEBUGD(&vrrp_dbg_zebra, VRRP_LOGPFX "Interface %s has no parent ifindex; disregarding", mvl_ifp->name); - if (!vrrp_ifp_has_vrrp_mac(mvl_ifp)) + if (mvl_ifp && !vrrp_ifp_has_vrrp_mac(mvl_ifp)) DEBUGD(&vrrp_dbg_zebra, VRRP_LOGPFX "Interface %s has a non-VRRP MAC; disregarding", |