aboutsummaryrefslogtreecommitdiff
path: root/src/vpn
diff options
context:
space:
mode:
authorPhilipp Tölke <toelke@in.tum.de>2011-10-05 09:41:31 +0000
committerPhilipp Tölke <toelke@in.tum.de>2011-10-05 09:41:31 +0000
commitcc632e434054d618798957fcdb1804f69c8dfc78 (patch)
treefedd8fb9fc43ae4e538139724c0c12dcc3856157 /src/vpn
parent2478a8f68e5958994c2678484cd31843c05d4efd (diff)
downloadgnunet-cc632e434054d618798957fcdb1804f69c8dfc78.tar.gz
gnunet-cc632e434054d618798957fcdb1804f69c8dfc78.zip
core gives a buf of NULL to indicate errors
Diffstat (limited to 'src/vpn')
-rw-r--r--src/vpn/gnunet-daemon-vpn.c24
1 files changed, 15 insertions, 9 deletions
diff --git a/src/vpn/gnunet-daemon-vpn.c b/src/vpn/gnunet-daemon-vpn.c
index 9c944ebef..fbbffc9a1 100644
--- a/src/vpn/gnunet-daemon-vpn.c
+++ b/src/vpn/gnunet-daemon-vpn.c
@@ -283,15 +283,21 @@ send_pkt_to_peer_notify_callback (void *cls, size_t size, void *buf)
283 struct GNUNET_MESH_Tunnel **tunnel = cls; 283 struct GNUNET_MESH_Tunnel **tunnel = cls;
284 284
285 GNUNET_MESH_tunnel_set_data (*tunnel, NULL); 285 GNUNET_MESH_tunnel_set_data (*tunnel, NULL);
286 struct GNUNET_MessageHeader *hdr = 286
287 (struct GNUNET_MessageHeader *) (tunnel + 1); 287 if (NULL != buf)
288 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 288 {
289 "send_pkt_to_peer_notify_callback: buf = %x; size = %u;\n", buf, 289 struct GNUNET_MessageHeader *hdr =
290 size); 290 (struct GNUNET_MessageHeader *) (tunnel + 1);
291 GNUNET_assert (size >= ntohs (hdr->size)); 291 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
292 memcpy (buf, hdr, ntohs (hdr->size)); 292 "send_pkt_to_peer_notify_callback: buf = %x; size = %u;\n", buf,
293 size = ntohs (hdr->size); 293 size);
294 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Sent!\n"); 294 GNUNET_assert (size >= ntohs (hdr->size));
295 memcpy (buf, hdr, ntohs (hdr->size));
296 size = ntohs (hdr->size);
297 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Sent!\n");
298 }
299 else
300 size = 0;
295 301
296 if (NULL != GNUNET_MESH_tunnel_get_head (*tunnel)) 302 if (NULL != GNUNET_MESH_tunnel_get_head (*tunnel))
297 { 303 {