diff options
author | David Timber <mieabby@gmail.com> | 2020-09-27 22:51:11 +0930 |
---|---|---|
committer | David Timber <mieabby@gmail.com> | 2020-09-27 22:51:11 +0930 |
commit | 86038b950f0aaddca7108e903568159414a8d64a (patch) | |
tree | 122ff054b79ac91dc615f2248674fa4944ccdb17 /src/protocol.c | |
parent | 9f948554902e67cd796dd0635a3c632ccd40c206 (diff) |
* Disable armv7, aarch64, x86_64 target
* Apply recon and bne to proone
* Add callback contexts on htbt and bne
* Fix mem leak in bne_sh_cleanup_upload()
* Use prne_static_assert() instead of _Static_assert()
* Use prne_free_worker() rather than calling free_ctx()
* Add prne_eq_ipaddr()
* bne
* Add prne_bne_result::ny_instance to impl infect_cnt
* Don't delete tmp upload dir after successful bne_sh_run_exec() so
that proone can make tmp files
* Silently ignore PRNE_BNE_V_HTBT if htbt_ssl_conf is not set
* Add prne_bne_get_subject()
* htbt
* Fix crash bug when running without resolv
* proone: set pth priority
Diffstat (limited to 'src/protocol.c')
-rw-r--r-- | src/protocol.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/protocol.c b/src/protocol.c index 6045f5f..510864d 100644 --- a/src/protocol.c +++ b/src/protocol.c @@ -59,6 +59,21 @@ bool prne_arch_inrange (const prne_arch_t x) { return PRNE_ARCH_NONE < x && x < NB_PRNE_ARCH; } +bool prne_eq_ipaddr (const prne_ip_addr_t *a, const prne_ip_addr_t *b) { + size_t l; + + if (a->ver != b->ver) { + return false; + } + switch (a->ver) { + case PRNE_IPV_4: l = 4; break; + case PRNE_IPV_6: l = 16; break; + default: l = 0; + } + + return memcmp(a->addr, b->addr, l) == 0; +} + void prne_net_ep_tosin4 (const prne_net_endpoint_t *ep, struct sockaddr_in *out) { memcpy(&out->sin_addr, ep->addr.addr, 4); out->sin_family = AF_INET; |