diff options
author | Christian Grothoff <christian@grothoff.org> | 2011-07-01 14:17:34 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2011-07-01 14:17:34 +0000 |
commit | 6129a0a79b56923d483216ba78ba250c2cf0403c (patch) | |
tree | bb379ed2d3035497cf939e28a21ab70985a3dd0a /src/nat/nat.c | |
parent | 0e4eb80cafbc54240c5d82589dea973d6ee22df3 (diff) | |
download | gnunet-6129a0a79b56923d483216ba78ba250c2cf0403c.tar.gz gnunet-6129a0a79b56923d483216ba78ba250c2cf0403c.zip |
more hacking on nat test code
Diffstat (limited to 'src/nat/nat.c')
-rw-r--r-- | src/nat/nat.c | 27 |
1 files changed, 15 insertions, 12 deletions
diff --git a/src/nat/nat.c b/src/nat/nat.c index e708cdabf..4e78c5d24 100644 --- a/src/nat/nat.c +++ b/src/nat/nat.c | |||
@@ -331,10 +331,11 @@ remove_from_address_list_by_source (struct GNUNET_NAT_Handle *h, | |||
331 | GNUNET_CONTAINER_DLL_remove (h->lal_head, | 331 | GNUNET_CONTAINER_DLL_remove (h->lal_head, |
332 | h->lal_tail, | 332 | h->lal_tail, |
333 | pos); | 333 | pos); |
334 | h->address_callback (h->callback_cls, | 334 | if (NULL != h->address_callback) |
335 | GNUNET_NO, | 335 | h->address_callback (h->callback_cls, |
336 | (const struct sockaddr* ) &pos[1], | 336 | GNUNET_NO, |
337 | pos->addrlen); | 337 | (const struct sockaddr* ) &pos[1], |
338 | pos->addrlen); | ||
338 | GNUNET_free (pos); | 339 | GNUNET_free (pos); |
339 | } | 340 | } |
340 | } | 341 | } |
@@ -369,10 +370,11 @@ add_to_address_list_as_is (struct GNUNET_NAT_Handle *h, | |||
369 | "Adding address `%s' from source %d\n", | 370 | "Adding address `%s' from source %d\n", |
370 | GNUNET_a2s (arg, arg_size), | 371 | GNUNET_a2s (arg, arg_size), |
371 | src); | 372 | src); |
372 | h->address_callback (h->callback_cls, | 373 | if (NULL != h->address_callback) |
373 | GNUNET_YES, | 374 | h->address_callback (h->callback_cls, |
374 | arg, | 375 | GNUNET_YES, |
375 | arg_size); | 376 | arg, |
377 | arg_size); | ||
376 | } | 378 | } |
377 | 379 | ||
378 | 380 | ||
@@ -1273,10 +1275,11 @@ GNUNET_NAT_unregister (struct GNUNET_NAT_Handle *h) | |||
1273 | GNUNET_CONTAINER_DLL_remove (h->lal_head, | 1275 | GNUNET_CONTAINER_DLL_remove (h->lal_head, |
1274 | h->lal_tail, | 1276 | h->lal_tail, |
1275 | lal); | 1277 | lal); |
1276 | h->address_callback (h->callback_cls, | 1278 | if (NULL != h->address_callback) |
1277 | GNUNET_NO, | 1279 | h->address_callback (h->callback_cls, |
1278 | (const struct sockaddr*) &lal[1], | 1280 | GNUNET_NO, |
1279 | lal->addrlen); | 1281 | (const struct sockaddr*) &lal[1], |
1282 | lal->addrlen); | ||
1280 | GNUNET_free (lal); | 1283 | GNUNET_free (lal); |
1281 | } | 1284 | } |
1282 | for (i=0;i<h->num_local_addrs;i++) | 1285 | for (i=0;i<h->num_local_addrs;i++) |