summaryrefslogtreecommitdiff
path: root/proxy.c
diff options
context:
space:
mode:
Diffstat (limited to 'proxy.c')
-rw-r--r--proxy.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/proxy.c b/proxy.c
index ec51630..19a084a 100644
--- a/proxy.c
+++ b/proxy.c
@@ -20,11 +20,11 @@
20#include "io.h" 20#include "io.h"
21#include "iob.h" 21#include "iob.h"
22#include "ip6.h" 22#include "ip6.h"
23#include "scan.h"
24#include "socket.h" 23#include "socket.h"
25 24
26/* Opentracker */ 25/* Opentracker */
27#include "ot_mutex.h" 26#include "ot_mutex.h"
27#include "ot_scan.h"
28#include "ot_random.h" 28#include "ot_random.h"
29#include "ot_stats.h" 29#include "ot_stats.h"
30#include "ot_vector.h" 30#include "ot_vector.h"
@@ -531,8 +531,9 @@ static int64_t ot_try_bind(ot_ip6 ip, uint16_t port) {
531 return sock; 531 return sock;
532} 532}
533 533
534static int scan_ip6_port(const char *src, ot_ip6 ip, uint16 *port) { 534static int scan_ip6_port(const char *src, ot_ip6 ip, uint16_t *port) {
535 const char *s = src; 535 const char *s = src;
536 uint64_t value;
536 int off, bracket = 0; 537 int off, bracket = 0;
537 while (isspace(*s)) 538 while (isspace(*s))
538 ++s; 539 ++s;
@@ -553,8 +554,9 @@ static int scan_ip6_port(const char *src, ot_ip6 ip, uint16 *port) {
553 if (*(s++) != ':') 554 if (*(s++) != ':')
554 return 0; 555 return 0;
555 } 556 }
556 if (!(off = scan_ushort(s, port))) 557 if (!(off = scan_udec(s, &value, 65535)))
557 return 0; 558 return 0;
559 *port = (uint16_t)value;
558 return off + s - src; 560 return off + s - src;
559} 561}
560 562