summaryrefslogtreecommitdiffstats
path: root/usr.sbin/ppp
diff options
context:
space:
mode:
authorbrian <brian@FreeBSD.org>1997-11-12 18:47:30 +0000
committerbrian <brian@FreeBSD.org>1997-11-12 18:47:30 +0000
commitd99cc94f138fb47191d70c0d7b7241428a189ef0 (patch)
tree42e568b5f953a265b74e4c676aae7e57462482dd /usr.sbin/ppp
parent4feb2f9c7555b299d299f3c7ff031623987361ac (diff)
downloadFreeBSD-src-d99cc94f138fb47191d70c0d7b7241428a189ef0.zip
FreeBSD-src-d99cc94f138fb47191d70c0d7b7241428a189ef0.tar.gz
Return correct value from "set loopback".
Output "set ?filter deny host|port" rules correctly with show ?filter. Submitted by: Dave Bodenstab <imdave@mcs.net>
Diffstat (limited to 'usr.sbin/ppp')
-rw-r--r--usr.sbin/ppp/command.c10
-rw-r--r--usr.sbin/ppp/filter.c10
2 files changed, 15 insertions, 5 deletions
diff --git a/usr.sbin/ppp/command.c b/usr.sbin/ppp/command.c
index f08421c..025fda0 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 <sys/param.h>
@@ -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 121ae04..baa45ef 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) {
OpenPOWER on IntegriCloud