mirror of
https://git.kernel.org/pub/scm/network/wireless/iwd.git
synced 2024-11-25 09:39:25 +01:00
netconfig: Don't bswap IP netmasks for __builtin_popcountl
The __builtin_popcountl() value shouldn't change with the endianness.
This commit is contained in:
parent
159afd7f18
commit
e1393501e7
@ -152,7 +152,7 @@ static struct netconfig_ifaddr *netconfig_ipv4_get_ifaddr(
|
||||
|
||||
if (netmask && inet_pton(AF_INET, netmask, &in_addr) > 0)
|
||||
ifaddr->prefix_len = __builtin_popcountl(
|
||||
L_BE32_TO_CPU(in_addr.s_addr));
|
||||
in_addr.s_addr);
|
||||
else
|
||||
ifaddr->prefix_len = 24;
|
||||
|
||||
@ -187,7 +187,7 @@ static struct netconfig_ifaddr *netconfig_ipv4_get_ifaddr(
|
||||
|
||||
if (netmask && inet_pton(AF_INET, netmask, &in_addr) > 0)
|
||||
ifaddr->prefix_len = __builtin_popcountl(
|
||||
L_BE32_TO_CPU(in_addr.s_addr));
|
||||
in_addr.s_addr);
|
||||
else
|
||||
ifaddr->prefix_len = 24;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user