aboutsummaryrefslogtreecommitdiff
path: root/src/tun/tun.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/tun/tun.c')
-rw-r--r--src/tun/tun.c4
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);