source:
npl/system/netkit-ftp/patches/12-netkit-ftp-0.17-multihome.patch
@
26ffad7
Last change on this file since 26ffad7 was c5c522c, checked in by , 8 years ago | |
---|---|
|
|
File size: 3.2 KB |
-
netkit-ftp-0.17/ftp/ftp_var.h
old new 69 69 Extern int bell; /* ring bell on cmd completion */ 70 70 Extern int doglob; /* glob local file names */ 71 71 Extern int autologin; /* establish user account on connection */ 72 Extern int multihome; /* multi homed host, use same interface for cmd and data channels */ 72 73 Extern int proxy; /* proxy server connection active */ 73 74 Extern int proxflag; /* proxy connection exists */ 74 75 Extern int sunique; /* store files on server with unique name */ -
netkit-ftp-0.17/ftp/ftp.c
old new 132 132 static sigjmp_buf ptabort; 133 133 static int ptabflg = 0; 134 134 static int abrtflag = 0; 135 struct sockaddr_in source; 135 136 136 137 void lostpeer(int); 137 138 extern int connected; … … 153 154 char * 154 155 hookup(const char *host, const char *port) 155 156 { 156 int s, tos, error ;157 int s, tos, error, alen; 157 158 socklen_t len; 158 159 static char hostnamebuf[256]; 159 160 struct addrinfo hints, *res, *res0; … … 278 279 } 279 280 if (verbose) 280 281 printf("Connected to %s (%s).\n", hostname, hbuf); 281 if (getreply(0) > 2) { /* read startup message from server */ 282 alen = sizeof(source); 283 getsockname(s,(struct sockaddr*)&source, &alen); 284 source.sin_port = 0; /* We just want the addr, not the port */ 285 286 if (getreply(0) > 2) { /* read startup message from server */ 282 287 if (cin) 283 288 (void) fclose(cin); 284 289 if (cout) … … 1254 1259 perror("ftp: socket"); 1255 1260 return(1); 1256 1261 } 1262 if((multihome) && 1263 bind(data, (struct sockaddr*)&source, sizeof(source)) == -1) { 1264 close(data); 1265 data = -1; 1266 perror("ftp multihome bind"); 1267 return(1); 1268 } 1257 1269 if (options & SO_DEBUG && 1258 1270 setsockopt(data, SOL_SOCKET, SO_DEBUG, (char *)&on, 1259 1271 sizeof (on)) < 0) -
netkit-ftp-0.17/ftp/main.c
old new 93 93 printf("\t -n: inhibit auto-login\n"); 94 94 printf("\t -e: disable readline support, if present\n"); 95 95 printf("\t -g: disable filename globbing\n"); 96 printf("\t -m: don't force data channel interface to the same as control channel\n"); 96 97 printf("\t -v: verbose mode\n"); 97 98 printf("\t -t: enable packet tracing [nonfunctional]\n"); 98 99 printf("\t -d: enable debugging\n"); … … 120 121 doglob = 1; 121 122 interactive = 1; 122 123 autologin = 1; 124 multihome = 1; 123 125 passivemode = 1; 124 126 125 127 cp = strrchr(argv[0], '/'); … … 172 174 rl_inhibit = 1; 173 175 break; 174 176 177 case 'm': 178 multihome = 0; 179 break; 180 175 181 case 'h': 176 182 usage(); 177 183 exit(0); -
netkit-ftp-0.17/ftp/ftp.1
old new 92 92 executable. Otherwise, does nothing. 93 93 .It Fl g 94 94 Disables file name globbing. 95 .It Fl m 96 The default requires that ftp explicitly binds to the same interface for the data 97 channel as the control channel in passive mode. Useful on multi-homed 98 clients. This option disables this behavior. 95 99 .It Fl v 96 100 Verbose option forces 97 101 .Nm ftp
Note: See TracBrowser
for help on using the repository browser.