I think I have not completely understood how this bitfield-stuff works.
authorPhilipp Tölke <toelke@in.tum.de>
Sun, 3 Oct 2010 17:24:27 +0000 (17:24 +0000)
committerPhilipp Tölke <toelke@in.tum.de>
Sun, 3 Oct 2010 17:24:27 +0000 (17:24 +0000)
src/vpn/gnunet-daemon-vpn.c
src/vpn/gnunet-vpn-packet.h

index 3e6e2c1beb9dc0f8b84f51d090f09613b9ccd932..27dbe92ae1a8f22600ed24c19fca1954b973118e 100644 (file)
@@ -181,6 +181,7 @@ static void message_token(void *cls, void *client, const struct GNUNET_MessageHe
        } 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*));
index 71908d10c9b2dbe3fefe10dd983c32bfa79a6e10..7eb1afe8c3e6760485a54b49763ad98eeef27b7b 100644 (file)
@@ -22,8 +22,9 @@ struct ip6_hdr {
 };
 
 struct ip_hdr {
-       unsigned version:4 GNUNET_PACKED;
        unsigned hdr_lngth:4 GNUNET_PACKED;
+       unsigned version:4 GNUNET_PACKED;
+
        unsigned diff_serv:8 GNUNET_PACKED;
        unsigned tot_lngth:16 GNUNET_PACKED;