freebsd-src/sbin/ifconfig
Zhenlei Huang 76df3c57a0 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
2024-05-22 00:35:01 +08:00
..
tests Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
af_inet.c netlink: cope with growing requests 2023-10-17 08:47:52 +02:00
af_inet6.c netlink: cope with growing requests 2023-10-17 08:47:52 +02:00
af_link.c Purge more stray embedded $FreeBSD$ strings 2023-09-25 07:54:56 -07:00
af_nd6.c Purge more stray embedded $FreeBSD$ strings 2023-09-25 07:54:56 -07:00
carp.c carp: support VRRPv3 2024-05-08 13:19:03 +02:00
ifbridge.c ifconfig: add static bridge addresses for vlan 0, not 1 2023-10-15 16:21:53 +02:00
ifclone.c Purge more stray embedded $FreeBSD$ strings 2023-09-25 07:54:56 -07:00
ifconfig.8 ifconfig: Markup nits. 2024-05-15 15:38:53 +02:00
ifconfig.c ifconfig: Add format shortcuts. 2024-05-14 08:51:50 +02:00
ifconfig.h ifconfig: add -D option to print driver name for interface 2023-11-28 13:47:37 -06:00
ifconfig_netlink.c ifconfig: add -D option to print driver name for interface 2023-11-28 13:47:37 -06:00
ifconfig_netlink.h ifconfig: make interface and address listing use Netlink as transport 2023-05-16 19:39:13 +00:00
iffib.c Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:16 -06:00
ifgif.c Purge more stray embedded $FreeBSD$ strings 2023-09-25 07:54:56 -07:00
ifgre.c sbin: Automated cleanup of cdefs and other formatting 2023-11-26 22:23:59 -07:00
ifgroup.c Purge more stray embedded $FreeBSD$ strings 2023-09-25 07:54:56 -07:00
ifieee80211.c ifconfig(8): Fix two typos in source code comments 2024-04-20 14:01:23 +02:00
ifipsec.c sbin: Automated cleanup of cdefs and other formatting 2023-11-26 22:23:59 -07:00
iflagg.c Purge more stray embedded $FreeBSD$ strings 2023-09-25 07:54:56 -07:00
ifmac.c Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:16 -06:00
ifmedia.c Remove $FreeBSD$: one-line .c comment pattern 2023-08-16 11:54:29 -06:00
ifpfsync.c Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:16 -06:00
ifstf.c ifconfig: remove (most of) the usages of global 'struct ifreq ifr'. 2023-06-16 07:19:21 +00:00
ifvlan.c ifconfig: Redo fix vlan/vlanproto reconfiguration 2024-05-22 00:35:01 +08:00
ifvxlan.c sbin: Automated cleanup of cdefs and other formatting 2023-11-26 22:23:59 -07:00
Makefile sbin: Remove ancient SCCS tags. 2023-11-26 22:23:29 -07:00
Makefile.depend Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
Makefile.depend.options Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
sfp.c Purge more stray embedded $FreeBSD$ strings 2023-09-25 07:54:56 -07:00