diff options
-rw-r--r-- | src/integration-tests/confs/test_defaults.conf | 1 | ||||
-rw-r--r-- | src/transport/plugin_transport_udp.c | 8 | ||||
-rw-r--r-- | src/transport/plugin_transport_udp.h | 5 | ||||
-rw-r--r-- | src/transport/test_transport_defaults.conf | 5 | ||||
-rw-r--r-- | src/transport/transport.conf.in | 1 |
5 files changed, 19 insertions, 1 deletions
diff --git a/src/integration-tests/confs/test_defaults.conf b/src/integration-tests/confs/test_defaults.conf index 4477b296e..f20bfd3f8 100644 --- a/src/integration-tests/confs/test_defaults.conf +++ b/src/integration-tests/confs/test_defaults.conf | |||
@@ -9,6 +9,7 @@ USE_LOCALADDR = YES | |||
9 | 9 | ||
10 | [transport-udp] | 10 | [transport-udp] |
11 | BROADCAST = NO | 11 | BROADCAST = NO |
12 | BROADCAST_RECEIVE = no | ||
12 | USE_LOCALADDR = YES | 13 | USE_LOCALADDR = YES |
13 | 14 | ||
14 | [nat] | 15 | [nat] |
diff --git a/src/transport/plugin_transport_udp.c b/src/transport/plugin_transport_udp.c index a5ee6494a..d3a8d1017 100644 --- a/src/transport/plugin_transport_udp.c +++ b/src/transport/plugin_transport_udp.c | |||
@@ -2515,6 +2515,7 @@ udp_select_read (struct Plugin *plugin, struct GNUNET_NETWORK_Handle *rsock) | |||
2515 | switch (ntohs (msg->type)) | 2515 | switch (ntohs (msg->type)) |
2516 | { | 2516 | { |
2517 | case GNUNET_MESSAGE_TYPE_TRANSPORT_BROADCAST_BEACON: | 2517 | case GNUNET_MESSAGE_TYPE_TRANSPORT_BROADCAST_BEACON: |
2518 | if (GNUNET_YES == plugin->enable_broadcasting_receiving) | ||
2518 | udp_broadcast_receive (plugin, buf, size, | 2519 | udp_broadcast_receive (plugin, buf, size, |
2519 | (const struct sockaddr *) &addr, fromlen); | 2520 | (const struct sockaddr *) &addr, fromlen); |
2520 | return; | 2521 | return; |
@@ -3049,6 +3050,7 @@ libgnunet_plugin_transport_udp_init (void *cls) | |||
3049 | unsigned long long udp_max_bps; | 3050 | unsigned long long udp_max_bps; |
3050 | unsigned long long enable_v6; | 3051 | unsigned long long enable_v6; |
3051 | unsigned long long enable_broadcasting; | 3052 | unsigned long long enable_broadcasting; |
3053 | unsigned long long enable_broadcasting_recv; | ||
3052 | char * bind4_address; | 3054 | char * bind4_address; |
3053 | char * bind6_address; | 3055 | char * bind6_address; |
3054 | char * fancy_interval; | 3056 | char * fancy_interval; |
@@ -3147,6 +3149,11 @@ libgnunet_plugin_transport_udp_init (void *cls) | |||
3147 | if (enable_broadcasting == GNUNET_SYSERR) | 3149 | if (enable_broadcasting == GNUNET_SYSERR) |
3148 | enable_broadcasting = GNUNET_NO; | 3150 | enable_broadcasting = GNUNET_NO; |
3149 | 3151 | ||
3152 | enable_broadcasting_recv = GNUNET_CONFIGURATION_get_value_yesno (env->cfg, "transport-udp", | ||
3153 | "BROADCAST_RECEIVE"); | ||
3154 | if (enable_broadcasting_recv == GNUNET_SYSERR) | ||
3155 | enable_broadcasting_recv = GNUNET_YES; | ||
3156 | |||
3150 | if (GNUNET_SYSERR == GNUNET_CONFIGURATION_get_value_string (env->cfg, "transport-udp", | 3157 | if (GNUNET_SYSERR == GNUNET_CONFIGURATION_get_value_string (env->cfg, "transport-udp", |
3151 | "BROADCAST_INTERVAL", &fancy_interval)) | 3158 | "BROADCAST_INTERVAL", &fancy_interval)) |
3152 | { | 3159 | { |
@@ -3175,6 +3182,7 @@ libgnunet_plugin_transport_udp_init (void *cls) | |||
3175 | p->enable_ipv6 = enable_v6; | 3182 | p->enable_ipv6 = enable_v6; |
3176 | p->enable_ipv4 = GNUNET_YES; /* default */ | 3183 | p->enable_ipv4 = GNUNET_YES; /* default */ |
3177 | p->enable_broadcasting = enable_broadcasting; | 3184 | p->enable_broadcasting = enable_broadcasting; |
3185 | p->enable_broadcasting_receiving = enable_broadcasting_recv; | ||
3178 | p->env = env; | 3186 | p->env = env; |
3179 | p->sessions = GNUNET_CONTAINER_multipeermap_create (10, GNUNET_NO); | 3187 | p->sessions = GNUNET_CONTAINER_multipeermap_create (10, GNUNET_NO); |
3180 | p->defrag_ctxs = GNUNET_CONTAINER_heap_create (GNUNET_CONTAINER_HEAP_ORDER_MIN); | 3188 | p->defrag_ctxs = GNUNET_CONTAINER_heap_create (GNUNET_CONTAINER_HEAP_ORDER_MIN); |
diff --git a/src/transport/plugin_transport_udp.h b/src/transport/plugin_transport_udp.h index 2873266b5..8f78ed4bc 100644 --- a/src/transport/plugin_transport_udp.h +++ b/src/transport/plugin_transport_udp.h | |||
@@ -254,6 +254,11 @@ struct Plugin | |||
254 | int enable_broadcasting; | 254 | int enable_broadcasting; |
255 | 255 | ||
256 | /** | 256 | /** |
257 | * Is receiving broadcasts enabled: GNUNET_YES or GNUNET_NO | ||
258 | */ | ||
259 | int enable_broadcasting_receiving; | ||
260 | |||
261 | /** | ||
257 | * Port we broadcasting on. | 262 | * Port we broadcasting on. |
258 | */ | 263 | */ |
259 | uint16_t broadcast_port; | 264 | uint16_t broadcast_port; |
diff --git a/src/transport/test_transport_defaults.conf b/src/transport/test_transport_defaults.conf index 10c6d8ba3..314613226 100644 --- a/src/transport/test_transport_defaults.conf +++ b/src/transport/test_transport_defaults.conf | |||
@@ -8,7 +8,7 @@ TIMEOUT = 300 s | |||
8 | DEFAULTSERVICES = | 8 | DEFAULTSERVICES = |
9 | 9 | ||
10 | [transport] | 10 | [transport] |
11 | # PREFIX = valgrind | 11 | #PREFIX = valgrind -v --gen-suppressions=yes |
12 | 12 | ||
13 | [core] | 13 | [core] |
14 | AUTOSTART = NO | 14 | AUTOSTART = NO |
@@ -54,3 +54,6 @@ EXTERNAL_ADDRESS = 127.0.0.1 | |||
54 | 54 | ||
55 | [TESTING] | 55 | [TESTING] |
56 | WEAKRANDOM = YES | 56 | WEAKRANDOM = YES |
57 | |||
58 | [transport-udp] | ||
59 | BROADCAST_RECEIVE = no \ No newline at end of file | ||
diff --git a/src/transport/transport.conf.in b/src/transport/transport.conf.in index 0464ba841..575f4dc20 100644 --- a/src/transport/transport.conf.in +++ b/src/transport/transport.conf.in | |||
@@ -56,6 +56,7 @@ MAX_CONNECTIONS = 128 | |||
56 | # Use PORT = 0 to autodetect a port available | 56 | # Use PORT = 0 to autodetect a port available |
57 | PORT = 2086 | 57 | PORT = 2086 |
58 | BROADCAST = YES | 58 | BROADCAST = YES |
59 | BROADCAST_RECEIVE = YES | ||
59 | BROADCAST_INTERVAL = 30 s | 60 | BROADCAST_INTERVAL = 30 s |
60 | MAX_BPS = 1000000 | 61 | MAX_BPS = 1000000 |
61 | TESTING_IGNORE_KEYS = ACCEPT_FROM; | 62 | TESTING_IGNORE_KEYS = ACCEPT_FROM; |