summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSusant Sahani <ssahani@users.noreply.github.com>2016-04-29 04:33:29 +0530
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2016-04-28 19:03:29 -0400
commit6fc2549711493b3374a56c3025291df16e455e25 (patch)
treeece3a671bf2c810532a8f656d1378b5f7848b3a6 /src
parenta44cb5cbf79cd2af699e981256fa25b6246d30d8 (diff)
networkd: reconfigure IPv6 and static address after link up event (#3105)
Now we are not setting static address, start dhcp6 client and discovering IPv6 routers after link gained carrier. This fixes #2912.
Diffstat (limited to 'src')
-rw-r--r--src/network/networkd-link.c30
1 files changed, 23 insertions, 7 deletions
diff --git a/src/network/networkd-link.c b/src/network/networkd-link.c
index 5101d553d5..892162136f 100644
--- a/src/network/networkd-link.c
+++ b/src/network/networkd-link.c
@@ -1458,7 +1458,7 @@ static int link_acquire_ipv6_conf(Link *link) {
return 0;
}
-static int link_acquire_conf(Link *link) {
+static int link_acquire_ipv4_conf(Link *link) {
int r;
assert(link);
@@ -1486,6 +1486,24 @@ static int link_acquire_conf(Link *link) {
return log_link_warning_errno(link, r, "Could not acquire DHCPv4 lease: %m");
}
+ return 0;
+}
+
+static int link_acquire_conf(Link *link) {
+ int r;
+
+ assert(link);
+
+ r = link_acquire_ipv4_conf(link);
+ if (r < 0)
+ return r;
+
+ if (in_addr_is_null(AF_INET6, (const union in_addr_union*) &link->ipv6ll_address) == 0) {
+ r = link_acquire_ipv6_conf(link);
+ if (r < 0)
+ return r;
+ }
+
if (link_lldp_tx_enabled(link)) {
r = link_lldp_tx_start(link);
if (r < 0)
@@ -2351,12 +2369,6 @@ static int link_configure(Link *link) {
r = link_acquire_conf(link);
if (r < 0)
return r;
-
- if (in_addr_is_null(AF_INET6, (const union in_addr_union*) &link->ipv6ll_address) == 0) {
- r = link_acquire_ipv6_conf(link);
- if (r < 0)
- return r;
- }
}
return link_enter_join_netdev(link);
@@ -2739,6 +2751,10 @@ static int link_carrier_gained(Link *link) {
link_enter_failed(link);
return r;
}
+
+ r = link_enter_set_addresses(link);
+ if (r < 0)
+ return r;
}
r = link_handle_bound_by_list(link);