diff options
Diffstat (limited to 'src/transport/plugin_transport_udp_broadcasting.c')
-rw-r--r-- | src/transport/plugin_transport_udp_broadcasting.c | 28 |
1 files changed, 13 insertions, 15 deletions
diff --git a/src/transport/plugin_transport_udp_broadcasting.c b/src/transport/plugin_transport_udp_broadcasting.c index 102e262ae..838aec5bc 100644 --- a/src/transport/plugin_transport_udp_broadcasting.c +++ b/src/transport/plugin_transport_udp_broadcasting.c | |||
@@ -89,7 +89,6 @@ struct Mstv6Context | |||
89 | }; | 89 | }; |
90 | 90 | ||
91 | 91 | ||
92 | |||
93 | int | 92 | int |
94 | broadcast_ipv6_mst_cb (void *cls, void *client, | 93 | broadcast_ipv6_mst_cb (void *cls, void *client, |
95 | const struct GNUNET_MessageHeader *message) | 94 | const struct GNUNET_MessageHeader *message) |
@@ -98,9 +97,10 @@ broadcast_ipv6_mst_cb (void *cls, void *client, | |||
98 | struct Plugin *plugin = cls; | 97 | struct Plugin *plugin = cls; |
99 | struct Mstv6Context *mc = client; | 98 | struct Mstv6Context *mc = client; |
100 | const struct GNUNET_MessageHeader *hello; | 99 | const struct GNUNET_MessageHeader *hello; |
101 | struct UDP_Beacon_Message *msg; | 100 | const struct UDP_Beacon_Message *msg; |
101 | struct GNUNET_ATS_Information atsi; | ||
102 | 102 | ||
103 | msg = (struct UDP_Beacon_Message *) message; | 103 | msg = (const struct UDP_Beacon_Message *) message; |
104 | 104 | ||
105 | if (GNUNET_MESSAGE_TYPE_TRANSPORT_BROADCAST_BEACON != | 105 | if (GNUNET_MESSAGE_TYPE_TRANSPORT_BROADCAST_BEACON != |
106 | ntohs (msg->header.type)) | 106 | ntohs (msg->header.type)) |
@@ -109,28 +109,25 @@ broadcast_ipv6_mst_cb (void *cls, void *client, | |||
109 | "Received beacon with %u bytes from peer `%s' via address `%s'\n", | 109 | "Received beacon with %u bytes from peer `%s' via address `%s'\n", |
110 | ntohs (msg->header.size), GNUNET_i2s (&msg->sender), | 110 | ntohs (msg->header.size), GNUNET_i2s (&msg->sender), |
111 | udp_address_to_string (NULL, &mc->addr, sizeof (mc->addr))); | 111 | udp_address_to_string (NULL, &mc->addr, sizeof (mc->addr))); |
112 | struct GNUNET_ATS_Information atsi[2]; | ||
113 | 112 | ||
114 | /* setup ATS */ | 113 | /* setup ATS */ |
115 | atsi[0].type = htonl (GNUNET_ATS_QUALITY_NET_DISTANCE); | 114 | atsi.type = htonl (GNUNET_ATS_NETWORK_TYPE); |
116 | atsi[0].value = htonl (1); | 115 | atsi.value = mc->ats_address_network_type; |
117 | atsi[1].type = htonl (GNUNET_ATS_NETWORK_TYPE); | ||
118 | atsi[1].value = mc->ats_address_network_type; | ||
119 | GNUNET_break (ntohl(mc->ats_address_network_type) != GNUNET_ATS_NET_UNSPECIFIED); | 116 | GNUNET_break (ntohl(mc->ats_address_network_type) != GNUNET_ATS_NET_UNSPECIFIED); |
120 | 117 | ||
121 | hello = (struct GNUNET_MessageHeader *) &msg[1]; | 118 | hello = (struct GNUNET_MessageHeader *) &msg[1]; |
122 | plugin->env->receive (plugin->env->cls, | 119 | plugin->env->receive (plugin->env->cls, |
123 | &msg->sender, | 120 | &msg->sender, |
124 | hello, | 121 | hello, |
125 | NULL, | 122 | NULL, |
126 | (const char *) &mc->addr, | 123 | (const char *) &mc->addr, |
127 | sizeof (mc->addr)); | 124 | sizeof (mc->addr)); |
128 | plugin->env->update_address_metrics (plugin->env->cls, | 125 | plugin->env->update_address_metrics (plugin->env->cls, |
129 | &msg->sender, | 126 | &msg->sender, |
130 | (const char *) &mc->addr, | 127 | (const char *) &mc->addr, |
131 | sizeof (mc->addr), | 128 | sizeof (mc->addr), |
132 | NULL, | 129 | NULL, |
133 | (struct GNUNET_ATS_Information *) &atsi, 2); | 130 | &atsi, 1); |
134 | 131 | ||
135 | GNUNET_STATISTICS_update (plugin->env->stats, | 132 | GNUNET_STATISTICS_update (plugin->env->stats, |
136 | _ | 133 | _ |
@@ -140,6 +137,7 @@ broadcast_ipv6_mst_cb (void *cls, void *client, | |||
140 | return GNUNET_OK; | 137 | return GNUNET_OK; |
141 | } | 138 | } |
142 | 139 | ||
140 | |||
143 | int | 141 | int |
144 | broadcast_ipv4_mst_cb (void *cls, void *client, | 142 | broadcast_ipv4_mst_cb (void *cls, void *client, |
145 | const struct GNUNET_MessageHeader *message) | 143 | const struct GNUNET_MessageHeader *message) |