3
0
mirror of https://git.kernel.org/pub/scm/network/wireless/iwd.git synced 2024-11-25 17:59: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:
Andrew Zaborowski 2020-09-14 15:51:18 +02:00 committed by Denis Kenzior
parent 159afd7f18
commit e1393501e7

View File

@ -152,7 +152,7 @@ static struct netconfig_ifaddr *netconfig_ipv4_get_ifaddr(
if (netmask && inet_pton(AF_INET, netmask, &in_addr) > 0) if (netmask && inet_pton(AF_INET, netmask, &in_addr) > 0)
ifaddr->prefix_len = __builtin_popcountl( ifaddr->prefix_len = __builtin_popcountl(
L_BE32_TO_CPU(in_addr.s_addr)); in_addr.s_addr);
else else
ifaddr->prefix_len = 24; 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) if (netmask && inet_pton(AF_INET, netmask, &in_addr) > 0)
ifaddr->prefix_len = __builtin_popcountl( ifaddr->prefix_len = __builtin_popcountl(
L_BE32_TO_CPU(in_addr.s_addr)); in_addr.s_addr);
else else
ifaddr->prefix_len = 24; ifaddr->prefix_len = 24;