diff -rc frox-20011207/src/configs.tpl frox-20011207-oli/src/configs.tpl *** frox-20011207/src/configs.tpl Fri Dec 7 15:25:35 2001 --- frox-20011207-oli/src/configs.tpl Tue Dec 11 15:19:16 2001 *************** *** 19,24 **** --- 19,25 ---- ControlPorts INT2 contports - TRUE FALSE 40000-50000 PassivePorts INT2 pasvports - TRUE FALSE 40000-50000 ActivePorts INT2 actvports - TRUE FALSE 40000-50000 + ConnectFrom STRING connectfrom - TRUE FALSE NULL Timeout INT timeout - TRUE FALSE 300 MaxForks INT maxforks m TRUE FALSE - MaxForksPerHost INT maxforksph - TRUE FALSE - diff -rc frox-20011207/src/control.c frox-20011207-oli/src/control.c *** frox-20011207/src/control.c Fri Dec 7 14:04:53 2001 --- frox-20011207-oli/src/control.c Tue Dec 11 15:22:01 2001 *************** *** 100,106 **** debug("Connecting to server..."); if ((info->server_control.fd = ! connect_to_socket(info->server_control.address, CTRL)) == -1) { write(info->client_control.fd, "501 Proxy unable to contact ftp server\n", 39); write_log(ERROR, --- 100,106 ---- debug("Connecting to server..."); if ((info->server_control.fd = ! connect_to_socket_from(info->server_control.address, CTRL, config.connectfrom)) == -1) { write(info->client_control.fd, "501 Proxy unable to contact ftp server\n", 39); write_log(ERROR, diff -rc frox-20011207/src/data.c frox-20011207-oli/src/data.c *** frox-20011207/src/data.c Fri Dec 7 18:34:57 2001 --- frox-20011207-oli/src/data.c Tue Dec 11 15:26:05 2001 *************** *** 177,183 **** int connect_server_data() { info->server_data.fd = ! connect_to_socket(info->server_data.address, PASV); if (info->server_data.fd == -1) { write_log(ERROR, "Failed to contact server data port"); close(info->client_data.fd); --- 177,183 ---- int connect_server_data() { info->server_data.fd = ! connect_to_socket_from(info->server_data.address, PASV, config.connectfrom ); if (info->server_data.fd == -1) { write_log(ERROR, "Failed to contact server data port"); close(info->client_data.fd); diff -rc frox-20011207/src/misc.c frox-20011207-oli/src/misc.c *** frox-20011207/src/misc.c Fri Dec 7 14:14:12 2001 --- frox-20011207-oli/src/misc.c Tue Dec 11 15:56:43 2001 *************** *** 80,86 **** ** Connects to address. Local port is picked from the range given in ** the config file for the use specified in use. ** ------------------------------------------------------------- */ ! int connect_to_socket(struct sockaddr_in connect_address, socketuse use) { int sockfd; struct sockaddr_in address; --- 80,86 ---- ** Connects to address. Local port is picked from the range given in ** the config file for the use specified in use. ** ------------------------------------------------------------- */ ! int connect_to_socket_from(struct sockaddr_in connect_address, socketuse use, char *from) { int sockfd; struct sockaddr_in address; *************** *** 96,101 **** --- 96,110 ---- memset(&address, 0, sizeof(address)); address.sin_family = AF_INET; + + if(from) { + if(!inet_aton(from,&address.sin_addr)) { + debug_perr("inet_aton"); + close(sockfd); + return (-1); + } + } + if (bind_me(sockfd, &address, lo, hi, hi - lo)) { debug_perr("bind_me"); *************** *** 112,117 **** --- 121,132 ---- } return (sockfd); + } + + + int connect_to_socket(struct sockaddr_in connect_address, socketuse use) + { + return connect_to_socket_from(connect_address,use,NULL); } Only in frox-20011207-oli/src: misc.c~ diff -rc frox-20011207/src/misc.h frox-20011207-oli/src/misc.h *** frox-20011207/src/misc.h Fri Dec 7 14:04:44 2001 --- frox-20011207-oli/src/misc.h Tue Dec 11 15:24:26 2001 *************** *** 6,11 **** --- 6,12 ---- ******************/ int listen_on_socket(struct sockaddr_in *listen_address, socketuse use); int connect_to_socket(struct sockaddr_in listen_address, socketuse use); + int connect_to_socket_from(struct sockaddr_in listen_address, socketuse use, char *from); int bind_me(int fd, struct sockaddr_in *addr, int lo, int hi, int attempts); struct sockaddr_in com2n(int a1, int a2, int a3, int a4, int p1, int p2);