[Bug 280913] [patch] Unexpected state of vnet-jails with ifconfig_DEFAULT="DHCP" in rc.conf(5)

From: <bugzilla-noreply_at_freebsd.org>
Date: Mon, 26 Aug 2024 19:14:48 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=280913

--- Comment #4 from Harald Schmalzbauer <bugzilla.freebsd@omnilan.de> ---
(In reply to crest from comment #3)
Good point.  But this patch for syncdhcpif() of /etc/network.subr is not really
affected, since $1 in syncdhcpif() was passed unquoted from ifconfig_up() which
in turn got it from ifn_start() as unquoted parameter ${ifn}.

get_if_var() uses ltr() to normalize IF.  From a quick look, only IFNAME
consisting of the four ".-/+" punctuation characters are valid, which are
unconditionally replaced by the underscore character.  rc(8) would break far
earlier if somebody manually renamed the interface to anything allowed by the
core struct (if not prevented by ifconfig(8)) and tries to non-maually attach
dhclient to it.

For consistency reasons I'd prefer to keep it unquoted since I see no
possibility that $1 can ever be anything else than shell variable characters
(get_if_var() would fail to return any of the DHCP pseudo-args, so syncdhcpif()
wouldn't be called).  The wrong whitespace indention bothers me more ;-)

Thanks for looking at it!

-- 
You are receiving this mail because:
You are the assignee for the bug.