소스 검색

[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>
tags/v1.20.1
Michael Brown 14 년 전
부모
커밋
51a9e517f2
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1
    1
      src/net/vlan.c

+ 1
- 1
src/net/vlan.c 파일 보기

@@ -362,7 +362,7 @@ int vlan_create ( struct net_device *trunk, unsigned int tag,
362 362
 	vlan->priority = priority;
363 363
 
364 364
 	/* Construct VLAN device name */
365
-	snprintf ( netdev->name, sizeof ( netdev->name ), "%s.%d",
365
+	snprintf ( netdev->name, sizeof ( netdev->name ), "%s-%d",
366 366
 		   trunk->name, vlan->tag );
367 367
 
368 368
 	/* Register VLAN device */

Loading…
취소
저장