bool
fail_open_handle_flow_miss(struct fail_open *fo, struct ofproto *ofproto,
- uint16_t in_port, const flow_t *flow,
- const struct ofpbuf *payload)
+ const flow_t *flow, const struct ofpbuf *payload)
{
/* -1 (FLOOD) is coincidentally the value returned by mac_learning_lookup()
* when it doesn't have a entry for that address. */
return false;
}
- if (mac_learning_learn(fo->mac_learning, flow->dl_src, 0, in_port)) {
+ if (mac_learning_learn(fo->mac_learning, flow->dl_src, 0, flow->in_port)) {
static struct vlog_rate_limit rl = VLOG_RATE_LIMIT_INIT(30, 300);
VLOG_DBG_RL(&rl, "learned that "ETH_ADDR_FMT" is on port %"PRIu16,
- ETH_ADDR_ARGS(flow->dl_src), in_port);
+ ETH_ADDR_ARGS(flow->dl_src), flow->in_port);
}
out_port = (eth_addr_is_reserved(flow->dl_src) ? DROP
memset(&action, 0, sizeof action);
action.output.type = htons(OFPAT_OUTPUT);
action.output.len = htons(sizeof action);
- if (in_port == out_port || out_port == DROP) {
+ if (flow->in_port == out_port || out_port == DROP) {
/* Set up a flow to drop packets. */
ofproto_add_flow(ofproto, flow, 0, UINT16_MAX, NULL, 0, NULL, -1);
} else if (out_port != FLOOD) {
bool
in_band_handle_flow_miss(struct in_band *in_band, struct ofproto *ofproto,
- uint16_t in_port, const flow_t *flow,
- const struct ofpbuf *payload)
+ const flow_t *flow, const struct ofpbuf *payload)
{
/* -1 (FLOOD) is coincidentally the value returned by mac_learning_lookup()
* when it doesn't have a entry for that address. */
int out_port;
/* Deal with local stuff. */
- if (in_port == ODPP_LOCAL) {
+ if (flow->in_port == ODPP_LOCAL) {
/* Sent by secure channel. */
out_port = mac_learning_lookup(in_band->mac_learning, flow->dl_dst, 0);
} else if (eth_addr_equals(flow->dl_dst,
netdev_get_etheraddr(in_band->netdev))) {
/* Sent to secure channel. */
out_port = ODPP_LOCAL;
- in_band_learn_mac(in_band, in_port, flow->dl_src);
+ in_band_learn_mac(in_band, flow->in_port, flow->dl_src);
} else if (flow->dl_type == htons(ETH_TYPE_ARP)
&& eth_addr_is_broadcast(flow->dl_dst)
&& is_controller_mac(flow->dl_src, in_band)) {
flow->tp_dst == htons(OFP_TCP_PORT) ||
flow->tp_dst == htons(OFP_SSL_PORT))) {
/* Traffic to or from controller. Switch it by hand. */
- in_band_learn_mac(in_band, in_port, flow->dl_src);
+ in_band_learn_mac(in_band, flow->in_port, flow->dl_src);
out_port = mac_learning_lookup(in_band->mac_learning, flow->dl_dst, 0);
} else {
const uint8_t *controller_mac = get_controller_mac(in_band);
/* ARP sent by controller. */
out_port = FLOOD;
} else if (is_controller_mac(flow->dl_dst, in_band)
- && in_port == mac_learning_lookup(in_band->mac_learning,
- controller_mac, 0)) {
+ && flow->in_port == mac_learning_lookup(
+ in_band->mac_learning, controller_mac, 0)) {
/* Drop controller traffic that arrives on the controller port. */
out_port = DROP;
} else {
memset(&action, 0, sizeof action);
action.output.type = htons(OFPAT_OUTPUT);
action.output.len = htons(sizeof action);
- if (in_port == out_port || out_port == DROP) {
+ if (flow->in_port == out_port || out_port == DROP) {
/* Set up a flow to drop packets. */
ofproto_add_flow(ofproto, flow, 0, UINT16_MAX, NULL, 0, NULL, -1);
} else if (out_port != FLOOD) {
} else {
/* We don't know that MAC. Send along the packet without setting up a
* flow. */
- action.type = htons(OFPAT_OUTPUT);
action.output.port = htons(OFPP_FLOOD);
ofproto_send_packet(ofproto, flow, &action, 1, payload);
}