summaryrefslogtreecommitdiff
path: root/opentracker.c
diff options
context:
space:
mode:
authorerdgeist <>2009-01-15 16:20:47 +0000
committererdgeist <>2009-01-15 16:20:47 +0000
commit02b3abbab639625afdd02f0f0a9965fdf49f4996 (patch)
tree6869bfe2f17ecaa7dd288a5286c0b3fe88d509c6 /opentracker.c
parent930495a0dbd08b8e4b048c7258067444eb0d546b (diff)
Make v4 and v6 modes v4/v6-ONLY
Diffstat (limited to 'opentracker.c')
-rw-r--r--opentracker.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/opentracker.c b/opentracker.c
index 46456dd..91a1f79 100644
--- a/opentracker.c
+++ b/opentracker.c
@@ -238,6 +238,16 @@ static void server_mainloop( ) {
238static int64_t ot_try_bind( ot_ip6 ip, uint16_t port, PROTO_FLAG proto ) { 238static int64_t ot_try_bind( ot_ip6 ip, uint16_t port, PROTO_FLAG proto ) {
239 int64 s = proto == FLAG_TCP ? socket_tcp6( ) : socket_udp6( ); 239 int64 s = proto == FLAG_TCP ? socket_tcp6( ) : socket_udp6( );
240 240
241#ifndef WANT_V6
242 if( !ip6_isv4mapped(ip) ) {
243 exerr( "V4 Tracker is V4 only!" );
244 }
245#else
246 if( ip6_isv4mapped(ip) ) {
247 exerr( "V6 Tracker is V6 only!" );
248 }
249#endif
250
241#ifdef _DEBUG 251#ifdef _DEBUG
242 char *protos[] = {"TCP","UDP","UDP mcast"}; 252 char *protos[] = {"TCP","UDP","UDP mcast"};
243 char _debug[512]; 253 char _debug[512];
@@ -420,6 +430,9 @@ int main( int argc, char **argv ) {
420 uint16_t tmpport; 430 uint16_t tmpport;
421 431
422 memset( serverip, 0, sizeof(ot_ip6) ); 432 memset( serverip, 0, sizeof(ot_ip6) );
433#ifndef WANT_V6
434 serverip[10]=serverip[11]=0xff;
435#endif
423 436
424while( scanon ) { 437while( scanon ) {
425 switch( getopt( argc, argv, ":i:p:A:P:d:r:s:f:v" 438 switch( getopt( argc, argv, ":i:p:A:P:d:r:s:f:v"