diff options
author | Philipp Tölke <toelke@in.tum.de> | 2011-02-24 14:44:04 +0000 |
---|---|---|
committer | Philipp Tölke <toelke@in.tum.de> | 2011-02-24 14:44:04 +0000 |
commit | 126827b14598e8d82bc35d7396b87d0f5a6a5e8f (patch) | |
tree | 0249caba70b6850de0f8799cff1d509c84791882 /src/vpn | |
parent | 119990aed1a3f628196d98fc1da15a1ab3f4f3a9 (diff) | |
download | gnunet-126827b14598e8d82bc35d7396b87d0f5a6a5e8f.tar.gz gnunet-126827b14598e8d82bc35d7396b87d0f5a6a5e8f.zip |
fix SIGSEGV if dns was slow to start up
Diffstat (limited to 'src/vpn')
-rw-r--r-- | src/vpn/gnunet-daemon-vpn-dns.c | 5 | ||||
-rw-r--r-- | src/vpn/gnunet-daemon-vpn-helper.c | 3 |
2 files changed, 6 insertions, 2 deletions
diff --git a/src/vpn/gnunet-daemon-vpn-dns.c b/src/vpn/gnunet-daemon-vpn-dns.c index 7d0b38d8c..07e2d6059 100644 --- a/src/vpn/gnunet-daemon-vpn-dns.c +++ b/src/vpn/gnunet-daemon-vpn-dns.c | |||
@@ -117,9 +117,12 @@ connect_to_service_dns (void *cls, | |||
117 | GNUNET_assert (dns_connection == NULL); | 117 | GNUNET_assert (dns_connection == NULL); |
118 | dns_connection = GNUNET_CLIENT_connect ("dns", cfg); | 118 | dns_connection = GNUNET_CLIENT_connect ("dns", cfg); |
119 | /* This would most likely be a misconfiguration */ | 119 | /* This would most likely be a misconfiguration */ |
120 | GNUNET_assert(dns_connection != NULL); | 120 | GNUNET_assert(NULL != dns_connection); |
121 | GNUNET_CLIENT_receive(dns_connection, &dns_answer_handler, NULL, GNUNET_TIME_UNIT_FOREVER_REL); | 121 | GNUNET_CLIENT_receive(dns_connection, &dns_answer_handler, NULL, GNUNET_TIME_UNIT_FOREVER_REL); |
122 | 122 | ||
123 | /* We might not yet be connected. Yay, mps. */ | ||
124 | if (NULL == dns_connection) return; | ||
125 | |||
123 | /* If a packet is already in the list, schedule to send it */ | 126 | /* If a packet is already in the list, schedule to send it */ |
124 | if (head != NULL) | 127 | if (head != NULL) |
125 | GNUNET_CLIENT_notify_transmit_ready(dns_connection, | 128 | GNUNET_CLIENT_notify_transmit_ready(dns_connection, |
diff --git a/src/vpn/gnunet-daemon-vpn-helper.c b/src/vpn/gnunet-daemon-vpn-helper.c index 1317c9ade..9df2a8cc0 100644 --- a/src/vpn/gnunet-daemon-vpn-helper.c +++ b/src/vpn/gnunet-daemon-vpn-helper.c | |||
@@ -122,7 +122,8 @@ start_helper_and_schedule(void *cls, | |||
122 | * The routing-table gets flushed if an interface disappears. | 122 | * The routing-table gets flushed if an interface disappears. |
123 | */ | 123 | */ |
124 | restart_hijack = 1; | 124 | restart_hijack = 1; |
125 | GNUNET_CLIENT_notify_transmit_ready(dns_connection, sizeof(struct GNUNET_MessageHeader), GNUNET_TIME_UNIT_FOREVER_REL, GNUNET_YES, &send_query, NULL); | 125 | if (NULL != dns_connection) |
126 | GNUNET_CLIENT_notify_transmit_ready(dns_connection, sizeof(struct GNUNET_MessageHeader), GNUNET_TIME_UNIT_FOREVER_REL, GNUNET_YES, &send_query, NULL); | ||
126 | } | 127 | } |
127 | /*}}}*/ | 128 | /*}}}*/ |
128 | 129 | ||