ipfw(8) crashes when ext6hdr option is omitted

Verify that the option is passed, error out if it's not.
The problem can be trivially triggered with `ipfw add allow ext6hdr`.

PR:		253169
Reviewed by:	kp@
MFC after:	3 days
Differential Revision:	https://reviews.freebsd.org/D28447
This commit is contained in:
Evgeniy Khramtsov 2021-02-01 20:03:57 +01:00 committed by Kristof Provost
parent 38bfc6dee3
commit 682c31db4e

View File

@ -4961,6 +4961,7 @@ compile_rule(char *av[], uint32_t *rbuf, int *rbufsize, struct tidx *tstate)
break;
case TOK_EXT6HDR:
NEED1("missing extension header");
fill_ext6hdr( cmd, *av );
av++;
break;