From: Philipp Tölke Date: Thu, 4 Nov 2010 17:26:58 +0000 (+0000) Subject: This bitfield-stuff does not work as I expect X-Git-Tag: initial-import-from-subversion-38251~19837 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=25cb2de35d68523ff4d8f769449654f88afeca1e;p=oweals%2Fgnunet.git This bitfield-stuff does not work as I expect --- diff --git a/src/vpn/gnunet-daemon-vpn.c b/src/vpn/gnunet-daemon-vpn.c index f2403e11c..010d3c1ef 100644 --- a/src/vpn/gnunet-daemon-vpn.c +++ b/src/vpn/gnunet-daemon-vpn.c @@ -365,6 +365,7 @@ message_token(void *cls, if (ntohs(pkt_tun->tun.type) == 0x86dd) { struct ip6_pkt *pkt6 = (struct ip6_pkt*) message; + GNUNET_assert(pkt6->ip6_hdr.version == 6); struct ip6_tcp *pkt6_tcp; struct ip6_udp *pkt6_udp; diff --git a/src/vpn/gnunet-vpn-packet.h b/src/vpn/gnunet-vpn-packet.h index 6f453d9fd..a298fa7c7 100644 --- a/src/vpn/gnunet-vpn-packet.h +++ b/src/vpn/gnunet-vpn-packet.h @@ -11,8 +11,9 @@ struct pkt_tun { }; struct ip6_hdr { + unsigned tclass_h:4 GNUNET_PACKED; unsigned version:4 GNUNET_PACKED; - unsigned tclass:8 GNUNET_PACKED; + unsigned tclass_l:4 GNUNET_PACKED; unsigned flowlbl:20 GNUNET_PACKED; unsigned paylgth:16 GNUNET_PACKED; unsigned nxthdr:8 GNUNET_PACKED; diff --git a/src/vpn/gnunet-vpn-pretty-print.c b/src/vpn/gnunet-vpn-pretty-print.c index 9ea5297cd..1aeb167f1 100644 --- a/src/vpn/gnunet-vpn-pretty-print.c +++ b/src/vpn/gnunet-vpn-pretty-print.c @@ -151,6 +151,7 @@ void pkt_printf(struct ip6_pkt* pkt) {{{ } printf("%s", buf); + printf("version: %d\n", pkt->ip6_hdr.version); }}} void pkt_printf_ip6tcp(struct ip6_tcp* pkt) {{{