diff options
author | Matthias Wachs <wachs@net.in.tum.de> | 2010-10-07 14:16:58 +0000 |
---|---|---|
committer | Matthias Wachs <wachs@net.in.tum.de> | 2010-10-07 14:16:58 +0000 |
commit | 667ecd3a8d88b6785d3488e61b1e3f80b36d5672 (patch) | |
tree | dc150ae476b0544261fe54637ac968b949f41d61 | |
parent | 5bb85241624abcab1e6d78d334ec25d282621d49 (diff) | |
download | gnunet-667ecd3a8d88b6785d3488e61b1e3f80b36d5672.tar.gz gnunet-667ecd3a8d88b6785d3488e61b1e3f80b36d5672.zip |
removed not needed check
-rw-r--r-- | src/transport/plugin_transport_http.c | 11 | ||||
-rw-r--r-- | src/transport/test_plugin_transport_http.c | 5 | ||||
-rw-r--r-- | src/transport/test_plugin_transport_https.c | 5 |
3 files changed, 3 insertions, 18 deletions
diff --git a/src/transport/plugin_transport_http.c b/src/transport/plugin_transport_http.c index 48ae22bc0..fbbd1ad76 100644 --- a/src/transport/plugin_transport_http.c +++ b/src/transport/plugin_transport_http.c | |||
@@ -2522,15 +2522,10 @@ http_plugin_address_suggested (void *cls, | |||
2522 | if (addrlen == sizeof (struct IPv4HttpAddress)) | 2522 | if (addrlen == sizeof (struct IPv4HttpAddress)) |
2523 | { | 2523 | { |
2524 | v4 = (struct IPv4HttpAddress *) addr; | 2524 | v4 = (struct IPv4HttpAddress *) addr; |
2525 | /* Not skipping loopback | ||
2526 | if (INADDR_LOOPBACK == ntohl(v4->ipv4_addr)) | ||
2527 | { | ||
2528 | return GNUNET_SYSERR; | ||
2529 | } */ | ||
2530 | 2525 | ||
2531 | if (plugin->bind4_address!=NULL) | 2526 | if (plugin->bind4_address!=NULL) |
2532 | { | 2527 | { |
2533 | if (0 == memcmp (&plugin->bind4_address->sin_addr, &v4->ipv4_addr, sizeof(uint32_t)) && (ntohs (v4->u_port) == plugin->port_inbound)) | 2528 | if (0 == memcmp (&plugin->bind4_address->sin_addr, &v4->ipv4_addr, sizeof(uint32_t))) |
2534 | return GNUNET_OK; | 2529 | return GNUNET_OK; |
2535 | else | 2530 | else |
2536 | return GNUNET_SYSERR; | 2531 | return GNUNET_SYSERR; |
@@ -2541,7 +2536,7 @@ http_plugin_address_suggested (void *cls, | |||
2541 | break; | 2536 | break; |
2542 | tv4 = tv4->next; | 2537 | tv4 = tv4->next; |
2543 | } | 2538 | } |
2544 | if ((tv4 !=NULL) && (ntohs (v4->u_port) == plugin->port_inbound)) | 2539 | if (tv4 != NULL) |
2545 | return GNUNET_OK; | 2540 | return GNUNET_OK; |
2546 | else | 2541 | else |
2547 | return GNUNET_SYSERR; | 2542 | return GNUNET_SYSERR; |
@@ -2564,7 +2559,7 @@ http_plugin_address_suggested (void *cls, | |||
2564 | break; | 2559 | break; |
2565 | tv6 = tv6->next; | 2560 | tv6 = tv6->next; |
2566 | } | 2561 | } |
2567 | if ((tv6 !=NULL) && (ntohs (v6->u6_port) == plugin->port_inbound)) | 2562 | if (tv6 !=NULL) |
2568 | return GNUNET_OK; | 2563 | return GNUNET_OK; |
2569 | else | 2564 | else |
2570 | return GNUNET_SYSERR; | 2565 | return GNUNET_SYSERR; |
diff --git a/src/transport/test_plugin_transport_http.c b/src/transport/test_plugin_transport_http.c index fea71b3d3..a178f16a0 100644 --- a/src/transport/test_plugin_transport_http.c +++ b/src/transport/test_plugin_transport_http.c | |||
@@ -1250,12 +1250,7 @@ run (void *cls, | |||
1250 | fail_pretty_printer=GNUNET_NO; | 1250 | fail_pretty_printer=GNUNET_NO; |
1251 | fail_addr_to_str=GNUNET_NO; | 1251 | fail_addr_to_str=GNUNET_NO; |
1252 | 1252 | ||
1253 | /* Suggesting addresses with wrong port*/ | ||
1254 | struct IPv4HttpAddress failing_addr; | 1253 | struct IPv4HttpAddress failing_addr; |
1255 | failing_addr.ipv4_addr = htonl(INADDR_LOOPBACK); | ||
1256 | failing_addr.u_port = htons(0); | ||
1257 | suggest_res = api->check_address (api->cls,&failing_addr,sizeof (struct IPv4HttpAddress)); | ||
1258 | GNUNET_assert (GNUNET_SYSERR == suggest_res); | ||
1259 | 1254 | ||
1260 | /* Suggesting addresses with wrong size*/ | 1255 | /* Suggesting addresses with wrong size*/ |
1261 | failing_addr.ipv4_addr = htonl(INADDR_LOOPBACK); | 1256 | failing_addr.ipv4_addr = htonl(INADDR_LOOPBACK); |
diff --git a/src/transport/test_plugin_transport_https.c b/src/transport/test_plugin_transport_https.c index 7eb60d46c..192ca764d 100644 --- a/src/transport/test_plugin_transport_https.c +++ b/src/transport/test_plugin_transport_https.c | |||
@@ -1315,12 +1315,7 @@ run (void *cls, | |||
1315 | fail_pretty_printer=GNUNET_NO; | 1315 | fail_pretty_printer=GNUNET_NO; |
1316 | fail_addr_to_str=GNUNET_NO; | 1316 | fail_addr_to_str=GNUNET_NO; |
1317 | 1317 | ||
1318 | /* Suggesting addresses with wrong port*/ | ||
1319 | struct IPv4HttpAddress failing_addr; | 1318 | struct IPv4HttpAddress failing_addr; |
1320 | failing_addr.ipv4_addr = htonl(INADDR_LOOPBACK); | ||
1321 | failing_addr.u_port = htons(0); | ||
1322 | suggest_res = api->check_address (api->cls,&failing_addr,sizeof (struct IPv4HttpAddress)); | ||
1323 | GNUNET_assert (GNUNET_SYSERR == suggest_res); | ||
1324 | 1319 | ||
1325 | /* Suggesting addresses with wrong size*/ | 1320 | /* Suggesting addresses with wrong size*/ |
1326 | failing_addr.ipv4_addr = htonl(INADDR_LOOPBACK); | 1321 | failing_addr.ipv4_addr = htonl(INADDR_LOOPBACK); |