summaryrefslogtreecommitdiffstats
path: root/src/net/vlan.c
diff options
context:
space:
mode:
authorMichael Brown2010-12-01 18:15:52 +0100
committerMichael Brown2010-12-01 18:15:52 +0100
commit51a9e517f28a540d38f8da9f70607e4d8e9ffed5 (patch)
treed7b0c99b2fe9ee7c536fa5550a63a1eddd7af39e /src/net/vlan.c
parent[settings] Apply settings block name in register_settings() (diff)
downloadipxe-51a9e517f28a540d38f8da9f70607e4d8e9ffed5.tar.gz
ipxe-51a9e517f28a540d38f8da9f70607e4d8e9ffed5.tar.xz
ipxe-51a9e517f28a540d38f8da9f70607e4d8e9ffed5.zip
[vlan] Use "-" instead of "." as separator in VLAN device names
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>
Diffstat (limited to 'src/net/vlan.c')
-rw-r--r--src/net/vlan.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/net/vlan.c b/src/net/vlan.c
index b16c6934..4440fd84 100644
--- a/src/net/vlan.c
+++ b/src/net/vlan.c
@@ -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 */