Skip to content

Commit

Permalink
Merge pull request #17578 from donaldsharp/pim_autorp_prevent_crash
Browse files Browse the repository at this point in the history
pimd: Prevent crash of pim when auto-rp's socket is not initialized
  • Loading branch information
Jafaral authored Dec 4, 2024
2 parents 6bf4283 + 37b8819 commit 7c8cef4
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions pimd/pim_autorp.c
Original file line number Diff line number Diff line change
Expand Up @@ -1508,12 +1508,14 @@ void pim_autorp_init(struct pim_instance *pim)
autorp->discovery_holdtime = DEFAULT_AUTORP_DISCOVERY_HOLDTIME;
cand_addrsel_clear(&(autorp->mapping_agent_addrsel));

pim->autorp = autorp;

if (!pim_autorp_socket_enable(autorp)) {
zlog_warn("%s: AutoRP failed to initialize", __func__);
zlog_warn("%s: AutoRP failed to initialize, feature will not work correctly",
__func__);
return;
}

pim->autorp = autorp;
if (PIM_DEBUG_AUTORP)
zlog_debug("%s: AutoRP Initialized", __func__);

Expand Down

0 comments on commit 7c8cef4

Please sign in to comment.