networkd: netdev - add missing refs

Without this, the underlying device would get freed (and hence
fail).
This commit is contained in:
Tom Gundersen 2014-07-07 14:18:26 +02:00
parent c081882f07
commit e04468dec0
4 changed files with 8 additions and 0 deletions

View file

@ -150,6 +150,8 @@ int netdev_create_macvlan(NetDev *netdev, Link *link, sd_rtnl_message_handler_t
return r;
}
link_ref(link);
log_debug_netdev(netdev, "creating netdev");
netdev->state = NETDEV_STATE_CREATING;

View file

@ -529,6 +529,8 @@ int netdev_create_tunnel(NetDev *netdev, Link *link, sd_rtnl_message_handler_t c
return r;
}
link_ref(link);
log_debug_netdev(netdev, "Creating tunnel netdev: %s",
netdev_kind_to_string(netdev->kind));

View file

@ -139,6 +139,8 @@ int netdev_create_vlan(NetDev *netdev, Link *link, sd_rtnl_message_handler_t cal
return r;
}
link_ref(link);
log_debug_netdev(netdev, "creating netdev");
netdev->state = NETDEV_STATE_CREATING;

View file

@ -154,6 +154,8 @@ int netdev_create_vxlan(NetDev *netdev, Link *link, sd_rtnl_message_handler_t ca
return r;
}
link_ref(link);
log_debug_netdev(netdev, "Creating vxlan netdev: %s",
netdev_kind_to_string(netdev->kind));