summaryrefslogtreecommitdiff
path: root/src/network
diff options
context:
space:
mode:
authorTom Gundersen <teg@jklm.no>2015-10-18 16:59:21 +0200
committerTom Gundersen <teg@jklm.no>2015-10-22 17:19:54 +0200
commit6d8f6b0b2ae14aee0b02c7e3d1edaeaa2c118056 (patch)
tree241a3fc9b00dca227ae9a37d0be28fe45c762112 /src/network
parenta13c50e7a33e2b8e0481f725c6272142e6f71751 (diff)
networkd: dhcp6 - DHCPv6 addresses should always be /128
The routing information should be configured separately by ND, there is no need to indicate the prefix again in the DHCPv6 addresses. See discussion and related links at issue #1520.
Diffstat (limited to 'src/network')
-rw-r--r--src/network/networkd-dhcp6.c21
1 files changed, 4 insertions, 17 deletions
diff --git a/src/network/networkd-dhcp6.c b/src/network/networkd-dhcp6.c
index fa02aa0a3d..f47ac15dcd 100644
--- a/src/network/networkd-dhcp6.c
+++ b/src/network/networkd-dhcp6.c
@@ -64,8 +64,7 @@ static int dhcp6_address_handler(sd_netlink *rtnl, sd_netlink_message *m,
}
static int dhcp6_address_change(Link *link, struct in6_addr *ip6_addr,
- uint8_t prefixlen, uint32_t lifetime_preferred,
- uint32_t lifetime_valid) {
+ uint32_t lifetime_preferred, uint32_t lifetime_valid) {
int r;
_cleanup_address_free_ Address *addr = NULL;
@@ -77,7 +76,7 @@ static int dhcp6_address_change(Link *link, struct in6_addr *ip6_addr,
memcpy(&addr->in_addr.in6, ip6_addr, sizeof(*ip6_addr));
addr->flags = IFA_F_NOPREFIXROUTE;
- addr->prefixlen = prefixlen;
+ addr->prefixlen = 128;
addr->cinfo.ifa_prefered = lifetime_preferred;
addr->cinfo.ifa_valid = lifetime_valid;
@@ -99,7 +98,6 @@ static int dhcp6_lease_address_acquired(sd_dhcp6_client *client, Link *link) {
sd_dhcp6_lease *lease;
struct in6_addr ip6_addr;
uint32_t lifetime_preferred, lifetime_valid;
- uint8_t prefixlen;
r = sd_dhcp6_client_get_lease(client, &lease);
if (r < 0)
@@ -111,18 +109,7 @@ static int dhcp6_lease_address_acquired(sd_dhcp6_client *client, Link *link) {
&lifetime_preferred,
&lifetime_valid) >= 0) {
- r = sd_ndisc_get_prefixlen(link->ndisc_router_discovery,
- &ip6_addr, &prefixlen);
- if (r < 0 && r != -EADDRNOTAVAIL) {
- log_link_warning_errno(link, r, "Could not get prefix information: %m");
- return r;
- }
-
- if (r == -EADDRNOTAVAIL)
- prefixlen = 128;
-
- r = dhcp6_address_change(link, &ip6_addr, prefixlen,
- lifetime_preferred, lifetime_valid);
+ r = dhcp6_address_change(link, &ip6_addr, lifetime_preferred, lifetime_valid);
if (r < 0)
return r;
}
@@ -294,7 +281,7 @@ int dhcp6_prefix_expired(Link *link) {
log_link_info(link, "IPv6 prefix length updated "SD_NDISC_ADDRESS_FORMAT_STR"/%d", SD_NDISC_ADDRESS_FORMAT_VAL(ip6_addr), 128);
- dhcp6_address_change(link, &ip6_addr, 128, lifetime_preferred, lifetime_valid);
+ dhcp6_address_change(link, &ip6_addr, lifetime_preferred, lifetime_valid);
}
return 0;