]> git.ipfire.org Git - thirdparty/suricata.git/commit
decode: use pointer inside packet area as param
authorEric Leblond <eric@regit.org>
Wed, 5 Sep 2012 12:09:57 +0000 (14:09 +0200)
committerVictor Julien <victor@inliniac.net>
Thu, 6 Sep 2012 05:51:27 +0000 (07:51 +0200)
commit5ffe7e21c3a2ed553c60e628a42439ef1fbb66cd
treeff6cd73771a23a561eb76ee7e20a45e5e7b428ee
parent073b251df7e545f032724b9e8ef70ab216f4c5e5
decode: use pointer inside packet area as param

DecodeTeredo, DecodeIPv6InIPv6 and DecodeIPv4inIPv6 were calling
DecodeTunnel with packet being a pseudo packet and data being
data from initial packet:
        DecodeTunnel(tv, dtv, tp, start, blen,
                     pq, IPPROTO_IPV6);
In decoding functions, arithmetic was done on pkt to set some values?
It was resulting in field of packet  pointing outside of the scope of
packet data.
This patch switch to what has been done in DecodeGre(), I mean:
        DecodeTunnel(tv, dtv, tp, GET_PKT_DATA(tp),
                     GET_PKT_LEN(tp), pq, IPPROTO_IP);
Data buffer is then relative to the packet and the arithmetic is
correct.
src/decode-ipv6.c
src/decode-teredo.c