[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r7735 - in GNUnet: contrib src/transports
From: |
gnunet |
Subject: |
[GNUnet-SVN] r7735 - in GNUnet: contrib src/transports |
Date: |
Sun, 5 Oct 2008 00:09:18 -0600 (MDT) |
Author: grothoff
Date: 2008-10-05 00:09:18 -0600 (Sun, 05 Oct 2008)
New Revision: 7735
Modified:
GNUnet/contrib/config-daemon.scm
GNUnet/src/transports/common.c
GNUnet/src/transports/tcp.c
Log:
reject bogus v6 ads'
Modified: GNUnet/contrib/config-daemon.scm
===================================================================
--- GNUnet/contrib/config-daemon.scm 2008-10-05 05:47:10 UTC (rev 7734)
+++ GNUnet/contrib/config-daemon.scm 2008-10-05 06:09:18 UTC (rev 7735)
@@ -939,19 +939,19 @@
(define (tcp-blacklist builder)
(builder
"TCP"
- "BLACKLIST"
+ "BLACKLISTV4"
(_ "Which IP(v4)s are not allowed to connect?")
(nohelp)
'()
#t
- ""
+ "127.0.0.1;"
'()
'advanced))
(define (tcp-whitelist builder)
(builder
"TCP"
- "WHITELIST"
+ "WHITELISTV4"
(_ "Which IP(v4)s are allowed to connect? Leave empty to use the IP of your
primary network interface.")
(nohelp)
'()
@@ -1194,19 +1194,19 @@
(define (udp-blacklist builder)
(builder
"UDP"
- "BLACKLIST"
+ "BLACKLISTV4"
(_ "Which IPs are not allowed to connect?")
(nohelp)
'()
#t
- ""
+ "127.0.0.1;"
'()
'advanced))
(define (udp-whitelist builder)
(builder
"UDP"
- "WHITELIST"
+ "WHITELISTV4"
(_ "Which IPs are allowed to connect? Leave empty to allow connections from
any IP.")
(nohelp)
'()
Modified: GNUnet/src/transports/common.c
===================================================================
--- GNUnet/src/transports/common.c 2008-10-05 05:47:10 UTC (rev 7734)
+++ GNUnet/src/transports/common.c 2008-10-05 06:09:18 UTC (rev 7735)
@@ -258,7 +258,7 @@
GNUNET_free_non_null (allowedNetworksIPv4);
ch = NULL;
GNUNET_GC_get_configuration_value_string (cfg, MY_TRANSPORT_NAME,
- "BLACKLISTV4", "", &ch);
+ "BLACKLISTV4", "127.0.0.1;", &ch);
filteredNetworksIPv4 = GNUNET_parse_ipv4_network_specification (ectx, ch);
GNUNET_free (ch);
ch = NULL;
@@ -277,7 +277,7 @@
GNUNET_free_non_null (filteredNetworksIPv6);
GNUNET_free_non_null (allowedNetworksIPv6);
GNUNET_GC_get_configuration_value_string (cfg, MY_TRANSPORT_NAME,
- "BLACKLISTV6", "", &ch);
+ "BLACKLISTV6", "::1;", &ch);
filteredNetworksIPv6 =
GNUNET_parse_ipv6_network_specification (ectx, ch);
GNUNET_free (ch);
Modified: GNUnet/src/transports/tcp.c
===================================================================
--- GNUnet/src/transports/tcp.c 2008-10-05 05:47:10 UTC (rev 7734)
+++ GNUnet/src/transports/tcp.c 2008-10-05 06:09:18 UTC (rev 7735)
@@ -536,6 +536,7 @@
#if TCP_SYNCNT
static int zero = 0;
#endif
+ static struct in6_addr zero6;
const HostAddress *haddr;
int sock;
struct sockaddr_in soaddr4;
@@ -576,6 +577,11 @@
}
haddr = (const HostAddress *) &hello[1];
available = ntohs (haddr->availability) & available_protocols;
+ if ( (0 != (available & VERSION_AVAILABLE_IPV6)) &&
+ (0 == memcmp(&zero6,
+ &haddr->ipv6,
+ sizeof(zero6))) )
+ available -= VERSION_AVAILABLE_IPV6; /* invalid */
if (available == (VERSION_AVAILABLE_IPV4 | VERSION_AVAILABLE_IPV6))
{
if (GNUNET_random_u32 (GNUNET_RANDOM_QUALITY_WEAK, 2) == 0)
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r7735 - in GNUnet: contrib src/transports,
gnunet <=