diff options
author | darrenr <darrenr@FreeBSD.org> | 2000-05-24 02:55:58 +0000 |
---|---|---|
committer | darrenr <darrenr@FreeBSD.org> | 2000-05-24 02:55:58 +0000 |
commit | 555b5d352bf66de91310e86c17a4c889e3cf6d57 (patch) | |
tree | 843267cee6cc56a96a38be5409be12cbf6c409d7 /sys/netinet/ip_rcmd_pxy.c | |
parent | 1951f11539dc9602c6a6ded0ed1b96c4d82df48d (diff) | |
download | FreeBSD-src-555b5d352bf66de91310e86c17a4c889e3cf6d57.zip FreeBSD-src-555b5d352bf66de91310e86c17a4c889e3cf6d57.tar.gz |
Import IP Filter 3.4.4 into the kernel
Diffstat (limited to 'sys/netinet/ip_rcmd_pxy.c')
-rw-r--r-- | sys/netinet/ip_rcmd_pxy.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/sys/netinet/ip_rcmd_pxy.c b/sys/netinet/ip_rcmd_pxy.c index f9dc5b3..daea94f 100644 --- a/sys/netinet/ip_rcmd_pxy.c +++ b/sys/netinet/ip_rcmd_pxy.c @@ -1,6 +1,5 @@ /* - * $Id$ - * $FreeBSD$ + * $Id: ip_rcmd_pxy.c,v 1.4.2.1 2000/05/06 11:19:34 darrenr Exp $ */ /* * Simple RCMD transparent proxy for in-kernel use. For use with the NAT @@ -127,11 +126,16 @@ nat_t *nat; ipn = nat_outlookup(fin->fin_ifp, IPN_TCP, nat->nat_p, nat->nat_inip, ip->ip_dst, (dp << 16) | sp); if (ipn == NULL) { + int slen; + + slen = ip->ip_len; + ip->ip_len = fin->fin_hlen + sizeof(*tcp); bcopy((char *)fin, (char *)&fi, sizeof(fi)); bzero((char *)tcp2, sizeof(*tcp2)); tcp2->th_win = htons(8192); tcp2->th_sport = sp; tcp2->th_dport = 0; /* XXX - don't specify remote port */ + tcp2->th_off = 5; fi.fin_data[0] = ntohs(sp); fi.fin_data[1] = 0; fi.fin_dp = (char *)tcp2; @@ -144,6 +148,7 @@ nat_t *nat; fi.fin_fr = &rcmdfr; (void) fr_addstate(ip, &fi, FI_W_DPORT); } + ip->ip_len = slen; ip->ip_src = swip; } return 0; |