mirror of
https://github.com/opnsense/src.git
synced 2026-05-28 04:12:45 -04:00
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
2 changed files with 6 additions and 0 deletions
|
|
@ -303,6 +303,9 @@ nat64clat_config(const char *name, uint8_t set, int ac, char **av)
|
|||
|
||||
if ((p = strchr(*av, '/')) != NULL)
|
||||
*p++ = '\0';
|
||||
else
|
||||
errx(EX_USAGE,
|
||||
"Prefix length required: %s", *av);
|
||||
if (inet_pton(AF_INET6, *av, &prefix) != 1)
|
||||
errx(EX_USAGE,
|
||||
"Bad prefix: %s", *av);
|
||||
|
|
|
|||
|
|
@ -249,6 +249,9 @@ nat64stl_create(const char *name, uint8_t set, int ac, char *av[])
|
|||
NEED1("IPv6 prefix6 required");
|
||||
if ((p = strchr(*av, '/')) != NULL)
|
||||
*p++ = '\0';
|
||||
else
|
||||
errx(EX_USAGE,
|
||||
"Prefix length required: %s", *av);
|
||||
if (inet_pton(AF_INET6, *av, &cfg->prefix6) != 1)
|
||||
errx(EX_USAGE,
|
||||
"Bad prefix: %s", *av);
|
||||
|
|
|
|||
Loading…
Reference in a new issue