mirror of
https://github.com/systemd/systemd-stable.git
synced 2024-12-23 17:34:00 +03:00
Merge pull request #14611 from yuwata/network-fix-reconfigure
network: fix reconfigure
This commit is contained in:
commit
ebe2ab60cc
@ -621,6 +621,12 @@ int bus_link_method_reconfigure(sd_bus_message *message, void *userdata, sd_bus_
|
||||
if (r < 0)
|
||||
return r;
|
||||
|
||||
link_set_state(l, LINK_STATE_INITIALIZED);
|
||||
r = link_save(l);
|
||||
if (r < 0)
|
||||
return r;
|
||||
link_clean(l);
|
||||
|
||||
return sd_bus_reply_method_return(message, NULL);
|
||||
}
|
||||
|
||||
|
@ -3023,9 +3023,6 @@ static int link_reconfigure_internal(Link *link, sd_netlink_message *m, bool for
|
||||
Network *network;
|
||||
int r;
|
||||
|
||||
if (IN_SET(link->state, LINK_STATE_PENDING, LINK_STATE_LINGER))
|
||||
return 0;
|
||||
|
||||
if (m) {
|
||||
_cleanup_strv_free_ char **s = NULL;
|
||||
|
||||
@ -3089,6 +3086,7 @@ static int link_reconfigure_internal(Link *link, sd_netlink_message *m, bool for
|
||||
return r;
|
||||
|
||||
link_set_state(link, LINK_STATE_INITIALIZED);
|
||||
link_dirty(link);
|
||||
|
||||
/* link_configure_duid() returns 0 if it requests product UUID. In that case,
|
||||
* link_configure() is called later asynchronously. */
|
||||
@ -3127,6 +3125,9 @@ int link_reconfigure(Link *link, bool force) {
|
||||
_cleanup_(sd_netlink_message_unrefp) sd_netlink_message *req = NULL;
|
||||
int r;
|
||||
|
||||
if (IN_SET(link->state, LINK_STATE_PENDING, LINK_STATE_LINGER))
|
||||
return 0;
|
||||
|
||||
r = sd_rtnl_message_new_link(link->manager->rtnl, &req, RTM_GETLINK,
|
||||
link->ifindex);
|
||||
if (r < 0)
|
||||
|
Loading…
Reference in New Issue
Block a user