diff options
author | Vladislav Grishenko <themiron@mail.ru> | 2020-09-06 03:09:01 +0500 |
---|---|---|
committer | Vladislav Grishenko <themiron@mail.ru> | 2020-09-06 03:09:01 +0500 |
commit | 3dc35ad353017d12049a70d1b3c2c90f0aaade43 (patch) | |
tree | 69be547a95dd4822c0918de7b4d4bcb55dab5c32 /accel-pppd | |
parent | 2324bcd5ba12cf28f47357a8f03cd41b7c04c52b (diff) | |
download | accel-ppp-3dc35ad353017d12049a70d1b3c2c90f0aaade43.tar.gz accel-ppp-3dc35ad353017d12049a70d1b3c2c90f0aaade43.zip |
auth/chap-secrets/dhcpv4: fix big-endian arch support
Diffstat (limited to 'accel-pppd')
-rw-r--r-- | accel-pppd/auth/auth_mschap_v1.c | 2 | ||||
-rw-r--r-- | accel-pppd/auth/auth_mschap_v2.c | 2 | ||||
-rw-r--r-- | accel-pppd/ctrl/ipoe/dhcpv4.c | 2 | ||||
-rw-r--r-- | accel-pppd/extra/chap-secrets.c | 2 |
4 files changed, 4 insertions, 4 deletions
diff --git a/accel-pppd/auth/auth_mschap_v1.c b/accel-pppd/auth/auth_mschap_v1.c index d00e1a7f..a55082e4 100644 --- a/accel-pppd/auth/auth_mschap_v1.c +++ b/accel-pppd/auth/auth_mschap_v1.c @@ -406,7 +406,7 @@ static void des_encrypt(const uint8_t *input, const uint8_t *key, uint8_t *outpu DES_key_schedule ks; memcpy(p_key.buf, key, 7); - p_key.u64 = bswap_64(p_key.u64); + p_key.u64 = be64toh(p_key.u64); for (i = 0; i < 8; i++) { cb[i] = (((p_key.u64 << (7 * i)) >> 56) & 0xfe); diff --git a/accel-pppd/auth/auth_mschap_v2.c b/accel-pppd/auth/auth_mschap_v2.c index 1c8e4443..635cb28f 100644 --- a/accel-pppd/auth/auth_mschap_v2.c +++ b/accel-pppd/auth/auth_mschap_v2.c @@ -488,7 +488,7 @@ static void des_encrypt(const uint8_t *input, const uint8_t *key, uint8_t *outpu DES_key_schedule ks; memcpy(p_key.buf,key,7); - p_key.u64=bswap_64(p_key.u64); + p_key.u64 = be64toh(p_key.u64); for(i=0;i<8;i++) { diff --git a/accel-pppd/ctrl/ipoe/dhcpv4.c b/accel-pppd/ctrl/ipoe/dhcpv4.c index cdb21a9d..8f536caf 100644 --- a/accel-pppd/ctrl/ipoe/dhcpv4.c +++ b/accel-pppd/ctrl/ipoe/dhcpv4.c @@ -574,7 +574,7 @@ static uint16_t ip_csum(uint16_t *buf, int len) sum += *buf++; if (len & 1) { -#ifdef __LITTLE_ENDIAN +#if __BYTE_ORDER == __LITTLE_ENDIAN sum += *(uint8_t *)buf; #else sum += *(uint8_t *)buf << 8; diff --git a/accel-pppd/extra/chap-secrets.c b/accel-pppd/extra/chap-secrets.c index 0fadc9cb..849ceef1 100644 --- a/accel-pppd/extra/chap-secrets.c +++ b/accel-pppd/extra/chap-secrets.c @@ -363,7 +363,7 @@ static void des_encrypt(const uint8_t *input, const uint8_t *key, uint8_t *outpu DES_key_schedule ks; memcpy(p_key.buf, key, 7); - p_key.u64 = bswap_64(p_key.u64); + p_key.u64 = be64toh(p_key.u64); for (i = 0; i < 8; i++) { cb[i] = (((p_key.u64 << (7 * i)) >> 56) & 0xfe); |