From 2e2961de8c234ef06a857550de484fa1c95c3827 Mon Sep 17 00:00:00 2001 From: Quentin Armitage Date: Sun, 24 Nov 2024 14:09:03 +0000 Subject: [PATCH] vrrp: fix segfault when instance has no interface configured If a vrrp instance has no interface configured (so it is unicast), processing SIGUSR1 resulted ina segfault. Signed-off-by: Quentin Armitage --- keepalived/vrrp/vrrp_data.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/keepalived/vrrp/vrrp_data.c b/keepalived/vrrp/vrrp_data.c index e3a55207be..624b0ec516 100644 --- a/keepalived/vrrp/vrrp_data.c +++ b/keepalived/vrrp/vrrp_data.c @@ -685,7 +685,7 @@ dump_vrrp(FILE *fp, const vrrp_t *vrrp) /* The following should only be specified for VMACs and ipvlans */ if (__test_bit(VRRP_VMAC_GROUP, &vrrp->flags)) conf_write(fp, " Interface group %u", vrrp->vmac_group); - else if (vrrp->ifp->base_ifp->group) + else if (vrrp->ifp && vrrp->ifp->base_ifp->group) conf_write(fp, " Interface group %u (copied from parent)", vrrp->ifp->base_ifp->group); if (vrrp->ifp && vrrp->ifp->is_ours) {