Skip to content

Commit

Permalink
Backport vlan id parsing fix.
Browse files Browse the repository at this point in the history
  • Loading branch information
teclator committed Dec 20, 2016
1 parent f7db4bb commit a631c0d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/include/network/lan/hardware.rb
Original file line number Diff line number Diff line change
Expand Up @@ -810,6 +810,8 @@ def validate_hw(_key, _event)
true
end

VLAN_SIZE = 4 # size of vlanN prefix without number

def storeHW(_key, _event)
if isNewDevice
nm = devname_from_hw_dialog
Expand All @@ -829,7 +831,7 @@ def storeHW(_key, _event)
end
if LanItems.type == "vlan"
# for vlan devices named vlanN pre-set vlan_id to N, otherwise default to 0
LanItems.vlan_id = "#{nm["vlan".size].to_i}"
LanItems.vlan_id = nm[VLAN_SIZE..-1]
end
end

Expand Down

0 comments on commit a631c0d

Please sign in to comment.