diff options
author | Christian Grothoff <christian@grothoff.org> | 2012-01-30 13:32:03 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2012-01-30 13:32:03 +0000 |
commit | 2e522732d14b925f6fbf94a4db75b80a04f8cb7a (patch) | |
tree | d4bebf7e8ae669710b6e50bf2b1e8f9b05f2551f /src/tun/tun.c | |
parent | d6f6be87c98362faa95a84d27a65b79694369fee (diff) | |
download | gnunet-2e522732d14b925f6fbf94a4db75b80a04f8cb7a.tar.gz gnunet-2e522732d14b925f6fbf94a4db75b80a04f8cb7a.zip |
-fix
Diffstat (limited to 'src/tun/tun.c')
-rw-r--r-- | src/tun/tun.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/tun/tun.c b/src/tun/tun.c index 1ce6605dc..e047db713 100644 --- a/src/tun/tun.c +++ b/src/tun/tun.c | |||
@@ -50,7 +50,7 @@ GNUNET_TUN_initialize_ipv4_header (struct GNUNET_TUN_IPv4Header *ip, | |||
50 | const struct in_addr *dst) | 50 | const struct in_addr *dst) |
51 | { | 51 | { |
52 | GNUNET_assert (payload_length <= UINT16_MAX - sizeof (struct GNUNET_TUN_IPv4Header)); | 52 | GNUNET_assert (payload_length <= UINT16_MAX - sizeof (struct GNUNET_TUN_IPv4Header)); |
53 | memset (&ip, 0, sizeof (struct GNUNET_TUN_IPv4Header)); | 53 | memset (ip, 0, sizeof (struct GNUNET_TUN_IPv4Header)); |
54 | ip->header_length = sizeof (struct GNUNET_TUN_IPv4Header) / 4; | 54 | ip->header_length = sizeof (struct GNUNET_TUN_IPv4Header) / 4; |
55 | ip->version = 4; | 55 | ip->version = 4; |
56 | ip->total_length = htons (sizeof (struct GNUNET_TUN_IPv4Header) + payload_length); | 56 | ip->total_length = htons (sizeof (struct GNUNET_TUN_IPv4Header) + payload_length); |
@@ -81,7 +81,7 @@ GNUNET_TUN_initialize_ipv6_header (struct GNUNET_TUN_IPv6Header *ip, | |||
81 | const struct in6_addr *dst) | 81 | const struct in6_addr *dst) |
82 | { | 82 | { |
83 | GNUNET_assert (payload_length <= UINT16_MAX - sizeof (struct GNUNET_TUN_IPv6Header)); | 83 | GNUNET_assert (payload_length <= UINT16_MAX - sizeof (struct GNUNET_TUN_IPv6Header)); |
84 | memset (&ip, 0, sizeof (struct GNUNET_TUN_IPv6Header)); | 84 | memset (ip, 0, sizeof (struct GNUNET_TUN_IPv6Header)); |
85 | ip->version = 6; | 85 | ip->version = 6; |
86 | ip->next_header = protocol; | 86 | ip->next_header = protocol; |
87 | ip->payload_length = htons ((uint16_t) payload_length); | 87 | ip->payload_length = htons ((uint16_t) payload_length); |