Correctly calculate length of IP header.

Submitted by:	Eugene Hartmann <eugene tpsb.com.ru>
This commit is contained in:
Gleb Smirnoff 2006-12-12 12:35:06 +00:00
parent 1d54aa3ba9
commit e7bf470011

View File

@ -246,7 +246,8 @@ ng_nat_rcvdata(hook_p hook, item_p item )
if ((ip->ip_off & htons(IP_OFFMASK)) == 0 &&
ip->ip_p == IPPROTO_TCP) {
struct tcphdr *th = (struct tcphdr *)(ip + 1);
struct tcphdr *th = (struct tcphdr *)((caddr_t)ip +
(ip->ip_hl << 2));
/*
* Here is our terrible HACK.