Skip to content

Commit

Permalink
networkd: reconfigure IPv6 and static address after link up event (#3105
Browse files Browse the repository at this point in the history
)

Now we are not setting static address, start dhcp6 client and
discovering IPv6 routers after link gained carrier.

This fixes #2912.
  • Loading branch information
ssahani authored and keszybz committed Apr 28, 2016
1 parent a44cb5c commit 6fc2549
Showing 1 changed file with 23 additions and 7 deletions.
30 changes: 23 additions & 7 deletions src/network/networkd-link.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 6fc2549

Please sign in to comment.