Skip to content

Commit

Permalink
program.ipfix: use Tap app features for setting exporter src MAC and …
Browse files Browse the repository at this point in the history
…sysctls
  • Loading branch information
eugeneia committed May 19, 2022
1 parent 8a5d3e2 commit 11bbb49
Showing 1 changed file with 2 additions and 15 deletions.
17 changes: 2 additions & 15 deletions src/program/ipfix/lib.lua
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,8 @@ function configure_graph (arg, in_graph)
if config.output_type == "tap_routed" then
local tap_config = out_app[2]
tap_config.mtu = config.mtu
tap_config.overwrite_src_mac = true
tap_config.forwarding = true
end

local ipfix_config = mk_ipfix_config(config)
Expand Down Expand Up @@ -268,21 +270,6 @@ function setup_graph_ifmib_mac (graph, config)
config.log_date)
end

if config.output_type == "tap_routed" then
local tap_config = out_app[2]
local name = tap_config.name
local tap_sysctl_base = "net/ipv4/conf/"..name
assert(S.sysctl(tap_sysctl_base.."/rp_filter", '0'))
assert(S.sysctl(tap_sysctl_base.."/accept_local", '1'))
assert(S.sysctl(tap_sysctl_base.."/forwarding", '1'))
local out_stats = engine.app_table[out_name].shm
local ipfix_config = mk_ipfix_config(config)
ipfix_config.exporter_eth_dst =
tostring(macaddress:new(counter.read(out_stats.macaddr)))
app_graph.app(graph, ipfix_name, ipfix.IPFIX, ipfix_config)
engine.configure(graph)
end

return graph, config
end

Expand Down

0 comments on commit 11bbb49

Please sign in to comment.