Read netflow config from vswitchd.conf (Bug #1087).
authorJustin Pettit <jpettit@nicira.com>
Tue, 17 Mar 2009 21:51:45 +0000 (14:51 -0700)
committerJustin Pettit <jpettit@nicira.com>
Tue, 17 Mar 2009 21:51:45 +0000 (14:51 -0700)
The bridge wasn't reading the netflow configuration from vswitchd.conf,
so it was never generating NetFlow messages.  This fixes that.

vswitchd/bridge.c

index faa400d144fb84b3ed40581591382f1e34ca63a1..9072b99446600686330a7a323e71bf815108f3e3 100644 (file)
@@ -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