summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorhenning <henning@openbsd.org>2003-06-18 11:04:14 +0000
committerhenning <henning@openbsd.org>2003-06-18 11:04:14 +0000
commit57760668e81be1aa8cbe1490fdca28fc309c9a48 (patch)
tree17e74a3a12db669f712a588640f5efbb6f48ea70
parenttext changes requested by miod (diff)
downloadwireguard-openbsd-57760668e81be1aa8cbe1490fdca28fc309c9a48.tar.xz
wireguard-openbsd-57760668e81be1aa8cbe1490fdca28fc309c9a48.zip
when expanding the $srcaddr/$dstaddr label macros and the address is actually
a table refernence, don't print nonsense but the table name. found by claudio jeker, fix by me, agreement by cedric
-rw-r--r--sbin/pfctl/parse.y4
1 files changed, 3 insertions, 1 deletions
diff --git a/sbin/pfctl/parse.y b/sbin/pfctl/parse.y
index f236f05baa3..c97171b1ccd 100644
--- a/sbin/pfctl/parse.y
+++ b/sbin/pfctl/parse.y
@@ -1,4 +1,4 @@
-/* $OpenBSD: parse.y,v 1.390 2003/06/09 11:14:46 mcbride Exp $ */
+/* $OpenBSD: parse.y,v 1.391 2003/06/18 11:04:14 henning Exp $ */
/*
* Copyright (c) 2001 Markus Friedl. All rights reserved.
@@ -3194,6 +3194,8 @@ expand_label_addr(const char *name, char *label, sa_family_t af,
if (strstr(label, name) != NULL) {
if (h->addr.type == PF_ADDR_DYNIFTL)
snprintf(tmp, sizeof(tmp), "(%s)", h->addr.v.ifname);
+ else if (h->addr.type == PF_ADDR_TABLE)
+ snprintf(tmp, sizeof(tmp), "<%s>", h->addr.v.tblname);
else if (!af || (PF_AZERO(&h->addr.v.a.addr, af) &&
PF_AZERO(&h->addr.v.a.mask, af)))
snprintf(tmp, sizeof(tmp), "any");