Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

virtual_ether_mux: Treat vlan=0 as vlan=nil #1206

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions src/lib/io/virtual_ether_mux.lua
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,15 @@ function configure (c, ports, io)
local name = port_name(port)
local Switch_link = Switch.."."..name
local Port_tx, Port_rx = Switch_link, Switch_link
if port.vlan then
local vlan = port.vlan
-- Backwards compat: VLAN 0 is accepted by nfvconfig but is not valid.
if vlan == 0 then vlan = nil end
if vlan then
local VlanTag, VlanUntag = name.."_VlanTag", name.."_VlanUntag"
config.app(c, VlanTag, vlan.Tagger, {tag = port.vlan})
config.app(c, VlanTag, vlan.Tagger, {tag = vlan})
config.link(c, VlanTag..".output -> "..Port_rx)
Port_rx = VlanTag..".input"
config.app(c, VlanUntag, vlan.Untagger, {tag = port.vlan})
config.app(c, VlanUntag, vlan.Untagger, {tag = vlan})
config.link(c, Port_tx.." -> "..VlanUntag..".input")
Port_tx = VlanUntag..".output"
end
Expand All @@ -86,11 +89,14 @@ function configureVMDq (c, device, ports)
end
vmdq = false
end
local vlan = port.vlan
-- Backwards compat: VLAN 0 is accepted by nfvconfig but is not valid.
if vlan == 0 then vlan = nil end
config.app(c, NIC, require(device.driver).driver,
{pciaddr = device.pciaddress,
vmdq = vmdq,
macaddr = port.mac_address,
vlan = port.vlan})
vlan = vlan})
links[i] = {input = NIC..".rx", output = NIC..".tx"}
end
return links
Expand Down