HomeFreeBSD

ifconfig: Enter jail as soon as possible

Description

ifconfig: Enter jail as soon as possible

Some options (in particular, -g) are processed immediately upon being
parsed. This will produce the wrong result in combination with -j since
we only attach to the jail after we're done parsing arguments. Solve
this by attaching to the jail immediately when -j is encountered. The
downside is that e.g. ifconfig -j foo -j bar would previously attach
to jail “bar”, whereas now it will attempt to attach to jail “foo”, and
if successful, attempt to attach to jail “bar” within jail “foo”. This
may be considered a feature.

PR: 289134
MFC after: 1 week
Reviewed by: zlei
Differential Revision: https://reviews.freebsd.org/D52501

(cherry picked from commit 18fd1443d205aed6be22966125a4820f77571948)

Details

Provenance
desAuthored on Sep 15 2025, 5:56 PM
Reviewer
zlei
Differential Revision
D52501: ifconfig: Enter jail as soon as possible
Parents
rG78f39a55b205: MFC: MFV: libexpat 2.7.2
Branches
Unknown
Tags
Unknown