diff options
author | glebius <glebius@FreeBSD.org> | 2006-12-12 12:35:06 +0000 |
---|---|---|
committer | glebius <glebius@FreeBSD.org> | 2006-12-12 12:35:06 +0000 |
commit | a6aa94d334c52778958c4caa238d3836497074fb (patch) | |
tree | c06a81d0bb9cea47c91b21476a518012ca02f8f5 /sys/netgraph/ng_nat.c | |
parent | 297206ec2ac5b34686aaf531476b1b737df9bbd7 (diff) | |
download | FreeBSD-src-a6aa94d334c52778958c4caa238d3836497074fb.zip FreeBSD-src-a6aa94d334c52778958c4caa238d3836497074fb.tar.gz |
Correctly calculate length of IP header.
Submitted by: Eugene Hartmann <eugene tpsb.com.ru>
Diffstat (limited to 'sys/netgraph/ng_nat.c')
-rw-r--r-- | sys/netgraph/ng_nat.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/sys/netgraph/ng_nat.c b/sys/netgraph/ng_nat.c index f5abdfb..4271e2d 100644 --- a/sys/netgraph/ng_nat.c +++ b/sys/netgraph/ng_nat.c @@ -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. |