]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
ipfw: fix jail option after r348215
authorkevans <kevans@FreeBSD.org>
Mon, 5 Aug 2019 00:08:25 +0000 (00:08 +0000)
committerkevans <kevans@FreeBSD.org>
Mon, 5 Aug 2019 00:08:25 +0000 (00:08 +0000)
commita67e053e2bda7829203775e7e28a5d99332583de
tree7189363fc09077b589df4b0c690ddff045cc8094
parentb571393ab34c5b3688a7338adde0b30865d7c657
ipfw: fix jail option after r348215

r348215 changed jail_getid(3) to validate passed-in jids as active jails
(as the function is documented to return -1 if the jail does not exist).
This broke the jail option (in some cases?) as the jail historically hasn't
needed to exist at the time of rule parsing; jids will get stored and later
applied.

Fix this caller to attempt to parse *av as a number first and just use it
as-is to match historical behavior. jail_getid(3) must still be used in
order for name arguments to work, but it's strictly a fallback in case we
weren't given a number.

Reported and tested by: Ari Suutari <ari stonepile fi>
Reviewed by: ae
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D21128
sbin/ipfw/ipfw2.c