mirror of
https://github.com/shadowsocks/shadowsocks-libev.git
synced 2026-10-28 11:43:50 +00:00
Fix typos for endian
This commit is contained in:
+2
-2
@@ -505,7 +505,7 @@ aead_chunk_encrypt(cipher_ctx_t *ctx, uint8_t *p, uint8_t *c, uint8_t *n,
|
||||
int err;
|
||||
size_t clen;
|
||||
uint8_t len_buf[CHUNK_SIZE_LEN];
|
||||
uint16_t t = ntohs((plen + tlen) & CHUNK_SIZE_MASK);
|
||||
uint16_t t = htons((plen + tlen) & CHUNK_SIZE_MASK);
|
||||
memcpy(len_buf, &t, CHUNK_SIZE_LEN);
|
||||
|
||||
clen = CHUNK_SIZE_LEN + tlen;
|
||||
@@ -599,7 +599,7 @@ aead_chunk_decrypt(cipher_ctx_t *ctx, uint8_t *p, uint8_t *c, uint8_t *n,
|
||||
return CRYPTO_ERROR;
|
||||
assert(*plen == CHUNK_SIZE_LEN);
|
||||
|
||||
mlen = htons(*(uint16_t *)len_buf);
|
||||
mlen = ntohs(*(uint16_t *)len_buf);
|
||||
mlen = mlen & CHUNK_SIZE_MASK;
|
||||
|
||||
size_t chunk_len = tlen + CHUNK_SIZE_LEN + mlen;
|
||||
|
||||
+5
-1
@@ -1627,7 +1627,11 @@ main(int argc, char **argv)
|
||||
struct ev_loop *loop = EV_DEFAULT;
|
||||
|
||||
// setup udns
|
||||
resolv_init(loop, nameservers, nameserver_num, ipv6first);
|
||||
if (nameserver_num == 0) {
|
||||
resolv_init(loop, NULL, 0, ipv6first);
|
||||
} else {
|
||||
resolv_init(loop, nameservers, nameserver_num, ipv6first);
|
||||
}
|
||||
|
||||
for (int i = 0; i < nameserver_num; i++)
|
||||
LOGI("using nameserver: %s", nameservers[i]);
|
||||
|
||||
Reference in New Issue
Block a user