version 1.175, 2009/01/22 10:02:34 |
version 1.176, 2009/02/12 03:00:56 |
|
|
} |
} |
|
|
if (parse_forward(&fwd, fwdarg, |
if (parse_forward(&fwd, fwdarg, |
opcode == oDynamicForward ? 1 : 0) == 0) |
opcode == oDynamicForward ? 1 : 0, |
|
opcode == oRemoteForward ? 1 : 0) == 0) |
fatal("%.200s line %d: Bad forwarding specification.", |
fatal("%.200s line %d: Bad forwarding specification.", |
filename, linenum); |
filename, linenum); |
|
|
|
|
* returns number of arguments parsed or zero on error |
* returns number of arguments parsed or zero on error |
*/ |
*/ |
int |
int |
parse_forward(Forward *fwd, const char *fwdspec, int dynamicfwd) |
parse_forward(Forward *fwd, const char *fwdspec, int dynamicfwd, int remotefwd) |
{ |
{ |
int i; |
int i; |
char *p, *cp, *fwdarg[4]; |
char *p, *cp, *fwdarg[4]; |
|
|
goto fail_free; |
goto fail_free; |
} |
} |
|
|
if (fwd->listen_port <= 0) |
if (fwd->listen_port < 0 || (!remotefwd && fwd->listen_port == 0)) |
goto fail_free; |
goto fail_free; |
|
|
if (fwd->connect_host != NULL && |
if (fwd->connect_host != NULL && |
strlen(fwd->connect_host) >= NI_MAXHOST) |
strlen(fwd->connect_host) >= NI_MAXHOST) |
goto fail_free; |
goto fail_free; |
|
if (fwd->listen_host != NULL && |
|
strlen(fwd->listen_host) >= NI_MAXHOST) |
|
goto fail_free; |
|
|
|
|
return (i); |
return (i); |
|
|