diff options
author | Yu Watanabe <watanabe.yu+github@gmail.com> | 2021-01-13 06:20:44 +0900 |
---|---|---|
committer | Yu Watanabe <watanabe.yu+github@gmail.com> | 2021-01-14 00:16:10 +0900 |
commit | 8b76ee89d7b6f8afbe5efb8b44b5fb06695fe5bb (patch) | |
tree | 14d57a504cc1e059be60a2c7d6a73a48348864c5 /src/network/networkd-dhcp6.c | |
parent | 4327574fc1093513badc2177f71cede2fc88c13c (diff) | |
download | systemd-8b76ee89d7b6f8afbe5efb8b44b5fb06695fe5bb.tar.gz |
network: drop a function argument which is always constant
Diffstat (limited to 'src/network/networkd-dhcp6.c')
-rw-r--r-- | src/network/networkd-dhcp6.c | 27 |
1 files changed, 16 insertions, 11 deletions
diff --git a/src/network/networkd-dhcp6.c b/src/network/networkd-dhcp6.c index 89b22c35e3..7d5479fc8b 100644 --- a/src/network/networkd-dhcp6.c +++ b/src/network/networkd-dhcp6.c @@ -365,11 +365,11 @@ static int dhcp6_pd_address_handler(sd_netlink *rtnl, sd_netlink_message *m, Lin return 1; } -static int dhcp6_set_pd_address(Link *link, - const union in_addr_union *prefix, - uint8_t prefix_len, - uint32_t lifetime_preferred, - uint32_t lifetime_valid) { +static int dhcp6_set_pd_address( + Link *link, + const union in_addr_union *prefix, + uint32_t lifetime_preferred, + uint32_t lifetime_valid) { _cleanup_(address_freep) Address *address = NULL; Address *ret; @@ -396,7 +396,7 @@ static int dhcp6_set_pd_address(Link *link, return log_link_warning_errno(link, r, "Failed to generate EUI64 address for acquired DHCPv6 delegated prefix: %m"); } - address->prefixlen = prefix_len; + address->prefixlen = 64; address->family = AF_INET6; address->cinfo.ifa_prefered = lifetime_preferred; address->cinfo.ifa_valid = lifetime_valid; @@ -416,8 +416,13 @@ static int dhcp6_set_pd_address(Link *link, return 0; } -static int dhcp6_pd_assign_prefix(Link *link, const union in_addr_union *prefix, const union in_addr_union *pd_prefix, - uint8_t prefix_len, uint32_t lifetime_preferred, uint32_t lifetime_valid) { +static int dhcp6_pd_assign_prefix( + Link *link, + const union in_addr_union *prefix, + const union in_addr_union *pd_prefix, + uint32_t lifetime_preferred, + uint32_t lifetime_valid) { + int r; assert(link); @@ -425,7 +430,7 @@ static int dhcp6_pd_assign_prefix(Link *link, const union in_addr_union *prefix, assert(prefix); if (link->network->dhcp6_pd_announce) { - r = radv_add_prefix(link, &prefix->in6, prefix_len, lifetime_preferred, lifetime_valid); + r = radv_add_prefix(link, &prefix->in6, 64, lifetime_preferred, lifetime_valid); if (r < 0) return r; } @@ -434,7 +439,7 @@ static int dhcp6_pd_assign_prefix(Link *link, const union in_addr_union *prefix, if (r < 0) return r; - r = dhcp6_set_pd_address(link, prefix, prefix_len, lifetime_preferred, lifetime_valid); + r = dhcp6_set_pd_address(link, prefix, lifetime_preferred, lifetime_valid); if (r < 0) return r; @@ -559,7 +564,7 @@ static void dhcp6_pd_prefix_distribute(Link *dhcp6_link, } (void) in_addr_to_string(AF_INET6, &assigned_prefix, &assigned_buf); - r = dhcp6_pd_assign_prefix(link, &assigned_prefix, masked_pd_prefix, 64, + r = dhcp6_pd_assign_prefix(link, &assigned_prefix, masked_pd_prefix, lifetime_preferred, lifetime_valid); if (r < 0) { log_link_error_errno(link, r, "Unable to assign/update prefix %s/64: %m", |