From c40e02e7f387d9833126e6dfbd35a3218310737d Mon Sep 17 00:00:00 2001 From: Brian Somers Date: Wed, 12 Nov 1997 18:47:30 +0000 Subject: [PATCH] Return correct value from "set loopback". Output "set ?filter deny host|port" rules correctly with show ?filter. Submitted by: Dave Bodenstab --- usr.sbin/ppp/command.c | 10 +++++++--- usr.sbin/ppp/filter.c | 10 ++++++++-- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/usr.sbin/ppp/command.c b/usr.sbin/ppp/command.c index f08421ce047f..025fda01de61 100644 --- a/usr.sbin/ppp/command.c +++ b/usr.sbin/ppp/command.c @@ -17,7 +17,7 @@ * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * $Id: command.c,v 1.99 1997/11/12 02:10:05 brian Exp $ + * $Id: command.c,v 1.100 1997/11/12 16:34:50 brian Exp $ * */ #include @@ -183,10 +183,14 @@ static int SetLoopback(struct cmdtab const * cmdlist, int argc, char **argv) { if (argc == 1) - if (!strcasecmp(*argv, "on")) + if (!strcasecmp(*argv, "on")) { VarLoopback = 1; - else if (!strcasecmp(*argv, "off")) + return 0; + } + else if (!strcasecmp(*argv, "off")) { VarLoopback = 0; + return 0; + } return -1; } diff --git a/usr.sbin/ppp/filter.c b/usr.sbin/ppp/filter.c index 121ae04be895..baa45ef030fc 100644 --- a/usr.sbin/ppp/filter.c +++ b/usr.sbin/ppp/filter.c @@ -17,7 +17,7 @@ * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * $Id: filter.c,v 1.16 1997/10/26 01:02:34 brian Exp $ + * $Id: filter.c,v 1.17 1997/11/09 14:18:38 brian Exp $ * * TODO: Shoud send ICMP error message when we discard packets. */ @@ -434,7 +434,13 @@ ShowFilter(struct filterent * fp) for (n = 0; n < MAXFILTERS; n++, fp++) { if (fp->action != A_NONE) { - fprintf(VarTerm, "%2d %s", n, actname[fp->action]); + fprintf(VarTerm, "%2d %s", n, actname[fp->action & (A_PERMIT|A_DENY)]); + if (fp->action & A_UHOST) + fprintf(VarTerm, "host "); + else if (fp->action & A_UPORT) + fprintf(VarTerm, "port "); + else + fprintf(VarTerm, " "); fprintf(VarTerm, "%s/%d ", inet_ntoa(fp->saddr), fp->swidth); fprintf(VarTerm, "%s/%d ", inet_ntoa(fp->daddr), fp->dwidth); if (fp->proto) {