ds_put_cstr(&ds, " port VLAN MAC Age\n");
LIST_FOR_EACH (e, lru_node, &br->ml->lrus) {
- if (e->port.i < 0 || e->port.i >= br->n_ports) {
- continue;
- }
+ struct port *port = e->port.p;
ds_put_format(&ds, "%5d %4d "ETH_ADDR_FMT" %3d\n",
- port_get_an_iface(br->ports[e->port.i])->dp_ifidx,
+ port_get_an_iface(port)->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.i != in_port->port_idx) {
+ if (mac_entry_is_new(mac) || mac->port.p != 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);
br->name, ETH_ADDR_ARGS(flow->dl_src),
in_port->name, vlan);
- mac->port.i = in_port->port_idx;
+ mac->port.p = in_port;
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.i != in_port->port_idx &&
+ if (mac && mac->port.p != in_port &&
(!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.i >= 0 && mac->port.i < br->n_ports) {
- out_port = br->ports[mac->port.i];
+ if (mac) {
+ mac = mac->port.p;
} 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.i == port->port_idx) {
+ if (e->port.p == port) {
continue;
}
memcpy(flow.dl_src, me->mac, ETH_ADDR_LEN);
if (bond_hash_src(me->mac, me->vlan) == hash
- && me->port.i != port->port_idx
+ && me->port.p != port
&& choose_output_iface(port, &flow, me->vlan,
&dp_ifidx, &tags)
&& dp_ifidx == iface->dp_ifidx)