summaryrefslogtreecommitdiffstats
path: root/usr.sbin/ppp
diff options
context:
space:
mode:
authorbrian <brian@FreeBSD.org>1997-12-15 23:34:05 +0000
committerbrian <brian@FreeBSD.org>1997-12-15 23:34:05 +0000
commit5222236a0e11312d2d7d9889ebe64773dbb2cf33 (patch)
tree8304fd981bcd2e89bdf112a3edcb78a3143dbf0a /usr.sbin/ppp
parentde0e4f242ee179e703acdff275253a534204376a (diff)
downloadFreeBSD-src-5222236a0e11312d2d7d9889ebe64773dbb2cf33.zip
FreeBSD-src-5222236a0e11312d2d7d9889ebe64773dbb2cf33.tar.gz
Correct return values from alias routines.
Diffstat (limited to 'usr.sbin/ppp')
-rw-r--r--usr.sbin/ppp/alias_cmd.c16
-rw-r--r--usr.sbin/ppp/nat_cmd.c16
2 files changed, 18 insertions, 14 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;
}
diff --git a/usr.sbin/ppp/nat_cmd.c b/usr.sbin/ppp/nat_cmd.c
index acd801e..f723b6e 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;
}
OpenPOWER on IntegriCloud