diff options
author | darrenr <darrenr@FreeBSD.org> | 2000-07-19 13:57:32 +0000 |
---|---|---|
committer | darrenr <darrenr@FreeBSD.org> | 2000-07-19 13:57:32 +0000 |
commit | a757122c4b3532cb08b9d84b742e8702f872c78f (patch) | |
tree | f4442c5a06b8aebc03598876ed7fec7417bbb215 /sys/netinet/ip_rcmd_pxy.c | |
parent | 555b5d352bf66de91310e86c17a4c889e3cf6d57 (diff) | |
download | FreeBSD-src-a757122c4b3532cb08b9d84b742e8702f872c78f.zip FreeBSD-src-a757122c4b3532cb08b9d84b742e8702f872c78f.tar.gz |
import ipfilter 3.4.8
Diffstat (limited to 'sys/netinet/ip_rcmd_pxy.c')
-rw-r--r-- | sys/netinet/ip_rcmd_pxy.c | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/sys/netinet/ip_rcmd_pxy.c b/sys/netinet/ip_rcmd_pxy.c index daea94f..1d6264d 100644 --- a/sys/netinet/ip_rcmd_pxy.c +++ b/sys/netinet/ip_rcmd_pxy.c @@ -1,5 +1,5 @@ /* - * $Id: ip_rcmd_pxy.c,v 1.4.2.1 2000/05/06 11:19:34 darrenr Exp $ + * $Id: ip_rcmd_pxy.c,v 1.4.2.2 2000/07/15 12:38:30 darrenr Exp $ */ /* * Simple RCMD transparent proxy for in-kernel use. For use with the NAT @@ -93,8 +93,17 @@ nat_t *nat; #endif tcp = (tcphdr_t *)fin->fin_dp; + + if (tcp->th_flags & TH_SYN) { + *(u_32_t *)aps->aps_data = htonl(ntohl(tcp->th_seq) + 1); + return 0; + } + + if ((*(u_32_t *)aps->aps_data != 0) && + (tcp->th_seq != *(u_32_t *)aps->aps_data)) + return 0; + off = (ip->ip_hl << 2) + (tcp->th_off << 2); - m = *(mb_t **)fin->fin_mp; #if SOLARIS m = fin->fin_qfm; @@ -103,13 +112,11 @@ nat_t *nat; bzero(portbuf, sizeof(portbuf)); copyout_mblk(m, off, MIN(sizeof(portbuf), dlen), portbuf); #else + m = *(mb_t **)fin->fin_mp; dlen = mbufchainlen(m) - off; bzero(portbuf, sizeof(portbuf)); m_copydata(m, off, MIN(sizeof(portbuf), dlen), portbuf); #endif - if ((*(u_32_t *)aps->aps_data != 0) && - (tcp->th_seq != *(u_32_t *)aps->aps_data)) - return 0; portbuf[sizeof(portbuf) - 1] = '\0'; s = portbuf; |