mirror of
https://git.kernel.org/pub/scm/network/wireless/iwd.git
synced 2025-01-03 10:32:33 +01:00
ap: Use l_dhcp_lease_get_prefix_length
This commit is contained in:
parent
219e18323f
commit
6b71a71e19
6
src/ap.c
6
src/ap.c
@ -1467,8 +1467,6 @@ static uint32_t ap_assoc_resp(struct ap_state *ap, struct sta_state *sta,
|
|||||||
if (ip_req_info->ipv4 && sta && ap_sta_get_dhcp4_lease(sta)) {
|
if (ip_req_info->ipv4 && sta && ap_sta_get_dhcp4_lease(sta)) {
|
||||||
L_AUTO_FREE_VAR(char *, lease_addr_str) =
|
L_AUTO_FREE_VAR(char *, lease_addr_str) =
|
||||||
l_dhcp_lease_get_address(sta->ip_alloc_lease);
|
l_dhcp_lease_get_address(sta->ip_alloc_lease);
|
||||||
L_AUTO_FREE_VAR(char *, lease_netmask_str) =
|
|
||||||
l_dhcp_lease_get_netmask(sta->ip_alloc_lease);
|
|
||||||
uint32_t lease_lifetime =
|
uint32_t lease_lifetime =
|
||||||
l_dhcp_lease_get_lifetime(sta->ip_alloc_lease);
|
l_dhcp_lease_get_lifetime(sta->ip_alloc_lease);
|
||||||
L_AUTO_FREE_VAR(char *, lease_gateway_str) =
|
L_AUTO_FREE_VAR(char *, lease_gateway_str) =
|
||||||
@ -1478,8 +1476,8 @@ static uint32_t ap_assoc_resp(struct ap_state *ap, struct sta_state *sta,
|
|||||||
|
|
||||||
ip_resp_info.ipv4_addr = IP4_FROM_STR(lease_addr_str);
|
ip_resp_info.ipv4_addr = IP4_FROM_STR(lease_addr_str);
|
||||||
ip_resp_info.ipv4_prefix_len =
|
ip_resp_info.ipv4_prefix_len =
|
||||||
__builtin_popcount(IP4_FROM_STR(
|
l_dhcp_lease_get_prefix_length(
|
||||||
lease_netmask_str));
|
sta->ip_alloc_lease);
|
||||||
|
|
||||||
if (lease_lifetime != 0xffffffff)
|
if (lease_lifetime != 0xffffffff)
|
||||||
ip_resp_info.ipv4_lifetime = lease_lifetime;
|
ip_resp_info.ipv4_lifetime = lease_lifetime;
|
||||||
|
Loading…
Reference in New Issue
Block a user