Skip to content

Commit

Permalink
changed punt format to send both smac and dmac
Browse files Browse the repository at this point in the history
  • Loading branch information
capr committed Feb 1, 2016
1 parent 10bc534 commit 380eeec
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/program/lisper/lisper.lua
Original file line number Diff line number Diff line change
Expand Up @@ -268,14 +268,15 @@ end

local punt = {} --{{mac=,name=}, ...}

local function punt_mac(mac, ifname)
table.insert(punt, {mac = mac, ifname = ifname})
local function punt_mac(smac, dmac, ifname)
table.insert(punt, {smac = smac, dmac = dmac, ifname = ifname})
end

local function get_punt_message()
local t = table.remove(punt)
if not t then return end
local s = _('{"eid-prefix" : "%s", "interface" : "%s"}', macstr3(t.mac), t.ifname)
local s = _('{"source-eid" : "%s", "dest-eid" : "%s", "interface" : "%s"}',
macstr3(t.smac), macstr3(t.dmac), t.ifname)
log_punt(s)
return s
end
Expand Down Expand Up @@ -459,7 +460,7 @@ local function route_packet(p, rxname, txports)
if not slocs or slocs[1] ~= sloc then
locs[smac] = {sloc}
log_learn(iid, smac, sloc)
punt_mac(smac, rxname)
punt_mac(smac, dmac, rxname)
end
end

Expand Down

0 comments on commit 380eeec

Please sign in to comment.