Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/external/bsd/blacklist/bin dissallow interface spec in remot...



details:   https://anonhg.NetBSD.org/src/rev/c375a14adeb6
branches:  trunk
changeset: 338677:c375a14adeb6
user:      christos <christos%NetBSD.org@localhost>
date:      Wed Jun 03 15:11:40 2015 +0000

description:
dissallow interface spec in remote config (since we check against the remote
address, it does not make sense).

diffstat:

 external/bsd/blacklist/bin/conf.c |  12 +++++++++---
 1 files changed, 9 insertions(+), 3 deletions(-)

diffs (47 lines):

diff -r 223de97843bf -r c375a14adeb6 external/bsd/blacklist/bin/conf.c
--- a/external/bsd/blacklist/bin/conf.c Wed Jun 03 14:42:51 2015 +0000
+++ b/external/bsd/blacklist/bin/conf.c Wed Jun 03 15:11:40 2015 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: conf.c,v 1.22 2015/06/02 20:52:00 christos Exp $       */
+/*     $NetBSD: conf.c,v 1.23 2015/06/03 15:11:40 christos Exp $       */
 
 /*-
  * Copyright (c) 2015 The NetBSD Foundation, Inc.
@@ -33,7 +33,7 @@
 #endif
 
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: conf.c,v 1.22 2015/06/02 20:52:00 christos Exp $");
+__RCSID("$NetBSD: conf.c,v 1.23 2015/06/03 15:11:40 christos Exp $");
 
 #include <stdio.h>
 #include <string.h>
@@ -271,6 +271,8 @@
                        (*lfun)(LOG_DEBUG, "%s: host4 %s", __func__, p);
                if (strcmp(p, "*") != 0) {
                        if (conf_is_interface(p)) {
+                               if (!local)
+                                       goto out2;
                                if (debug)
                                        (*lfun)(LOG_DEBUG, "%s: interface %s",
                                            __func__, p);
@@ -308,6 +310,10 @@
        (*lfun)(LOG_ERR, "%s: %s, %zu: Can't specify mask %d with "
            "interface [%s]", __func__, f, l, c->c_lmask, p);
        return -1;
+out2:
+       (*lfun)(LOG_ERR, "%s: %s, %zu: Interface spec does not make sense "
+           "with remote config [%s]", __func__, f, l, p);
+       return -1;
 }
 
 static int
@@ -490,7 +496,7 @@
                char b1[256], b2[256];
                len <<= 2;
                hexdump(b1, sizeof(b1), "a1", v1, len);
-               hexdump(b2, sizeof(b2), "a1", v2, len);
+               hexdump(b2, sizeof(b2), "a2", v2, len);
                (*lfun)(LOG_DEBUG, "%s: %s != %s [0x%x]", __func__,
                    b1, b2, omask);
        }



Home | Main Index | Thread Index | Old Index