commit e1393501e79a254fbeb11d6de6ca83c3bf0e6940
parent 159afd7f18e16cbaa0e682bd8a66efdd5366a679
Author: Andrew Zaborowski <andrew.zaborowski@intel.com>
Date: Mon, 14 Sep 2020 15:51:18 +0200
netconfig: Don't bswap IP netmasks for __builtin_popcountl
The __builtin_popcountl() value shouldn't change with the endianness.
Diffstat:
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/netconfig.c b/src/netconfig.c
@@ -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;