HomeFreeBSD

ifconfig: Redo fix vlan/vlanproto reconfiguration

Description

ifconfig: Redo fix vlan/vlanproto reconfiguration

When the if_vlan(4) interface has not been fully configured, i.e., a
bare interface without a physical interface associated with it,
retrieving the current settings of it and unconditionally overwriting
params will result in losing vlandev settings in params. That will
lead to failing to associate the if_vlan(4) interface with the requested
physical interface and the false report 'both vlan and vlandev must be
specified'.

Fix that by checking if the vlan interface has been fully configured.

The basic VLAN test is slightly modified to cover this case.

PR: 279181
Reviewed by: kp
Tested by: Mike Tancsa <mike@sentex.net>
Fixes: b82b8055ad44 ifconfig: fix vlan/vlanproto reconfiguration
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D45283