gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] r19418 - gnunet/src/tun


From: gnunet
Subject: [GNUnet-SVN] r19418 - gnunet/src/tun
Date: Thu, 26 Jan 2012 00:03:25 +0100

Author: grothoff
Date: 2012-01-26 00:03:25 +0100 (Thu, 26 Jan 2012)
New Revision: 19418

Modified:
   gnunet/src/tun/tun.c
Log:
-fix IP header length calculations for IPv6

Modified: gnunet/src/tun/tun.c
===================================================================
--- gnunet/src/tun/tun.c        2012-01-25 23:03:10 UTC (rev 19417)
+++ gnunet/src/tun/tun.c        2012-01-25 23:03:25 UTC (rev 19418)
@@ -89,7 +89,7 @@
   ip->traffic_class_l = 0;
   ip->flow_label = 0;
   ip->next_header = protocol;
-  ip->payload_length = htons ((uint16_t) (payload_length + sizeof (struct 
GNUNET_TUN_IPv6Header)));
+  ip->payload_length = htons ((uint16_t) payload_length);
   ip->hop_limit = FRESH_TTL;
   ip->destination_address = *dst;
   ip->source_address = *src;  
@@ -146,7 +146,7 @@
   uint32_t sum;
   uint32_t tmp;
 
-  GNUNET_assert (payload_length + sizeof (struct GNUNET_TUN_IPv6Header) + 
sizeof (struct GNUNET_TUN_TcpHeader) ==
+  GNUNET_assert (payload_length + sizeof (struct GNUNET_TUN_TcpHeader) ==
                 ntohs (ip->payload_length));
   GNUNET_assert (IPPROTO_TCP == ip->next_header);
   tcp->crc = 0;
@@ -222,7 +222,7 @@
   uint32_t sum;
   uint32_t tmp;
 
-  GNUNET_assert (payload_length + sizeof (struct GNUNET_TUN_IPv6Header) + 
sizeof (struct GNUNET_TUN_UdpHeader) ==
+  GNUNET_assert (payload_length + sizeof (struct GNUNET_TUN_UdpHeader) ==
                 ntohs (ip->payload_length));
   GNUNET_assert (payload_length + sizeof (struct GNUNET_TUN_UdpHeader) ==
                 ntohs (udp->len));




reply via email to

[Prev in Thread] Current Thread [Next in Thread]