Skip to content

Commit

Permalink
vrrp: fix segfault when instance has no interface configured
Browse files Browse the repository at this point in the history
If a vrrp instance has no interface configured (so it is
unicast), processing SIGUSR1 resulted ina  segfault.

Signed-off-by: Quentin Armitage <[email protected]>
  • Loading branch information
pqarmitage committed Nov 24, 2024
1 parent 99d2ea9 commit 2e2961d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion keepalived/vrrp/vrrp_data.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 2e2961d

Please sign in to comment.