From 959e0912a16678f996a3fb6ca4bceb2efff4b1ce Mon Sep 17 00:00:00 2001 From: Dirk Engling Date: Wed, 3 Apr 2024 23:08:17 +0200 Subject: Bind dual stack by default --- Makefile | 3 +-- opentracker.c | 3 +-- ot_stats.c | 19 ++++++++++--------- proxy.c | 1 - 4 files changed, 12 insertions(+), 14 deletions(-) diff --git a/Makefile b/Makefile index e3301a5..fcae353 100644 --- a/Makefile +++ b/Makefile @@ -20,8 +20,7 @@ LIBOWFAT_LIBRARY=$(PREFIX)/libowfat BINDIR?=$(PREFIX)/bin STRIP?=strip -#FEATURES+=-DWANT_V6 - +#FEATURES+=-DWAND_V4_ONLY #FEATURES+=-DWANT_ACCESSLIST_BLACK #FEATURES+=-DWANT_ACCESSLIST_WHITE #FEATURES+=-DWANT_DYNAMIC_ACCESSLIST diff --git a/opentracker.c b/opentracker.c index 78cafc3..9f99363 100644 --- a/opentracker.c +++ b/opentracker.c @@ -613,9 +613,8 @@ int main( int argc, char **argv ) { char * statefile = 0; memset( serverip, 0, sizeof(ot_ip6) ); -#ifndef WANT_V6 +#ifdef WANT_V4_ONLY serverip[10]=serverip[11]=-1; - noipv6=1; #endif #ifdef WANT_DEV_RANDOM diff --git a/ot_stats.c b/ot_stats.c index b3cc48a..2d45346 100644 --- a/ot_stats.c +++ b/ot_stats.c @@ -73,13 +73,13 @@ static time_t ot_start_time; #define __LDR(P,D) ((__BYTE((P),(D))>>__SHFT((D)))&__MSK) #define __STR(P,D,V) __BYTE((P),(D))=(__BYTE((P),(D))&~(__MSK<<__SHFT((D))))|((V)<<__SHFT((D))) -//#ifdef WANT_V6 -//#define STATS_NETWORK_NODE_MAXDEPTH (68-STATS_NETWORK_NODE_BITWIDTH) -//#define STATS_NETWORK_NODE_LIMIT (48-STATS_NETWORK_NODE_BITWIDTH) -//#else +#if 0 +// XXX +#define STATS_NETWORK_NODE_MAXDEPTH (68-STATS_NETWORK_NODE_BITWIDTH) +#define STATS_NETWORK_NODE_LIMIT (48-STATS_NETWORK_NODE_BITWIDTH) +#endif #define STATS_NETWORK_NODE_MAXDEPTH (28-STATS_NETWORK_NODE_BITWIDTH) #define STATS_NETWORK_NODE_LIMIT (24-STATS_NETWORK_NODE_BITWIDTH) -//#endif typedef union stats_network_node stats_network_node; union stats_network_node { @@ -202,9 +202,10 @@ static size_t stats_return_busy_networks( char * reply, stats_network_node *tree for( i=amount-1; i>=0; --i) { if( scores[i] ) { r += sprintf( r, "%08zd: ", scores[i] ); -#ifdef WANT_V6 +//#ifdef WANT_V6 r += fmt_ip6c( r, networks[i] ); -#else +#if 0 + // XXX r += fmt_ip4( r, networks[i]); #endif *r++ = '\n'; @@ -675,9 +676,9 @@ void stats_issue_event( ot_status_event event, PROTO_FLAG proto, uintptr_t event *peerid_hex=0; } -#ifdef WANT_V6 ip_readable[ fmt_ip6c( ip_readable, (char*)&ws->peer ) ] = 0; -#else +#if 0 + /* XXX */ ip_readable[ fmt_ip4( ip_readable, (char*)&ws->peer ) ] = 0; #endif syslog( LOG_INFO, "time=%s event=completed info_hash=%s peer_id=%s ip=%s", timestring, hash_hex, peerid_hex, ip_readable ); diff --git a/proxy.c b/proxy.c index 619b08a..0270073 100644 --- a/proxy.c +++ b/proxy.c @@ -558,7 +558,6 @@ int main( int argc, char **argv ) { #else g_tracker_id = random(); #endif - noipv6=1; while( scanon ) { switch( getopt( argc, argv, ":l:c:L:h" ) ) { -- cgit v1.2.3