diff options
author | Brian Somers <brian@FreeBSD.org> | 1997-12-15 23:34:05 +0000 |
---|---|---|
committer | Brian Somers <brian@FreeBSD.org> | 1997-12-15 23:34:05 +0000 |
commit | 8511968cda017ecc0a3370dc8668d92cce30a42b (patch) | |
tree | 026aab9d303e6b99c98df4c7b0e4d1cfb5edb9f4 /usr.sbin/ppp/nat_cmd.c | |
parent | 9cd5c83ccccc578857607220625e76a683d6fcf7 (diff) | |
download | src-8511968cda017ecc0a3370dc8668d92cce30a42b.tar.gz src-8511968cda017ecc0a3370dc8668d92cce30a42b.zip |
Correct return values from alias routines.
Notes
Notes:
svn path=/head/; revision=31756
Diffstat (limited to 'usr.sbin/ppp/nat_cmd.c')
-rw-r--r-- | usr.sbin/ppp/nat_cmd.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/usr.sbin/ppp/nat_cmd.c b/usr.sbin/ppp/nat_cmd.c index acd801e9680d..f723b6ecc09f 100644 --- a/usr.sbin/ppp/nat_cmd.c +++ b/usr.sbin/ppp/nat_cmd.c @@ -1,5 +1,5 @@ /* - * $Id: alias_cmd.c,v 1.6 1997/10/26 01:02:00 brian Exp $ + * $Id: alias_cmd.c,v 1.7 1997/11/22 03:37:21 brian Exp $ */ #include <sys/param.h> @@ -33,6 +33,7 @@ AliasRedirectPort(struct cmdargs const *arg) if (!(mode & MODE_ALIAS)) { if (VarTerm) fprintf(VarTerm, "Alias not enabled\n"); + return 1; } else if (arg->argc == 3) { char proto_constant; const char *proto; @@ -83,10 +84,10 @@ AliasRedirectPort(struct cmdargs const *arg) if (link == NULL && VarTerm) fprintf(VarTerm, "port redirect: error returned by packed" " aliasing engine (code=%d)\n", error); - } else if (VarTerm) - fprintf(VarTerm, "Usage: alias %s %s\n", arg->cmd->name, arg->cmd->syntax); + } else + return -1; - return 1; + return 0; } @@ -96,6 +97,7 @@ AliasRedirectAddr(struct cmdargs const *arg) if (!(mode & MODE_ALIAS)) { if (VarTerm) fprintf(VarTerm, "alias not enabled\n"); + return 1; } else if (arg->argc == 2) { int error; struct in_addr local_addr; @@ -121,10 +123,10 @@ AliasRedirectAddr(struct cmdargs const *arg) fprintf(VarTerm, "address redirect: packet aliasing engine error\n"); fprintf(VarTerm, "Usage: alias %s %s\n", arg->cmd->name, arg->cmd->syntax); } - } else if (VarTerm) - fprintf(VarTerm, "Usage: alias %s %s\n", arg->cmd->name, arg->cmd->syntax); + } else + return -1; - return 1; + return 0; } |