if (port->vlan < 0) {
dst->vlan = m->out_vlan;
}
- if (dst->dp_ifidx == ntohs(flow->in_port)) {
+ if (dst->dp_ifidx == flow->in_port) {
if (dst->vlan == vlan) {
/* Don't send out input port on same VLAN. */
continue;
process_flow(struct bridge *br, const flow_t *flow,
struct received_packet *pkt)
{
- uint16_t in_ifidx = ntohs(flow->in_port);
struct iface *in_iface;
struct port *in_port;
struct port *out_port = NULL; /* By default, drop the packet/flow. */
int vlan;
/* Find the interface and port structure for the received packet. */
- in_iface = iface_from_dp_ifidx(br, in_ifidx);
+ in_iface = iface_from_dp_ifidx(br, flow->in_port);
if (!in_iface) {
/* No interface? Something fishy... */
struct ft_flow *f = ft_lookup(br->ft, flow, flow_hash(flow, 0));
*/
static struct vlog_rate_limit rl = VLOG_RATE_LIMIT_INIT(1, 5);
VLOG_WARN_RL(&rl, "bridge %s: received packet on unknown "
- "interface %"PRIu16, br->name, in_ifidx);
+ "interface %"PRIu16, br->name, flow->in_port);
queue_tx(br, make_add_flow(flow, pkt->buffer_id,
bridge_idle_time(br), 0));
buf.data = opi->data;
pkt.buf = &buf;
pkt.buffer_id = ntohl(opi->buffer_id);
- flow_extract(&buf, ntohs(opi->in_port), &flow); /* XXX port number translation */
+ flow_extract(&buf, ntohs(opi->in_port), &flow);
if (opi->reason == OFPR_NO_MATCH) {
/* Delete any existing flow from the flow table. It must not really be
struct eth_header *eth;
struct llc_header *llc;
struct stp_port *sp;
- int in_ifidx;
/* Find the interface and port structure for the received packet. */
- in_ifidx = ntohs(flow->in_port);
- if (in_ifidx >= STP_MAX_PORTS) {
+ if (flow->in_port >= STP_MAX_PORTS) {
return;
}
- sp = stp_get_port(br->stp, in_ifidx);
+ sp = stp_get_port(br->stp, flow->in_port);
if (stp_port_get_state(sp) == STP_DISABLED) {
return;
}
payload.size = ntohs(eth->eth_type) + ETH_HEADER_LEN;
}
if (ofpbuf_try_pull(&payload, ETH_HEADER_LEN + LLC_HEADER_LEN)) {
- struct stp_port *p = stp_get_port(br->stp, ntohs(flow->in_port));
+ struct stp_port *p = stp_get_port(br->stp, flow->in_port);
stp_received_bpdu(p, payload.data, payload.size);
}
}