alias_ftp.c (168344) | alias_ftp.c (176884) |
---|---|
1/*- 2 * Copyright (c) 2001 Charles Mott <cm@linktel.net> 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 11 unchanged lines hidden (view full) --- 20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 * SUCH DAMAGE. 25 */ 26 27#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 2001 Charles Mott <cm@linktel.net> 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 11 unchanged lines hidden (view full) --- 20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 * SUCH DAMAGE. 25 */ 26 27#include <sys/cdefs.h> |
28__FBSDID("$FreeBSD: head/sys/netinet/libalias/alias_ftp.c 168344 2007-04-04 03:14:15Z kan $"); | 28__FBSDID("$FreeBSD: head/sys/netinet/libalias/alias_ftp.c 176884 2008-03-06 21:50:41Z piso $"); |
29 30/* 31 Alias_ftp.c performs special processing for FTP sessions under 32 TCP. Specifically, when a PORT/EPRT command from the client 33 side or 227/229 reply from the server is sent, it is intercepted 34 and modified. The address is changed to the gateway machine 35 and an aliasing port is used. 36 --- 692 unchanged lines hidden (view full) --- 729 strncpy(sptr, stemp, maxpacketsize - hlen); 730 } 731 732/* Save information regarding modified seq and ack numbers */ 733 { 734 int delta; 735 736 SetAckModified(lnk); | 29 30/* 31 Alias_ftp.c performs special processing for FTP sessions under 32 TCP. Specifically, when a PORT/EPRT command from the client 33 side or 227/229 reply from the server is sent, it is intercepted 34 and modified. The address is changed to the gateway machine 35 and an aliasing port is used. 36 --- 692 unchanged lines hidden (view full) --- 729 strncpy(sptr, stemp, maxpacketsize - hlen); 730 } 731 732/* Save information regarding modified seq and ack numbers */ 733 { 734 int delta; 735 736 SetAckModified(lnk); |
737 delta = GetDeltaSeqOut(pip, lnk); 738 AddSeq(pip, lnk, delta + slen - dlen); | 737 tc = (struct tcphdr *)ip_next(pip); 738 delta = GetDeltaSeqOut(tc->th_seq, lnk); 739 AddSeq(lnk, delta + slen - dlen, pip->ip_hl, 740 pip->ip_len, tc->th_seq, tc->th_off); |
739 } 740 741/* Revise IP header */ 742 { 743 u_short new_len; 744 745 new_len = htons(hlen + slen); 746 DifferentialChecksum(&pip->ip_sum, --- 20 unchanged lines hidden --- | 741 } 742 743/* Revise IP header */ 744 { 745 u_short new_len; 746 747 new_len = htons(hlen + slen); 748 DifferentialChecksum(&pip->ip_sum, --- 20 unchanged lines hidden --- |