Skip to content

Commit 37225a4

Browse files
authored
check for adding default vlan attempt added (sonic-net#2075)
*CLI throws an error specifying the user that Vlan 1 is default VLAN. Fix Orchagent crash.
1 parent c65de65 commit 37225a4

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

config/vlan.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@ def add_vlan(db, vid):
2424
ctx.fail("Invalid VLAN ID {} (1-4094)".format(vid))
2525

2626
vlan = 'Vlan{}'.format(vid)
27+
28+
if vid == 1:
29+
ctx.fail("{} is default VLAN".format(vlan))
30+
2731
if clicommon.check_if_vlanid_exist(db.cfgdb, vlan):
2832
ctx.fail("{} already exists".format(vlan))
2933

0 commit comments

Comments
 (0)