From d61aefe2fc4d8549f459bdfc2749c9f163449ebc Mon Sep 17 00:00:00 2001 From: Dirk Engling Date: Sat, 24 Oct 2026 17:23:32 +0200 Subject: Replace libowfat's ip scanner and formatters with own own --- ot_http.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'ot_http.c') diff --git a/ot_http.c b/ot_http.c index 85bfcb6..dcf634f 100644 --- a/ot_http.c +++ b/ot_http.c @@ -16,13 +16,13 @@ /* Libowfat */ #include "iob.h" -#include "ip6.h" /* Opentracker */ #include "ot_accesslist.h" #include "ot_fullscrape.h" #include "ot_http.h" #include "ot_iovec.h" +#include "ot_ip.h" #include "ot_mutex.h" #include "ot_scan.h" #include "ot_stats.h" @@ -525,7 +525,7 @@ static ssize_t http_handle_announce(const int64 sock, struct ot_workstruct * if (accesslist_is_blessed(cookie->ip, OT_PERMISSION_MAY_PROXY)) { ot_ip6 proxied_ip; char *fwd = http_header(ws->request, ws->header_size, "x-forwarded-for"); - if (fwd && scan_ip6(fwd, proxied_ip)) { + if (fwd && ip_scan(fwd, proxied_ip)) { OT_SETIP(ws->peer, proxied_ip); } else OT_SETIP(ws->peer, cookie->ip); @@ -611,7 +611,7 @@ static ssize_t http_handle_announce(const int64 sock, struct ot_workstruct * char *tmp_buf1 = ws->reply, *tmp_buf2 = ws->reply + 16; len = scan_urlencoded_query(&read_ptr, tmp_buf2, SCAN_SEARCHPATH_VALUE); tmp_buf2[len] = 0; - if ((len <= 0) || !scan_ip6(tmp_buf2, tmp_buf1)) + if ((len <= 0) || !ip_scan(tmp_buf2, tmp_buf1)) HTTPERROR_400_PARAM; OT_SETIP(&ws->peer, tmp_buf1); } break; @@ -633,7 +633,7 @@ static ssize_t http_handle_announce(const int64 sock, struct ot_workstruct * loglist_reset(); return ws->reply_size = sprintf(ws->reply, "Successfully removed.\n"); } - parsed = scan_ip6(tmp_buf, net.address); + parsed = ip_scan(tmp_buf, net.address); if (!parsed) HTTPERROR_400_PARAM; if (tmp_buf[parsed++] != '/') @@ -643,7 +643,7 @@ static ssize_t http_handle_announce(const int64 sock, struct ot_workstruct * if (!parsed) HTTPERROR_400_PARAM; bits = (signed short)value; - if (ip6_isv4mapped(net.address)) + if (ip_is_v4mapped(net.address)) bits += 96; } net.bits = bits; -- cgit v1.3