diff options
author | Guillaume Solignac <gsoligna@cisco.com> | 2023-04-20 17:59:22 +0200 |
---|---|---|
committer | Damjan Marion <dmarion@0xa5.net> | 2024-05-13 14:57:50 +0000 |
commit | 9e45a5732bd38d703ad8f055c2c16ea519607cf9 (patch) | |
tree | f5c95837385bd2a676212104063809e4af2cd984 /src/plugins/wireguard/wireguard_noise.c | |
parent | 9d5fed08aed0567db210b394773051dc1dc8defa (diff) |
wireguard: use clib helpers for endianness
In some cases, the Linux helpers for endianness conversion are not
present. We use clib helpers to fix this.
Type: fix
Signed-off-by: Guillaume Solignac <gsoligna@cisco.com>
Change-Id: I4d21fb5edae6fa6413b10f298a84ff4b88bda5db
Signed-off-by: Pierre Pfister <ppfister@cisco.com>
Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
Diffstat (limited to 'src/plugins/wireguard/wireguard_noise.c')
-rw-r--r-- | src/plugins/wireguard/wireguard_noise.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/plugins/wireguard/wireguard_noise.c b/src/plugins/wireguard/wireguard_noise.c index 5fe2e44b03b..c3f28f442f5 100644 --- a/src/plugins/wireguard/wireguard_noise.c +++ b/src/plugins/wireguard/wireguard_noise.c @@ -751,8 +751,8 @@ noise_tai64n_now (uint8_t output[NOISE_TIMESTAMP_LEN]) unix_nanosec &= REJECT_INTERVAL_MASK; /* https://cr.yp.to/libtai/tai64.html */ - sec = htobe64 (0x400000000000000aULL + unix_sec); - nsec = htobe32 (unix_nanosec); + sec = clib_host_to_big_u64 (0x400000000000000aULL + unix_sec); + nsec = clib_host_to_big_u32 (unix_nanosec); /* memcpy to output buffer, assuming output could be unaligned. */ clib_memcpy (output, &sec, sizeof (sec)); |