From a8417377e700ed69c719d2c1c31acdac656bfa4f Mon Sep 17 00:00:00 2001 From: Eric Leblond Date: Wed, 2 Feb 2011 22:50:53 +0100 Subject: [PATCH] Don't use direct pkt access pkt field in Packet needs to be accessed via macro. This patch supress some direct access. --- src/stream-tcp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/stream-tcp.c b/src/stream-tcp.c index 51b0ccc3bf..4ad8477ef0 100644 --- a/src/stream-tcp.c +++ b/src/stream-tcp.c @@ -4087,7 +4087,7 @@ void StreamTcpPseudoPacketSetupHeader(Packet *np, Packet *p) { /* Setup the IP header */ if (PKT_IS_IPV4(p)) { - np->ip4h = (IPV4Hdr *)(np->pkt + (np->pktlen - IPV4_GET_IPLEN(p))); + np->ip4h = (IPV4Hdr *)(GET_PKT_DATA(np) + (GET_PKT_LEN(np) - IPV4_GET_IPLEN(p))); PSUEDO_PKT_SET_IPV4HDR(np->ip4h, p->ip4h); /* Similarly setup the TCP header with ports in opposite direction */ @@ -4101,7 +4101,7 @@ void StreamTcpPseudoPacketSetupHeader(Packet *np, Packet *p) SET_TCP_DST_PORT(np, &np->dp); } else if (PKT_IS_IPV6(p)) { - np->ip6h = (IPV6Hdr *)(np->pkt + (np->pktlen - IPV6_GET_PLEN(p) - IPV6_HEADER_LEN)); + np->ip6h = (IPV6Hdr *)(GET_PKT_DATA(np) + (GET_PKT_LEN(np) - IPV6_GET_PLEN(p) - IPV6_HEADER_LEN)); PSUEDO_PKT_SET_IPV6HDR(np->ip6h, p->ip6h); /* Similarly setup the TCP header with ports in opposite direction */