Fix SIGSEGV in ipfw(8) when NAT64 prefix length is omitted.
Submitted by: Evgeniy Khramtsov <evgeniy at khramtsov org> MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D25734
This commit is contained in:
parent
b9615c3c00
commit
2403d47744
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=363904
@ -303,6 +303,9 @@ nat64clat_config(const char *name, uint8_t set, int ac, char **av)
|
|||||||
|
|
||||||
if ((p = strchr(*av, '/')) != NULL)
|
if ((p = strchr(*av, '/')) != NULL)
|
||||||
*p++ = '\0';
|
*p++ = '\0';
|
||||||
|
else
|
||||||
|
errx(EX_USAGE,
|
||||||
|
"Prefix length required: %s", *av);
|
||||||
if (inet_pton(AF_INET6, *av, &prefix) != 1)
|
if (inet_pton(AF_INET6, *av, &prefix) != 1)
|
||||||
errx(EX_USAGE,
|
errx(EX_USAGE,
|
||||||
"Bad prefix: %s", *av);
|
"Bad prefix: %s", *av);
|
||||||
|
@ -249,6 +249,9 @@ nat64stl_create(const char *name, uint8_t set, int ac, char *av[])
|
|||||||
NEED1("IPv6 prefix6 required");
|
NEED1("IPv6 prefix6 required");
|
||||||
if ((p = strchr(*av, '/')) != NULL)
|
if ((p = strchr(*av, '/')) != NULL)
|
||||||
*p++ = '\0';
|
*p++ = '\0';
|
||||||
|
else
|
||||||
|
errx(EX_USAGE,
|
||||||
|
"Prefix length required: %s", *av);
|
||||||
if (inet_pton(AF_INET6, *av, &cfg->prefix6) != 1)
|
if (inet_pton(AF_INET6, *av, &cfg->prefix6) != 1)
|
||||||
errx(EX_USAGE,
|
errx(EX_USAGE,
|
||||||
"Bad prefix: %s", *av);
|
"Bad prefix: %s", *av);
|
||||||
|
Loading…
Reference in New Issue
Block a user