From 2afc4893bf802700a1decfff57673cefc861c7e7 Mon Sep 17 00:00:00 2001 From: Dirk Engling Date: Wed, 3 Apr 2024 22:25:30 +0200 Subject: Prepare opentracker for dual stack capabilities --- ot_http.c | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) (limited to 'ot_http.c') diff --git a/ot_http.c b/ot_http.c index 88b4261..374d6d8 100644 --- a/ot_http.c +++ b/ot_http.c @@ -421,26 +421,18 @@ static ssize_t http_handle_announce( const int64 sock, struct ot_workstruct *ws, ot_ip6 proxied_ip; char *fwd = http_header( ws->request, ws->header_size, "x-forwarded-for" ); if( fwd && scan_ip6( fwd, proxied_ip ) ) { - /* If proxy reports an ipv6 address but we can only handle v4 (or vice versa), bail out */ -#ifndef WANT_V6 - if( !ip6_isv4mapped(proxied_ip) ) -#else - if( ip6_isv4mapped(proxied_ip) ) -#endif - HTTPERROR_400_PARAM; - - OT_SETIP( &ws->peer, proxied_ip ); + OT_SETIP( ws->peer, proxied_ip ); } else - OT_SETIP( &ws->peer, cookie->ip ); + OT_SETIP( ws->peer, cookie->ip ); } else #endif - OT_SETIP( &ws->peer, cookie->ip ); + OT_SETIP( ws->peer, cookie->ip ); ws->peer_id = NULL; ws->hash = NULL; - OT_SETPORT( &ws->peer, &port ); - OT_PEERFLAG( &ws->peer ) = 0; + OT_SETPORT( ws->peer, &port ); + OT_PEERFLAG( ws->peer ) = 0; numwant = 50; scanon = 1; -- cgit v1.2.3