diff options
author | Schanzenbach, Martin <martin.schanzenbach@aisec.fraunhofer.de> | 2018-01-05 20:23:14 +0100 |
---|---|---|
committer | Schanzenbach, Martin <martin.schanzenbach@aisec.fraunhofer.de> | 2018-01-05 20:23:14 +0100 |
commit | e2343119b99559b78a2ba727b2c07240c18476ac (patch) | |
tree | 881771459e31937171b1ba7c9261bb393aed4047 /src/transport | |
parent | ec9269fd94cda7b2195dcbe754eda053288478b7 (diff) | |
parent | 70017fcfb707104555107e07df5dffd1508ca7fe (diff) | |
download | gnunet-e2343119b99559b78a2ba727b2c07240c18476ac.tar.gz gnunet-e2343119b99559b78a2ba727b2c07240c18476ac.zip |
Merge branch 'master' of git+ssh://gnunet.org/gnunet
Diffstat (limited to 'src/transport')
-rw-r--r-- | src/transport/gnunet-service-transport_neighbours.c | 47 | ||||
-rw-r--r-- | src/transport/plugin_transport_udp.c | 6 |
2 files changed, 41 insertions, 12 deletions
diff --git a/src/transport/gnunet-service-transport_neighbours.c b/src/transport/gnunet-service-transport_neighbours.c index ac72a667c..8d3e47f94 100644 --- a/src/transport/gnunet-service-transport_neighbours.c +++ b/src/transport/gnunet-service-transport_neighbours.c | |||
@@ -616,6 +616,8 @@ neighbours_changed_notification (const struct GNUNET_PeerIdentity *peer, | |||
616 | struct GNUNET_BANDWIDTH_Value32NBO bandwidth_in, | 616 | struct GNUNET_BANDWIDTH_Value32NBO bandwidth_in, |
617 | struct GNUNET_BANDWIDTH_Value32NBO bandwidth_out) | 617 | struct GNUNET_BANDWIDTH_Value32NBO bandwidth_out) |
618 | { | 618 | { |
619 | (void) bandwidth_in; | ||
620 | (void) bandwidth_out; | ||
619 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 621 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
620 | "Notifying about change for peer `%s' with address `%s' in state `%s' timing out at %s\n", | 622 | "Notifying about change for peer `%s' with address `%s' in state `%s' timing out at %s\n", |
621 | GNUNET_i2s (peer), | 623 | GNUNET_i2s (peer), |
@@ -993,6 +995,10 @@ send_disconnect_cont (void *cls, | |||
993 | { | 995 | { |
994 | struct NeighbourMapEntry *n; | 996 | struct NeighbourMapEntry *n; |
995 | 997 | ||
998 | (void) cls; | ||
999 | (void) result; | ||
1000 | (void) payload; | ||
1001 | (void) physical; | ||
996 | n = lookup_neighbour (target); | 1002 | n = lookup_neighbour (target); |
997 | if (NULL == n) | 1003 | if (NULL == n) |
998 | return; /* already gone */ | 1004 | return; /* already gone */ |
@@ -1133,8 +1139,10 @@ disconnect_neighbour (struct NeighbourMapEntry *n) | |||
1133 | * | 1139 | * |
1134 | * @param n neighbour entry to change qutoa for | 1140 | * @param n neighbour entry to change qutoa for |
1135 | * @param quota new quota | 1141 | * @param quota new quota |
1142 | * @return #GNUNET_YES if @a n is still valid, @GNUNET_NO if | ||
1143 | * @a n was freed | ||
1136 | */ | 1144 | */ |
1137 | static void | 1145 | static int |
1138 | set_incoming_quota (struct NeighbourMapEntry *n, | 1146 | set_incoming_quota (struct NeighbourMapEntry *n, |
1139 | struct GNUNET_BANDWIDTH_Value32NBO quota) | 1147 | struct GNUNET_BANDWIDTH_Value32NBO quota) |
1140 | { | 1148 | { |
@@ -1158,7 +1166,7 @@ set_incoming_quota (struct NeighbourMapEntry *n, | |||
1158 | GNUNET_TIME_UNIT_FOREVER_REL, | 1166 | GNUNET_TIME_UNIT_FOREVER_REL, |
1159 | GNUNET_NO, | 1167 | GNUNET_NO, |
1160 | NULL, NULL); | 1168 | NULL, NULL); |
1161 | return; | 1169 | return GNUNET_YES; |
1162 | } | 1170 | } |
1163 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, | 1171 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, |
1164 | "Disconnecting peer `%s' due to SET_QUOTA\n", | 1172 | "Disconnecting peer `%s' due to SET_QUOTA\n", |
@@ -1168,6 +1176,7 @@ set_incoming_quota (struct NeighbourMapEntry *n, | |||
1168 | gettext_noop ("# disconnects due to quota of 0"), | 1176 | gettext_noop ("# disconnects due to quota of 0"), |
1169 | 1, GNUNET_NO); | 1177 | 1, GNUNET_NO); |
1170 | disconnect_neighbour (n); | 1178 | disconnect_neighbour (n); |
1179 | return GNUNET_NO; | ||
1171 | } | 1180 | } |
1172 | 1181 | ||
1173 | 1182 | ||
@@ -1196,8 +1205,10 @@ set_primary_address (struct NeighbourMapEntry *n, | |||
1196 | if (n->primary_address.bandwidth_in.value__ != bandwidth_in.value__) | 1205 | if (n->primary_address.bandwidth_in.value__ != bandwidth_in.value__) |
1197 | { | 1206 | { |
1198 | n->primary_address.bandwidth_in = bandwidth_in; | 1207 | n->primary_address.bandwidth_in = bandwidth_in; |
1199 | set_incoming_quota (n, | 1208 | if (GNUNET_YES != |
1200 | bandwidth_in); | 1209 | set_incoming_quota (n, |
1210 | bandwidth_in)) | ||
1211 | return; | ||
1201 | } | 1212 | } |
1202 | if (n->primary_address.bandwidth_out.value__ != bandwidth_out.value__) | 1213 | if (n->primary_address.bandwidth_out.value__ != bandwidth_out.value__) |
1203 | { | 1214 | { |
@@ -1237,8 +1248,10 @@ set_primary_address (struct NeighbourMapEntry *n, | |||
1237 | /* subsystems about address use */ | 1248 | /* subsystems about address use */ |
1238 | GST_validation_set_address_use (n->primary_address.address, | 1249 | GST_validation_set_address_use (n->primary_address.address, |
1239 | GNUNET_YES); | 1250 | GNUNET_YES); |
1240 | set_incoming_quota (n, | 1251 | if (GNUNET_YES != |
1241 | bandwidth_in); | 1252 | set_incoming_quota (n, |
1253 | bandwidth_in)) | ||
1254 | return; | ||
1242 | send_outbound_quota_to_clients (n); | 1255 | send_outbound_quota_to_clients (n); |
1243 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, | 1256 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, |
1244 | "Neighbour `%s' switched to address `%s'\n", | 1257 | "Neighbour `%s' switched to address `%s'\n", |
@@ -1805,6 +1818,9 @@ send_session_syn_cont (void *cls, | |||
1805 | { | 1818 | { |
1806 | struct NeighbourMapEntry *n; | 1819 | struct NeighbourMapEntry *n; |
1807 | 1820 | ||
1821 | (void) cls; | ||
1822 | (void) size_payload; | ||
1823 | (void) size_on_wire; | ||
1808 | n = lookup_neighbour (target); | 1824 | n = lookup_neighbour (target); |
1809 | if (NULL == n) | 1825 | if (NULL == n) |
1810 | { | 1826 | { |
@@ -1978,6 +1994,9 @@ send_session_syn_ack_cont (void *cls, | |||
1978 | { | 1994 | { |
1979 | struct NeighbourMapEntry *n; | 1995 | struct NeighbourMapEntry *n; |
1980 | 1996 | ||
1997 | (void) cls; | ||
1998 | (void) size_payload; | ||
1999 | (void) size_on_wire; | ||
1981 | n = lookup_neighbour (target); | 2000 | n = lookup_neighbour (target); |
1982 | if (NULL == n) | 2001 | if (NULL == n) |
1983 | { | 2002 | { |
@@ -2393,8 +2412,10 @@ try_run_fast_ats_update (const struct GNUNET_HELLO_Address *address, | |||
2393 | if (n->primary_address.bandwidth_in.value__ != bandwidth_in.value__) | 2412 | if (n->primary_address.bandwidth_in.value__ != bandwidth_in.value__) |
2394 | { | 2413 | { |
2395 | n->primary_address.bandwidth_in = bandwidth_in; | 2414 | n->primary_address.bandwidth_in = bandwidth_in; |
2396 | set_incoming_quota (n, | 2415 | if (GNUNET_YES != |
2397 | bandwidth_in); | 2416 | set_incoming_quota (n, |
2417 | bandwidth_in)) | ||
2418 | return GNUNET_NO; | ||
2398 | } | 2419 | } |
2399 | if (n->primary_address.bandwidth_out.value__ != bandwidth_out.value__) | 2420 | if (n->primary_address.bandwidth_out.value__ != bandwidth_out.value__) |
2400 | { | 2421 | { |
@@ -2805,6 +2826,7 @@ send_utilization_data (void *cls, | |||
2805 | uint32_t bps_out; | 2826 | uint32_t bps_out; |
2806 | struct GNUNET_TIME_Relative delta; | 2827 | struct GNUNET_TIME_Relative delta; |
2807 | 2828 | ||
2829 | (void) cls; | ||
2808 | if ( (GNUNET_YES != test_connected (n)) || | 2830 | if ( (GNUNET_YES != test_connected (n)) || |
2809 | (NULL == n->primary_address.address) ) | 2831 | (NULL == n->primary_address.address) ) |
2810 | return GNUNET_OK; | 2832 | return GNUNET_OK; |
@@ -2835,11 +2857,12 @@ send_utilization_data (void *cls, | |||
2835 | /** | 2857 | /** |
2836 | * Task transmitting utilization in a regular interval | 2858 | * Task transmitting utilization in a regular interval |
2837 | * | 2859 | * |
2838 | * @param cls the 'struct NeighbourMapEntry' for which we are running | 2860 | * @param cls the `struct NeighbourMapEntry` for which we are running |
2839 | */ | 2861 | */ |
2840 | static void | 2862 | static void |
2841 | utilization_transmission (void *cls) | 2863 | utilization_transmission (void *cls) |
2842 | { | 2864 | { |
2865 | (void) cls; | ||
2843 | util_transmission_tk = NULL; | 2866 | util_transmission_tk = NULL; |
2844 | GNUNET_CONTAINER_multipeermap_iterate (neighbours, | 2867 | GNUNET_CONTAINER_multipeermap_iterate (neighbours, |
2845 | &send_utilization_data, | 2868 | &send_utilization_data, |
@@ -3095,6 +3118,7 @@ GST_neighbours_handle_session_syn_ack (const struct GNUNET_MessageHeader *messag | |||
3095 | struct GNUNET_TIME_Absolute ts; | 3118 | struct GNUNET_TIME_Absolute ts; |
3096 | struct NeighbourMapEntry *n; | 3119 | struct NeighbourMapEntry *n; |
3097 | 3120 | ||
3121 | (void) session; | ||
3098 | if (ntohs (message->size) != sizeof (struct TransportSynMessage)) | 3122 | if (ntohs (message->size) != sizeof (struct TransportSynMessage)) |
3099 | { | 3123 | { |
3100 | GNUNET_break_op (0); | 3124 | GNUNET_break_op (0); |
@@ -3368,6 +3392,7 @@ GST_neighbours_handle_session_ack (const struct GNUNET_MessageHeader *message, | |||
3368 | { | 3392 | { |
3369 | struct NeighbourMapEntry *n; | 3393 | struct NeighbourMapEntry *n; |
3370 | 3394 | ||
3395 | (void) session; | ||
3371 | if (ntohs (message->size) != sizeof (struct GNUNET_MessageHeader)) | 3396 | if (ntohs (message->size) != sizeof (struct GNUNET_MessageHeader)) |
3372 | { | 3397 | { |
3373 | GNUNET_break_op (0); | 3398 | GNUNET_break_op (0); |
@@ -3641,6 +3666,7 @@ neighbours_iterate (void *cls, | |||
3641 | struct GNUNET_BANDWIDTH_Value32NBO bandwidth_in; | 3666 | struct GNUNET_BANDWIDTH_Value32NBO bandwidth_in; |
3642 | struct GNUNET_BANDWIDTH_Value32NBO bandwidth_out; | 3667 | struct GNUNET_BANDWIDTH_Value32NBO bandwidth_out; |
3643 | 3668 | ||
3669 | (void) key; | ||
3644 | if (NULL != n->primary_address.address) | 3670 | if (NULL != n->primary_address.address) |
3645 | { | 3671 | { |
3646 | bandwidth_in = n->primary_address.bandwidth_in; | 3672 | bandwidth_in = n->primary_address.bandwidth_in; |
@@ -3733,6 +3759,7 @@ GST_neighbour_get_current_address (const struct GNUNET_PeerIdentity *peer) | |||
3733 | void | 3759 | void |
3734 | GST_neighbours_start (unsigned int max_fds) | 3760 | GST_neighbours_start (unsigned int max_fds) |
3735 | { | 3761 | { |
3762 | (void) max_fds; | ||
3736 | neighbours = GNUNET_CONTAINER_multipeermap_create (NEIGHBOUR_TABLE_SIZE, | 3763 | neighbours = GNUNET_CONTAINER_multipeermap_create (NEIGHBOUR_TABLE_SIZE, |
3737 | GNUNET_NO); | 3764 | GNUNET_NO); |
3738 | util_transmission_tk = GNUNET_SCHEDULER_add_delayed (UTIL_TRANSMISSION_INTERVAL, | 3765 | util_transmission_tk = GNUNET_SCHEDULER_add_delayed (UTIL_TRANSMISSION_INTERVAL, |
@@ -3756,6 +3783,8 @@ disconnect_all_neighbours (void *cls, | |||
3756 | { | 3783 | { |
3757 | struct NeighbourMapEntry *n = value; | 3784 | struct NeighbourMapEntry *n = value; |
3758 | 3785 | ||
3786 | (void) cls; | ||
3787 | (void) key; | ||
3759 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 3788 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
3760 | "Disconnecting peer `%4s' during shutdown\n", | 3789 | "Disconnecting peer `%4s' during shutdown\n", |
3761 | GNUNET_i2s (&n->id)); | 3790 | GNUNET_i2s (&n->id)); |
diff --git a/src/transport/plugin_transport_udp.c b/src/transport/plugin_transport_udp.c index f214e7be4..0daac4443 100644 --- a/src/transport/plugin_transport_udp.c +++ b/src/transport/plugin_transport_udp.c | |||
@@ -3839,9 +3839,9 @@ libgnunet_plugin_transport_udp_init (void *cls) | |||
3839 | unsigned long long port; | 3839 | unsigned long long port; |
3840 | unsigned long long aport; | 3840 | unsigned long long aport; |
3841 | unsigned long long udp_max_bps; | 3841 | unsigned long long udp_max_bps; |
3842 | unsigned long long enable_v6; | 3842 | int enable_v6; |
3843 | unsigned long long enable_broadcasting; | 3843 | int enable_broadcasting; |
3844 | unsigned long long enable_broadcasting_recv; | 3844 | int enable_broadcasting_recv; |
3845 | char *bind4_address; | 3845 | char *bind4_address; |
3846 | char *bind6_address; | 3846 | char *bind6_address; |
3847 | struct GNUNET_TIME_Relative interval; | 3847 | struct GNUNET_TIME_Relative interval; |