From: Lennart Poettering Date: Mon, 11 Oct 2021 11:39:25 +0000 (+0200) Subject: network: use official bswap_32() rather than inofficial __bswap_32() X-Git-Tag: v250-rc1~533^2~4 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fe92eb795b4f380522cd2b2f75eb555f0c060306;p=thirdparty%2Fsystemd.git network: use official bswap_32() rather than inofficial __bswap_32() The former is a macro for the latter, but let's use the official API (the one that has an API). --- diff --git a/src/basic/sparse-endian.h b/src/basic/sparse-endian.h index 9583dda9e55..c795d3da8f2 100644 --- a/src/basic/sparse-endian.h +++ b/src/basic/sparse-endian.h @@ -55,9 +55,9 @@ typedef uint64_t __sd_bitwise be64_t; #undef le64toh #if __BYTE_ORDER == __LITTLE_ENDIAN -#define bswap_16_on_le(x) __bswap_16(x) -#define bswap_32_on_le(x) __bswap_32(x) -#define bswap_64_on_le(x) __bswap_64(x) +#define bswap_16_on_le(x) bswap_16(x) +#define bswap_32_on_le(x) bswap_32(x) +#define bswap_64_on_le(x) bswap_64(x) #define bswap_16_on_be(x) (x) #define bswap_32_on_be(x) (x) #define bswap_64_on_be(x) (x) @@ -65,9 +65,9 @@ typedef uint64_t __sd_bitwise be64_t; #define bswap_16_on_le(x) (x) #define bswap_32_on_le(x) (x) #define bswap_64_on_le(x) (x) -#define bswap_16_on_be(x) __bswap_16(x) -#define bswap_32_on_be(x) __bswap_32(x) -#define bswap_64_on_be(x) __bswap_64(x) +#define bswap_16_on_be(x) bswap_16(x) +#define bswap_32_on_be(x) bswap_32(x) +#define bswap_64_on_be(x) bswap_64(x) #endif static inline le16_t htole16(uint16_t value) { return (le16_t __sd_force) bswap_16_on_be(value); } diff --git a/src/libsystemd-network/dhcp-identifier.c b/src/libsystemd-network/dhcp-identifier.c index 3313e53f74c..23021f7bad8 100644 --- a/src/libsystemd-network/dhcp-identifier.c +++ b/src/libsystemd-network/dhcp-identifier.c @@ -207,7 +207,7 @@ int dhcp_identifier_set_iaid( if (legacy_unstable_byteorder) /* for historical reasons (a bug), the bits were swapped and thus * the result was endianness dependent. Preserve that behavior. */ - id32 = __bswap_32(id32); + id32 = bswap_32(id32); else /* the fixed behavior returns a stable byte order. Since LE is expected * to be more common, swap the bytes on LE to give the same as legacy diff --git a/src/libsystemd-network/test-dhcp-client.c b/src/libsystemd-network/test-dhcp-client.c index 10db7f6c4bc..4428e54bc78 100644 --- a/src/libsystemd-network/test-dhcp-client.c +++ b/src/libsystemd-network/test-dhcp-client.c @@ -158,7 +158,7 @@ static void test_dhcp_identifier_set_iaid(void) { #if __BYTE_ORDER == __LITTLE_ENDIAN assert_se(iaid == iaid_legacy); #else - assert_se(iaid == __bswap_32(iaid_legacy)); + assert_se(iaid == bswap_32(iaid_legacy)); #endif }