summaryrefslogtreecommitdiffstats
path: root/vrrpd
diff options
context:
space:
mode:
authorQuentin Young <qlyoung@cumulusnetworks.com>2019-08-05 18:24:45 +0200
committerQuentin Young <qlyoung@cumulusnetworks.com>2019-08-05 18:24:45 +0200
commitc257cce4d6d0fe5b9bbb4d4af761c35aeb201b32 (patch)
tree130cbc43893fd434beb7a216ec8f149b15dab44f /vrrpd
parentvrrpd: try to bind interfaces on if_down notifications (diff)
downloadfrr-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.c6
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",