diff options
Diffstat (limited to 'src/vpn/gnunet-daemon-vpn-helper.c')
-rw-r--r-- | src/vpn/gnunet-daemon-vpn-helper.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/vpn/gnunet-daemon-vpn-helper.c b/src/vpn/gnunet-daemon-vpn-helper.c index c3cc4bc91..a91a0591f 100644 --- a/src/vpn/gnunet-daemon-vpn-helper.c +++ b/src/vpn/gnunet-daemon-vpn-helper.c | |||
@@ -152,6 +152,15 @@ start_helper_and_schedule (void *cls, | |||
152 | 152 | ||
153 | /*}}}*/ | 153 | /*}}}*/ |
154 | 154 | ||
155 | void | ||
156 | initialize_tunnel_state(struct GNUNET_MESH_Tunnel* tunnel, int addrlen, struct GNUNET_MESH_TransmitHandle* th) | ||
157 | { | ||
158 | struct tunnel_state* ts = GNUNET_malloc(sizeof *ts); | ||
159 | ts->addrlen = addrlen; | ||
160 | ts->th = th; | ||
161 | GNUNET_MESH_tunnel_set_data(tunnel, ts); | ||
162 | } | ||
163 | |||
155 | /** | 164 | /** |
156 | * Send an dns-answer-packet to the helper | 165 | * Send an dns-answer-packet to the helper |
157 | */ | 166 | */ |
@@ -424,6 +433,7 @@ message_token (void *cls __attribute__ ((unused)), void *client | |||
424 | send_pkt_to_peer, NULL, | 433 | send_pkt_to_peer, NULL, |
425 | cls); | 434 | cls); |
426 | me->tunnel = *cls; | 435 | me->tunnel = *cls; |
436 | initialize_tunnel_state(me->tunnel, 16, NULL); | ||
427 | } | 437 | } |
428 | else if (NULL != cls) | 438 | else if (NULL != cls) |
429 | { | 439 | { |
@@ -471,6 +481,7 @@ message_token (void *cls __attribute__ ((unused)), void *client | |||
471 | send_pkt_to_peer, | 481 | send_pkt_to_peer, |
472 | NULL, cls); | 482 | NULL, cls); |
473 | me->tunnel = *cls; | 483 | me->tunnel = *cls; |
484 | initialize_tunnel_state(me->tunnel, 16, NULL); | ||
474 | if (GNUNET_APPLICATION_TYPE_INTERNET_UDP_GATEWAY == app_type) | 485 | if (GNUNET_APPLICATION_TYPE_INTERNET_UDP_GATEWAY == app_type) |
475 | udp_tunnel = *cls; | 486 | udp_tunnel = *cls; |
476 | else if (GNUNET_APPLICATION_TYPE_INTERNET_TCP_GATEWAY == app_type) | 487 | else if (GNUNET_APPLICATION_TYPE_INTERNET_TCP_GATEWAY == app_type) |
@@ -627,6 +638,7 @@ message_token (void *cls __attribute__ ((unused)), void *client | |||
627 | send_pkt_to_peer, NULL, | 638 | send_pkt_to_peer, NULL, |
628 | cls); | 639 | cls); |
629 | me->tunnel = *cls; | 640 | me->tunnel = *cls; |
641 | initialize_tunnel_state(me->tunnel, 4, NULL); | ||
630 | } | 642 | } |
631 | else if (NULL != cls) | 643 | else if (NULL != cls) |
632 | { | 644 | { |
@@ -670,6 +682,7 @@ message_token (void *cls __attribute__ ((unused)), void *client | |||
670 | send_pkt_to_peer, | 682 | send_pkt_to_peer, |
671 | NULL, cls); | 683 | NULL, cls); |
672 | me->tunnel = *cls; | 684 | me->tunnel = *cls; |
685 | initialize_tunnel_state(me->tunnel, 4, NULL); | ||
673 | } | 686 | } |
674 | else if (NULL != cls) | 687 | else if (NULL != cls) |
675 | { | 688 | { |