From 3097b99f33b14b6bc66876e908653424ddf62687 Mon Sep 17 00:00:00 2001 From: Justin Pettit Date: Tue, 17 Mar 2009 14:51:45 -0700 Subject: [PATCH] Read netflow config from vswitchd.conf (Bug #1087). The bridge wasn't reading the netflow configuration from vswitchd.conf, so it was never generating NetFlow messages. This fixes that. --- vswitchd/bridge.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/vswitchd/bridge.c b/vswitchd/bridge.c index faa400d1..9072b994 100644 --- a/vswitchd/bridge.c +++ b/vswitchd/bridge.c @@ -437,6 +437,7 @@ bridge_reconfigure(void) struct iface *local_iface = NULL; uint8_t ea[8]; uint64_t dpid; + struct svec nf_hosts; for (j = 0; j < port->n_ifaces; ) { struct iface *iface = port->ifaces[j]; @@ -479,6 +480,15 @@ bridge_reconfigure(void) } ofproto_set_datapath_id(br->ofproto, dpid); + /* Set NetFlow configuration on this bridge. */ + svec_init(&nf_hosts); + cfg_get_all_keys(&nf_hosts, "netflow.%s.host", br->name); + svec_print(&nf_hosts, "Netflow"); + if (ofproto_set_netflow(br->ofproto, &nf_hosts)) { + VLOG_ERR("bridge %s: problem setting netflow collectors", + br->name); + } + /* Set the controller. (It would be more straightforward to do * this in bridge_reconfigure_one(), but then the * ofproto_set_datapath_id() above would disconnect right away, and -- 2.30.2