network: add brief comment about reconfiguring interfaces

This also renames link_reconfigure_internal() -> link_reconfigure_impl().
This commit is contained in:
Yu Watanabe 2021-06-12 11:46:01 +09:00
parent ecb3deccdc
commit 7f80fa12c2
3 changed files with 7 additions and 5 deletions

View file

@ -667,7 +667,7 @@ int bus_link_method_reconfigure(sd_bus_message *message, void *userdata, sd_bus_
if (r == 0)
return 1; /* Polkit will call us back */
r = link_reconfigure(l, true);
r = link_reconfigure(l, /* force = */ true);
if (r < 0)
return r;
if (r > 0) {

View file

@ -1199,7 +1199,7 @@ static int link_get_network(Link *link, Network **ret) {
return -ENOENT;
}
static int link_reconfigure_internal(Link *link, bool force) {
static int link_reconfigure_impl(Link *link, bool force) {
Network *network;
int r;
@ -1267,7 +1267,7 @@ static int link_reconfigure_handler_internal(sd_netlink *rtnl, sd_netlink_messag
if (r <= 0)
return r;
r = link_reconfigure_internal(link, force);
r = link_reconfigure_impl(link, force);
if (r < 0)
link_enter_failed(link);
@ -1501,7 +1501,9 @@ static int link_carrier_gained(Link *link) {
if (r < 0)
return r;
if (r > 0) {
r = link_reconfigure_internal(link, false);
/* All link information is up-to-date. So, it is not necessary to call RTM_GETLINK
* netlink method again. */
r = link_reconfigure_impl(link, /* force = */ false);
if (r != 0)
return r;
}

View file

@ -216,7 +216,7 @@ static int bus_method_reload(sd_bus_message *message, void *userdata, sd_bus_err
return r;
HASHMAP_FOREACH(link, manager->links) {
r = link_reconfigure(link, false);
r = link_reconfigure(link, /* force = */ false);
if (r < 0)
return r;
}