Skip to content

Commit

Permalink
fix segfault when a netdev disappears
Browse files Browse the repository at this point in the history
new_link is NULL in the v2 callback for a DEL action
  • Loading branch information
mwhudson committed Dec 11, 2019
1 parent ce784ff commit 010f80e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions probert/_rtnetlinkmodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,10 @@ static void observe_link_change(
int is_vlan, ifindex;
unsigned int flags;

if (act == NL_ACT_DEL) {
link = old_link;
}

is_vlan = rtnl_link_is_vlan(link);
ifindex = rtnl_link_get_ifindex(link);
flags = rtnl_link_get_flags(link);
Expand Down

0 comments on commit 010f80e

Please sign in to comment.