--- gvpe/src/device.h 2011/09/16 17:59:46 1.24 +++ gvpe/src/device.h 2013/07/17 16:40:57 1.26 @@ -42,6 +42,9 @@ struct net_packet { u32 len; // actually u16, but padding... + // upto 4 bytes at the end might get overwritten when decrypting, + // which means len, above, is regularly overwritten with part + // of the random prefix when RAND_BYTES=12. u8 &operator[] (u16 offset) const; u8 *at (u16 offset) const; @@ -58,9 +61,9 @@ memmove ((void *)&(*this)[0], (void *)&(*this)[hdrsize], len); } - void skip_ipv4_hdr (u16 extra = 0) + u16 ipv4_hdr_len () const { - skip_hdr ((((*this)[0] & 15) << 2) + extra); + return ((*this)[0] & 15) << 2; } void set (const net_packet &pkt)