From: Philipp Tölke Date: Sun, 3 Oct 2010 17:24:27 +0000 (+0000) Subject: I think I have not completely understood how this bitfield-stuff works. X-Git-Tag: initial-import-from-subversion-38251~20202 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=5707a07a97bfabb31d964e8dc414dd8ac1175c2e;p=oweals%2Fgnunet.git I think I have not completely understood how this bitfield-stuff works. --- diff --git a/src/vpn/gnunet-daemon-vpn.c b/src/vpn/gnunet-daemon-vpn.c index 3e6e2c1be..27dbe92ae 100644 --- a/src/vpn/gnunet-daemon-vpn.c +++ b/src/vpn/gnunet-daemon-vpn.c @@ -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*)); diff --git a/src/vpn/gnunet-vpn-packet.h b/src/vpn/gnunet-vpn-packet.h index 71908d10c..7eb1afe8c 100644 --- a/src/vpn/gnunet-vpn-packet.h +++ b/src/vpn/gnunet-vpn-packet.h @@ -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;