Skip to content

Commit ee23fcf

Browse files
committed
mctpd: Be cautious of deleting unknown links
This may not be possible (hasn't been encountered), but check in case. Signed-off-by: Matt Johnston <[email protected]>
1 parent 0b6cdf6 commit ee23fcf

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/mctpd.c

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -958,7 +958,14 @@ static int cb_listen_monitor(sd_event_source *s, int sd, uint32_t revents,
958958
case MCTP_NL_DEL_LINK:
959959
{
960960
// Local addresses have already been deleted with DEL_EID
961-
rc = del_interface(c->link_userdata);
961+
if (c->link_userdata) {
962+
rc = del_interface(c->link_userdata);
963+
} else {
964+
// Would have expected to have seen it in previous
965+
// MCTP_NL_ADD_LINK or setup_nets().
966+
rc = -ENOENT;
967+
bug_warn("delete unconfigured interface %d", c->ifindex);
968+
}
962969
any_error |= (rc < 0);
963970
}
964971
break;

0 commit comments

Comments
 (0)