/* Learn the source MAC. */
if (mac_learning_may_learn(sw->ml, flow->dl_src, 0)) {
struct mac_entry *mac = mac_learning_insert(sw->ml, flow->dl_src, 0);
- if (mac_entry_is_new(mac) || mac->port != flow->in_port) {
+ if (mac_entry_is_new(mac) || mac->port.i != flow->in_port) {
VLOG_DBG_RL(&rl, "%016llx: learned that "ETH_ADDR_FMT" is on "
"port %"PRIu16, sw->datapath_id,
ETH_ADDR_ARGS(flow->dl_src), flow->in_port);
- mac->port = flow->in_port;
+ mac->port.i = flow->in_port;
mac_learning_changed(sw->ml, mac);
}
}
mac = mac_learning_lookup(sw->ml, flow->dl_dst, 0, NULL);
if (mac) {
- out_port = mac->port;
+ out_port = mac->port.i;
if (out_port == flow->in_port) {
/* Don't send a packet back out its input port. */
return OFPP_NONE;
struct mac_entry *src_mac;
src_mac = mac_learning_insert(ofproto->ml, flow->dl_src, 0);
- if (mac_entry_is_new(src_mac) || src_mac->port != flow->in_port) {
+ if (mac_entry_is_new(src_mac) || src_mac->port.i != flow->in_port) {
/* The log messages here could actually be useful in debugging,
* so keep the rate limit relatively high. */
static struct vlog_rate_limit rl = VLOG_RATE_LIMIT_INIT(30, 300);
ofproto_revalidate(ofproto,
mac_learning_changed(ofproto->ml, src_mac));
- src_mac->port = flow->in_port;
+ src_mac->port.i = flow->in_port;
}
}
flood_packets(ofproto, flow->in_port, OFPPC_NO_FLOOD,
nf_output_iface, odp_actions);
} else {
- int out_port = dst_mac->port;
+ int out_port = dst_mac->port.i;
if (out_port != flow->in_port) {
nl_msg_put_u32(odp_actions, ODP_ACTION_ATTR_OUTPUT, out_port);
*nf_output_iface = out_port;
ds_put_cstr(&ds, " port VLAN MAC Age\n");
LIST_FOR_EACH (e, lru_node, &br->ml->lrus) {
- if (e->port < 0 || e->port >= br->n_ports) {
+ if (e->port.i < 0 || e->port.i >= br->n_ports) {
continue;
}
ds_put_format(&ds, "%5d %4d "ETH_ADDR_FMT" %3d\n",
- port_get_an_iface(br->ports[e->port])->dp_ifidx,
+ port_get_an_iface(br->ports[e->port.i])->dp_ifidx,
e->vlan, ETH_ADDR_ARGS(e->mac), mac_entry_age(e));
}
unixctl_command_reply(conn, 200, ds_cstr(&ds));
}
}
- if (mac_entry_is_new(mac) || mac->port != in_port->port_idx) {
+ if (mac_entry_is_new(mac) || mac->port.i != in_port->port_idx) {
/* The log messages here could actually be useful in debugging,
* so keep the rate limit relatively high. */
static struct vlog_rate_limit rl = VLOG_RATE_LIMIT_INIT(30, 300);
br->name, ETH_ADDR_ARGS(flow->dl_src),
in_port->name, vlan);
- mac->port = in_port->port_idx;
+ mac->port.i = in_port->port_idx;
ofproto_revalidate(br->ofproto, mac_learning_changed(br->ml, mac));
}
}
* reflections on bond slaves. If this is the case, just drop the
* packet now. */
mac = mac_learning_lookup(br->ml, flow->dl_src, vlan, NULL);
- if (mac && mac->port != in_port->port_idx &&
+ if (mac && mac->port.i != in_port->port_idx &&
(!is_gratuitous_arp(flow) || mac_entry_is_grat_arp_locked(mac))) {
return false;
}
/* Determine output port. */
mac = mac_learning_lookup(br->ml, flow->dl_dst, vlan, tags);
- if (mac && mac->port >= 0 && mac->port < br->n_ports) {
- out_port = br->ports[mac->port];
+ if (mac && mac->port.i >= 0 && mac->port.i < br->n_ports) {
+ out_port = br->ports[mac->port.i];
} else if (!packet && !eth_addr_is_multicast(flow->dl_dst)) {
/* If we are revalidating but don't have a learning entry then
* eject the flow. Installing a flow that floods packets opens
struct flow flow;
int retval;
- if (e->port == port->port_idx) {
+ if (e->port.i == port->port_idx) {
continue;
}
memcpy(flow.dl_src, me->mac, ETH_ADDR_LEN);
if (bond_hash_src(me->mac, me->vlan) == hash
- && me->port != port->port_idx
+ && me->port.i != port->port_idx
&& choose_output_iface(port, &flow, me->vlan,
&dp_ifidx, &tags)
&& dp_ifidx == iface->dp_ifidx)