Skip to content

Commit

Permalink
networkd: manager do not unef netlink and gennetlink early
Browse files Browse the repository at this point in the history
Because of this the fd is getting closed and we getting errors
like
```
^Ceno1: Could not send rtnetlink message: Bad file descriptor
enp7s0f0: Could not send rtnetlink message: Bad file descriptor
enp7s0f0: Cannot delete unreachable route for DHCPv6 delegated subnet 2a0a:...:fc::/62: Bad file descriptor
Assertion '*_head == _item' failed at ../systemd/src/network/networkd-route.c:126, function route_free(). Aborting.
Aborted
```

Closes one of systemd#12452
  • Loading branch information
Susant Sahani committed May 2, 2019
1 parent 64538af commit 055449e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/network/networkd-manager.c
Original file line number Diff line number Diff line change
Expand Up @@ -1435,10 +1435,6 @@ void manager_free(Manager *m) {

free(m->state_file);

sd_netlink_unref(m->rtnl);
sd_netlink_unref(m->genl);
sd_resolve_unref(m->resolve);

while ((link = hashmap_first(m->dhcp6_prefixes)))
manager_dhcp6_prefix_remove_all(m, link);
hashmap_free(m->dhcp6_prefixes);
Expand Down Expand Up @@ -1469,6 +1465,10 @@ void manager_free(Manager *m) {
m->rules_foreign = set_free_with_destructor(m->rules_foreign, routing_policy_rule_free);
set_free_with_destructor(m->rules_saved, routing_policy_rule_free);

sd_netlink_unref(m->rtnl);
sd_netlink_unref(m->genl);
sd_resolve_unref(m->resolve);

sd_event_unref(m->event);

sd_device_monitor_unref(m->device_monitor);
Expand Down

0 comments on commit 055449e

Please sign in to comment.