summaryrefslogtreecommitdiff
path: root/ot_http.c
diff options
context:
space:
mode:
Diffstat (limited to 'ot_http.c')
-rw-r--r--ot_http.c10
1 files changed, 5 insertions, 5 deletions
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 @@
16 16
17/* Libowfat */ 17/* Libowfat */
18#include "iob.h" 18#include "iob.h"
19#include "ip6.h"
20 19
21/* Opentracker */ 20/* Opentracker */
22#include "ot_accesslist.h" 21#include "ot_accesslist.h"
23#include "ot_fullscrape.h" 22#include "ot_fullscrape.h"
24#include "ot_http.h" 23#include "ot_http.h"
25#include "ot_iovec.h" 24#include "ot_iovec.h"
25#include "ot_ip.h"
26#include "ot_mutex.h" 26#include "ot_mutex.h"
27#include "ot_scan.h" 27#include "ot_scan.h"
28#include "ot_stats.h" 28#include "ot_stats.h"
@@ -525,7 +525,7 @@ static ssize_t http_handle_announce(const int64 sock, struct ot_workstruct *
525 if (accesslist_is_blessed(cookie->ip, OT_PERMISSION_MAY_PROXY)) { 525 if (accesslist_is_blessed(cookie->ip, OT_PERMISSION_MAY_PROXY)) {
526 ot_ip6 proxied_ip; 526 ot_ip6 proxied_ip;
527 char *fwd = http_header(ws->request, ws->header_size, "x-forwarded-for"); 527 char *fwd = http_header(ws->request, ws->header_size, "x-forwarded-for");
528 if (fwd && scan_ip6(fwd, proxied_ip)) { 528 if (fwd && ip_scan(fwd, proxied_ip)) {
529 OT_SETIP(ws->peer, proxied_ip); 529 OT_SETIP(ws->peer, proxied_ip);
530 } else 530 } else
531 OT_SETIP(ws->peer, cookie->ip); 531 OT_SETIP(ws->peer, cookie->ip);
@@ -611,7 +611,7 @@ static ssize_t http_handle_announce(const int64 sock, struct ot_workstruct *
611 char *tmp_buf1 = ws->reply, *tmp_buf2 = ws->reply + 16; 611 char *tmp_buf1 = ws->reply, *tmp_buf2 = ws->reply + 16;
612 len = scan_urlencoded_query(&read_ptr, tmp_buf2, SCAN_SEARCHPATH_VALUE); 612 len = scan_urlencoded_query(&read_ptr, tmp_buf2, SCAN_SEARCHPATH_VALUE);
613 tmp_buf2[len] = 0; 613 tmp_buf2[len] = 0;
614 if ((len <= 0) || !scan_ip6(tmp_buf2, tmp_buf1)) 614 if ((len <= 0) || !ip_scan(tmp_buf2, tmp_buf1))
615 HTTPERROR_400_PARAM; 615 HTTPERROR_400_PARAM;
616 OT_SETIP(&ws->peer, tmp_buf1); 616 OT_SETIP(&ws->peer, tmp_buf1);
617 } break; 617 } break;
@@ -633,7 +633,7 @@ static ssize_t http_handle_announce(const int64 sock, struct ot_workstruct *
633 loglist_reset(); 633 loglist_reset();
634 return ws->reply_size = sprintf(ws->reply, "Successfully removed.\n"); 634 return ws->reply_size = sprintf(ws->reply, "Successfully removed.\n");
635 } 635 }
636 parsed = scan_ip6(tmp_buf, net.address); 636 parsed = ip_scan(tmp_buf, net.address);
637 if (!parsed) 637 if (!parsed)
638 HTTPERROR_400_PARAM; 638 HTTPERROR_400_PARAM;
639 if (tmp_buf[parsed++] != '/') 639 if (tmp_buf[parsed++] != '/')
@@ -643,7 +643,7 @@ static ssize_t http_handle_announce(const int64 sock, struct ot_workstruct *
643 if (!parsed) 643 if (!parsed)
644 HTTPERROR_400_PARAM; 644 HTTPERROR_400_PARAM;
645 bits = (signed short)value; 645 bits = (signed short)value;
646 if (ip6_isv4mapped(net.address)) 646 if (ip_is_v4mapped(net.address))
647 bits += 96; 647 bits += 96;
648 } 648 }
649 net.bits = bits; 649 net.bits = bits;