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: b82b8055ad ifconfig: fix vlan/vlanproto reconfiguration
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D45283
This commit is contained in:
@@ -22,8 +22,12 @@ basic_body()
|
||||
jexec alcatraz ifconfig ${epair_vlan}a up
|
||||
jexec alcatraz ifconfig ${vlan0} 10.0.0.1/24 up
|
||||
|
||||
vlan1=$(jexec singsing ifconfig vlan create vlandev ${epair_vlan}b \
|
||||
vlan 42)
|
||||
vlan1=$(jexec singsing ifconfig vlan create)
|
||||
|
||||
# Test associating the physical interface
|
||||
atf_check -s exit:0 \
|
||||
jexec singsing ifconfig ${vlan1} vlandev ${epair_vlan}b vlan 42
|
||||
|
||||
jexec singsing ifconfig ${epair_vlan}b up
|
||||
jexec singsing ifconfig ${vlan1} 10.0.0.2/24 up
|
||||
|
||||
@@ -37,7 +41,7 @@ basic_body()
|
||||
# And change back
|
||||
# Test changing the vlan ID
|
||||
atf_check -s exit:0 \
|
||||
jexec singsing ifconfig ${vlan1} vlandev ${epair_vlan}b vlan 42
|
||||
jexec singsing ifconfig ${vlan1} vlan 42 vlandev ${epair_vlan}b
|
||||
atf_check -s exit:0 -o ignore jexec singsing ping -c 1 10.0.0.1
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user