summaryrefslogtreecommitdiff
path: root/src/network/networkd-netdev.c
diff options
context:
space:
mode:
authorTom Gundersen <teg@jklm.no>2014-07-03 09:43:31 +0200
committerTom Gundersen <teg@jklm.no>2014-07-03 11:00:01 +0200
commit563c69c6b2c2bd691352ef522cb9ec95c08a0c63 (patch)
treed16b86793b1f0406eff5408e90e5838389bfac23 /src/network/networkd-netdev.c
parent0372cb2bd2342fa5c5585c666f79159a8341f4a6 (diff)
networkd: netdev - take ref immediately after calling out
Keeping the refcounting next to the sd_bus_call_async() makes it easier to check.
Diffstat (limited to 'src/network/networkd-netdev.c')
-rw-r--r--src/network/networkd-netdev.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/network/networkd-netdev.c b/src/network/networkd-netdev.c
index c80e943871..0861ff3cc1 100644
--- a/src/network/networkd-netdev.c
+++ b/src/network/networkd-netdev.c
@@ -184,6 +184,8 @@ static int netdev_enslave_ready(NetDev *netdev, Link* link, sd_rtnl_message_hand
return r;
}
+ link_ref(link);
+
log_debug_netdev(netdev, "enslaving link '%s'", link->ifname);
return 0;
@@ -393,6 +395,7 @@ int netdev_enslave(NetDev *netdev, Link *link, sd_rtnl_message_handler_t callbac
cb->callback = callback;
cb->link = link;
+ link_ref(link);
LIST_PREPEND(callbacks, netdev->callbacks, cb);
}
@@ -678,8 +681,6 @@ static int netdev_load_one(Manager *manager, const char *filename) {
if (r < 0)
return r;
- netdev_ref(netdev);
-
break;
case NETDEV_KIND_BRIDGE:
case NETDEV_KIND_BOND: