summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYu Watanabe <watanabe.yu+github@gmail.com>2021-06-12 04:46:01 +0200
committerYu Watanabe <watanabe.yu+github@gmail.com>2021-06-14 22:12:25 +0200
commit7f80fa12c2f4f2a1f0e6bf04a3abd7634f4605ab (patch)
treea7e783e00cba97694023ddd14e2f83c4ac24e93b
parentnetwork: do not partially update wlan information on failure (diff)
downloadsystemd-7f80fa12c2f4f2a1f0e6bf04a3abd7634f4605ab.tar.xz
systemd-7f80fa12c2f4f2a1f0e6bf04a3abd7634f4605ab.zip
network: add brief comment about reconfiguring interfaces
This also renames link_reconfigure_internal() -> link_reconfigure_impl().
-rw-r--r--src/network/networkd-link-bus.c2
-rw-r--r--src/network/networkd-link.c8
-rw-r--r--src/network/networkd-manager-bus.c2
3 files changed, 7 insertions, 5 deletions
diff --git a/src/network/networkd-link-bus.c b/src/network/networkd-link-bus.c
index 7be333eac6..50c3f60080 100644
--- a/src/network/networkd-link-bus.c
+++ b/src/network/networkd-link-bus.c
@@ -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) {
diff --git a/src/network/networkd-link.c b/src/network/networkd-link.c
index f603058ea0..3376a2f3e1 100644
--- a/src/network/networkd-link.c
+++ b/src/network/networkd-link.c
@@ -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;
}
diff --git a/src/network/networkd-manager-bus.c b/src/network/networkd-manager-bus.c
index 4be09d98d8..a1520240d7 100644
--- a/src/network/networkd-manager-bus.c
+++ b/src/network/networkd-manager-bus.c
@@ -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;
}