gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r13135 - gnunet/src/vpn


From: gnunet
Subject: [GNUnet-SVN] r13135 - gnunet/src/vpn
Date: Sun, 3 Oct 2010 19:24:27 +0200

Author: toelke
Date: 2010-10-03 19:24:27 +0200 (Sun, 03 Oct 2010)
New Revision: 13135

Modified:
   gnunet/src/vpn/gnunet-daemon-vpn.c
   gnunet/src/vpn/gnunet-vpn-packet.h
Log:
I think I have not completely understood how this bitfield-stuff works.

Modified: gnunet/src/vpn/gnunet-daemon-vpn.c
===================================================================
--- gnunet/src/vpn/gnunet-daemon-vpn.c  2010-10-03 17:24:26 UTC (rev 13134)
+++ gnunet/src/vpn/gnunet-daemon-vpn.c  2010-10-03 17:24:27 UTC (rev 13135)
@@ -181,6 +181,7 @@
        } else if (ntohs(pkt_tun->tun.type) == 0x0800) {
                struct ip_pkt *pkt = (struct ip_pkt*) message;
                struct ip_udp *udp = (struct ip_udp*) message;
+               GNUNET_assert(pkt->ip_hdr.version == 4);
                if (pkt->ip_hdr.proto == 0x11 && ntohs(udp->udp_hdr.dpt) == 53 
) {
                        size_t len = sizeof(struct query_packet) + 
ntohs(udp->udp_hdr.len) - 9; /* 9 = 8 for the udp-header + 1 for the unsigned 
char data[1]; */
                        struct query_packet_list* query = GNUNET_malloc(len + 
2*sizeof(struct query_packet_list*));

Modified: gnunet/src/vpn/gnunet-vpn-packet.h
===================================================================
--- gnunet/src/vpn/gnunet-vpn-packet.h  2010-10-03 17:24:26 UTC (rev 13134)
+++ gnunet/src/vpn/gnunet-vpn-packet.h  2010-10-03 17:24:27 UTC (rev 13135)
@@ -22,8 +22,9 @@
 };
 
 struct ip_hdr {
+       unsigned hdr_lngth:4 GNUNET_PACKED;
        unsigned version:4 GNUNET_PACKED;
-       unsigned hdr_lngth:4 GNUNET_PACKED;
+
        unsigned diff_serv:8 GNUNET_PACKED;
        unsigned tot_lngth:16 GNUNET_PACKED;
 




reply via email to

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