If ofproto decided to change the netdev of a particular ofport,
cfm_demand mode would improperly continue using the old netdev to
collect stats.
Bug #17583.
Signed-off-by: Ethan Jackson <ethan@nicira.com>
return true;
}
+/* Must be called when the netdev owned by 'cfm' should change. */
+void
+cfm_set_netdev(struct cfm *cfm, const struct netdev *netdev)
+{
+ if (cfm->netdev != netdev) {
+ cfm->netdev = netdev;
+ }
+}
+
/* Returns true if 'cfm' should process packets from 'flow'. */
bool
cfm_should_process_flow(const struct cfm *cfm, const struct flow *flow)
void cfm_compose_ccm(struct cfm *, struct ofpbuf *packet, uint8_t eth_src[6]);
void cfm_wait(struct cfm *);
bool cfm_configure(struct cfm *, const struct cfm_settings *);
+void cfm_set_netdev(struct cfm *, const struct netdev *);
bool cfm_should_process_flow(const struct cfm *cfm, const struct flow *);
void cfm_process_heartbeat(struct cfm *, const struct ofpbuf *packet);
int cfm_get_fault(const struct cfm *);
if (port->bundle && port->bundle->bond) {
bond_slave_set_netdev(port->bundle->bond, port, port->up.netdev);
}
+
+ if (port->cfm) {
+ cfm_set_netdev(port->cfm, port->up.netdev);
+ }
}
static void