aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLutz Donnerhacke <donner@FreeBSD.org>2021-05-11 08:22:16 +0000
committerLutz Donnerhacke <donner@FreeBSD.org>2021-05-11 08:44:33 +0000
commitf6f297871d469daf808f78faead8f950a2c81e36 (patch)
treee8d2973cf5341789efdebb895ac9ea57d311ff33
parent9e16b9530aab5e1c4efee2a8fe2feaf33340c764 (diff)
downloadsrc-f6f297871d469daf808f78faead8f950a2c81e36.tar.gz
src-f6f297871d469daf808f78faead8f950a2c81e36.zip
sbin/ipfw: Allow tablearg as hostname
Hostnames starting with "tablearg" are considered as a functional argument instead of a literal. Reported by: ae Reviewers: ae MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D30208
-rw-r--r--sbin/ipfw/ipfw2.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/sbin/ipfw/ipfw2.c b/sbin/ipfw/ipfw2.c
index 498da22e6599..fb1d9a4a180b 100644
--- a/sbin/ipfw/ipfw2.c
+++ b/sbin/ipfw/ipfw2.c
@@ -4021,7 +4021,8 @@ chkarg:
NEED1("missing forward address[:port]");
- if (strncmp(*av, "tablearg", 8) == 0)
+ if (strncmp(*av, "tablearg", 8) == 0 &&
+ ((*av)[8] == '\0' || (*av)[8] == ',' || (*av)[8] == ':'))
memcpy(++(*av), "0.0.0.0", 7);
/*