diff options
author | Christian Grothoff <christian@grothoff.org> | 2017-01-07 00:19:44 +0100 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2017-01-07 00:19:44 +0100 |
commit | 0371316989c99e94c5cf6e32e0cc9dd725339f11 (patch) | |
tree | d4c615f75c3ee3506ba1744b849ff28767a8b329 /src/nat/gnunet-nat.c | |
parent | a9c68a4fcb53d599dc5f0816f3330c169f2fe3a7 (diff) | |
download | gnunet-0371316989c99e94c5cf6e32e0cc9dd725339f11.tar.gz gnunet-0371316989c99e94c5cf6e32e0cc9dd725339f11.zip |
fix bad cast, add additional assertions that AF is set, avoid unaligned access to struct sockaddr_in
Diffstat (limited to 'src/nat/gnunet-nat.c')
-rw-r--r-- | src/nat/gnunet-nat.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/nat/gnunet-nat.c b/src/nat/gnunet-nat.c index 02d68d787..07ddfb6a3 100644 --- a/src/nat/gnunet-nat.c +++ b/src/nat/gnunet-nat.c | |||
@@ -37,7 +37,7 @@ static int global_ret; | |||
37 | * Name of section in configuration file to use for | 37 | * Name of section in configuration file to use for |
38 | * additional options. | 38 | * additional options. |
39 | */ | 39 | */ |
40 | static char *section_name; | 40 | static char *section_name = "undefined"; |
41 | 41 | ||
42 | /** | 42 | /** |
43 | * Flag set to 1 if we use IPPROTO_UDP. | 43 | * Flag set to 1 if we use IPPROTO_UDP. |
@@ -340,9 +340,11 @@ run (void *cls, | |||
340 | GNUNET_SCHEDULER_shutdown (); | 340 | GNUNET_SCHEDULER_shutdown (); |
341 | return; | 341 | return; |
342 | } | 342 | } |
343 | GNUNET_assert (AF_INET == local_sa->sa_family); | ||
344 | GNUNET_assert (AF_INET == remote_sa->sa_family); | ||
343 | ret = GNUNET_NAT_request_reversal (nh, | 345 | ret = GNUNET_NAT_request_reversal (nh, |
344 | (const struct sockaddr_in *) &local_sa, | 346 | (const struct sockaddr_in *) local_sa, |
345 | (const struct sockaddr_in *) &remote_sa); | 347 | (const struct sockaddr_in *) remote_sa); |
346 | switch (ret) | 348 | switch (ret) |
347 | { | 349 | { |
348 | case GNUNET_SYSERR: | 350 | case GNUNET_SYSERR: |