add clarifying comment to a magic number
authorPhilipp Tölke <toelke@in.tum.de>
Tue, 5 Oct 2010 18:20:16 +0000 (18:20 +0000)
committerPhilipp Tölke <toelke@in.tum.de>
Tue, 5 Oct 2010 18:20:16 +0000 (18:20 +0000)
src/vpn/gnunet-vpn-pretty-print.c

index 87c8322ef7fce93037d43c0e8ccdaf8e3793a2cb..01427fe95138b8371182565db7ff845036fd7470 100644 (file)
@@ -265,7 +265,7 @@ unsigned int parse_dns_name(unsigned char* d, const unsigned char* src, unsigned
        while (len != 0) {
                if (len & 0xC0) { /* Compressed name, offset in this and the next octet */
                        unsigned short offset = ((len & 0x3F) << 8) | src[idx++];
-                       parse_dns_name(dest, src, offset - 12);
+                       parse_dns_name(dest, src, offset - 12); /* 12 for the Header of the DNS-Packet, idx starts at 0 which is 12 bytes from the start of the packet */
                        return idx;
                }
                memcpy(dest, src+idx, len);