diff options
Diffstat (limited to 'usr.sbin/ppp/alias_cmd.c')
-rw-r--r-- | usr.sbin/ppp/alias_cmd.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/usr.sbin/ppp/alias_cmd.c b/usr.sbin/ppp/alias_cmd.c index acd801e..f723b6e 100644 --- a/usr.sbin/ppp/alias_cmd.c +++ b/usr.sbin/ppp/alias_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; } |