alias_ftp.c (145961) | alias_ftp.c (147623) |
---|---|
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 145961 2005-05-06 11:07:49Z glebius $"); | 28__FBSDID("$FreeBSD: head/sys/netinet/libalias/alias_ftp.c 147623 2005-06-27 07:36:02Z glebius $"); |
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 --- 635 unchanged lines hidden (view full) --- 672 &new_len, 673 &pip->ip_len, 674 1); 675 pip->ip_len = new_len; 676 } 677 678/* Compute TCP checksum for revised packet */ 679 tc->th_sum = 0; | 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 --- 635 unchanged lines hidden (view full) --- 672 &new_len, 673 &pip->ip_len, 674 1); 675 pip->ip_len = new_len; 676 } 677 678/* Compute TCP checksum for revised packet */ 679 tc->th_sum = 0; |
680#ifdef _KERNEL 681 tc->th_x2 = 1; 682#else |
|
680 tc->th_sum = TcpChecksum(pip); | 683 tc->th_sum = TcpChecksum(pip); |
684#endif |
|
681 } else { 682#ifdef LIBALIAS_DEBUG 683 fprintf(stderr, 684 "PacketAlias/HandleFtpOut: Cannot allocate FTP data port\n"); 685#endif 686 } 687} | 685 } else { 686#ifdef LIBALIAS_DEBUG 687 fprintf(stderr, 688 "PacketAlias/HandleFtpOut: Cannot allocate FTP data port\n"); 689#endif 690 } 691} |