]> git.ipfire.org Git - thirdparty/ipxe.git/commitdiff
[vlan] Use "-" instead of "." as separator in VLAN device names
authorMichael Brown <mcb30@ipxe.org>
Wed, 1 Dec 2010 17:15:52 +0000 (17:15 +0000)
committerMichael Brown <mcb30@ipxe.org>
Wed, 1 Dec 2010 17:15:52 +0000 (17:15 +0000)
VLAN device names have the form "netX.Y", e.g. "net0.5" for VLAN 5 on
net0.  This use of "." conflicts with the use of "." as the
hierarchical separator in settings block names, with the result that
VLAN device settings cannot be accessed by name.

It would be trivial to treat the VLAN device settings as being a child
of the trunk device settings, but this would cause the VLAN device
settings to be applied to the trunk device: for example, setting
"net0.5/ip" would then apply the IP address to both net0.5 and net0.

Fix by changing the VLAN device name to use "-" instead of ".": the
VLAN device "net0.5" is now "net0-5".

Signed-off-by: Michael Brown <mcb30@ipxe.org>
src/net/vlan.c

index b16c6934bac1ac94bf72778f24f5015eed2451ba..4440fd84f3226a1cbf5b7eeb8f59a87f8d0b2909 100644 (file)
@@ -362,7 +362,7 @@ int vlan_create ( struct net_device *trunk, unsigned int tag,
        vlan->priority = priority;
 
        /* Construct VLAN device name */
-       snprintf ( netdev->name, sizeof ( netdev->name ), "%s.%d",
+       snprintf ( netdev->name, sizeof ( netdev->name ), "%s-%d",
                   trunk->name, vlan->tag );
 
        /* Register VLAN device */