diff options
author | Christian Grothoff <christian@grothoff.org> | 2011-12-23 15:33:43 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2011-12-23 15:33:43 +0000 |
commit | 4ada774476c241b7dd5be9435edf4154ce8a6e34 (patch) | |
tree | ef815d38f734405937d6c1d34cab86c36dcbe64a | |
parent | 69cee6e6424abd403d43964fb3c7b63107e1cf61 (diff) | |
download | gnunet-gtk-4ada774476c241b7dd5be9435edf4154ce8a6e34.tar.gz gnunet-gtk-4ada774476c241b7dd5be9435edf4154ce8a6e34.zip |
-fix
-rw-r--r-- | src/setup/gnunet-setup-transport.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/src/setup/gnunet-setup-transport.c b/src/setup/gnunet-setup-transport.c index d0ee29bf..374ed80c 100644 --- a/src/setup/gnunet-setup-transport.c +++ b/src/setup/gnunet-setup-transport.c | |||
@@ -177,7 +177,11 @@ nipo (void *cls, const char *name, int isDefault, | |||
177 | in = (const struct sockaddr_in *) addr; | 177 | in = (const struct sockaddr_in *) addr; |
178 | 178 | ||
179 | /* set internal IP address */ | 179 | /* set internal IP address */ |
180 | inet_ntop (AF_INET, &in->sin_addr, buf, sizeof (buf)); | 180 | if (NULL == inet_ntop (AF_INET, &in->sin_addr, buf, sizeof (buf))) |
181 | { | ||
182 | GNUNET_break (0); | ||
183 | return GNUNET_OK; | ||
184 | } | ||
181 | GNUNET_CONFIGURATION_set_value_string (cfg, "nat", "INTERNAL_ADDRESS", buf); | 185 | GNUNET_CONFIGURATION_set_value_string (cfg, "nat", "INTERNAL_ADDRESS", buf); |
182 | entry = | 186 | entry = |
183 | GTK_ENTRY (GNUNET_SETUP_get_object | 187 | GTK_ENTRY (GNUNET_SETUP_get_object |
@@ -202,7 +206,6 @@ nipo (void *cls, const char *name, int isDefault, | |||
202 | static void | 206 | static void |
203 | set_external_ipv4 (void *cls, const struct in_addr *addr) | 207 | set_external_ipv4 (void *cls, const struct in_addr *addr) |
204 | { | 208 | { |
205 | struct in_addr ia; | ||
206 | char buf[INET_ADDRSTRLEN]; | 209 | char buf[INET_ADDRSTRLEN]; |
207 | GObject *o; | 210 | GObject *o; |
208 | GtkEntry *entry; | 211 | GtkEntry *entry; |
@@ -226,7 +229,11 @@ set_external_ipv4 (void *cls, const struct in_addr *addr) | |||
226 | } | 229 | } |
227 | 230 | ||
228 | /* set external IP address */ | 231 | /* set external IP address */ |
229 | inet_ntop (AF_INET, &ia, buf, sizeof (buf)); | 232 | if (NULL == inet_ntop (AF_INET, addr, buf, sizeof (buf))) |
233 | { | ||
234 | GNUNET_break (0); | ||
235 | return; | ||
236 | } | ||
230 | if (NULL != cfg) | 237 | if (NULL != cfg) |
231 | GNUNET_CONFIGURATION_set_value_string (cfg, "nat", "EXTERNAL_ADDRESS", | 238 | GNUNET_CONFIGURATION_set_value_string (cfg, "nat", "EXTERNAL_ADDRESS", |
232 | buf); | 239 | buf); |