bin/137641: ifconfig(8): various problems with "vlan_device.vlan_id" syntax

Artis Caune artis.caune at gmail.com
Mon Aug 10 18:52:28 UTC 2009


2009/8/10 Artis Caune <artis.caune at gmail.com>:
> The following reply was made to PR bin/137641; it has been noted by GNATS.
>
>  Hi,
>
>  attached patch should fix automatic loading of if_vlan when creating
>  interface as device.vlan_id and vlan module is not loaded.

Here is a patch.




-- 
Artis Caune

    Everything should be made as simple as possible, but not simpler.
-------------- next part --------------
Index: ifconfig.c
===================================================================
--- ifconfig.c	(revision 196047)
+++ ifconfig.c	(working copy)
@@ -998,6 +998,10 @@
 			break;
 		}
 
+	/* try to load vlan module if interface name is device.vlan_id */
+	if (index(name, '.') != NULL)
+		strlcpy(ifname, "vlan", sizeof(ifname));
+
 	/* turn interface and unit into module name */
 	strcpy(ifkind, "if_");
 	strlcpy(ifkind + MOD_PREFIX_LEN, ifname,


More information about the freebsd-net mailing list