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
This commit is contained in:
Lutz Donnerhacke 2021-05-11 10:22:16 +02:00
parent 9e16b9530a
commit f6f297871d

View file

@ -4021,7 +4021,8 @@ compile_rule(char *av[], uint32_t *rbuf, int *rbufsize, struct tidx *tstate)
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);
/*