network: make Link and NetDev always have the valid poiter to Manager

System Internals / systemd - Yu Watanabe [gmail.com] - 15 January 2019 13:48 EST

c4397d94c3d94909188d82e086ebedf5d3690569 introduces link_detach_from_manager() and netdev_detach_from_manager(), and they set Link::manager or NetDev::manager NULL. But, at the time e.g. link is removed, hence link_drop() is called, there may be still some asynchronous netlink call is waiting, and their callbacks hit assertion.

This make {link,netdev}_detach_from_manager() just drop all references from manager, but keep the pointer to manager.

Fixes #11411.

9e2bbf991 network: make Link and NetDev always have the valid poiter to Manager
src/network/netdev/netdev.c | 9 +++++++--
src/network/netdev/netdev.h | 1 +
src/network/netdev/wireguard.c | 6 ++----
src/network/networkd-link.c | 2 --
4 files changed, 10 insertions(+), 8 deletions(-)

Upstream: github.com


  • Share