Module Name:    src
Committed By:   christos
Date:           Wed Jun  3 15:11:40 UTC 2015

Modified Files:
        src/external/bsd/blacklist/bin: conf.c

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


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.23 src/external/bsd/blacklist/bin/conf.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/blacklist/bin/conf.c
diff -u src/external/bsd/blacklist/bin/conf.c:1.22 src/external/bsd/blacklist/bin/conf.c:1.23
--- src/external/bsd/blacklist/bin/conf.c:1.22	Tue Jun  2 16:52:00 2015
+++ src/external/bsd/blacklist/bin/conf.c	Wed Jun  3 11:11:40 2015
@@ -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 @@ gethostport(const char *f, size_t l, boo
 			(*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 @@ out1:
 	(*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 @@ out:
 		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);
 	}

Reply via email to