bool
connmgr_may_set_up_flow(struct connmgr *mgr, const struct flow *flow,
+ uint32_t local_odp_port,
const struct nlattr *odp_actions,
size_t actions_len)
{
- return !mgr->in_band || in_band_rule_check(flow, odp_actions, actions_len);
+ return !mgr->in_band || in_band_rule_check(flow, local_odp_port,
+ odp_actions, actions_len);
}
\f
/* Fail-open and in-band implementation. */
bool connmgr_msg_in_hook(struct connmgr *, const struct flow *,
const struct ofpbuf *packet);
bool connmgr_may_set_up_flow(struct connmgr *, const struct flow *,
+ uint32_t local_odp_port,
const struct nlattr *odp_actions,
size_t actions_len);
/* Returns true if the rule that would match 'flow' with 'actions' is
* allowed to be set up in the datapath. */
bool
-in_band_rule_check(const struct flow *flow,
+in_band_rule_check(const struct flow *flow, uint32_t local_odp_port,
const struct nlattr *actions, size_t actions_len)
{
/* Don't allow flows that would prevent DHCP replies from being seen
NL_ATTR_FOR_EACH_UNSAFE (a, left, actions, actions_len) {
if (nl_attr_type(a) == OVS_ACTION_ATTR_OUTPUT
- && nl_attr_get_u32(a) == OVSP_LOCAL) {
+ && nl_attr_get_u32(a) == local_odp_port) {
return true;
}
}
bool in_band_msg_in_hook(struct in_band *, const struct flow *,
const struct ofpbuf *packet);
-bool in_band_rule_check(const struct flow *,
+bool in_band_rule_check(const struct flow *, uint32_t local_odp_port,
const struct nlattr *odp_actions, size_t actions_len);
#endif /* in-band.h */
error = netdev_get_stats(ofport->up.netdev, stats);
- if (!error && ofport->odp_port == OVSP_LOCAL) {
+ if (!error && ofport_->ofp_port == OFPP_LOCAL) {
struct ofproto_dpif *ofproto = ofproto_dpif_cast(ofport->up.ofproto);
/* ofproto->stats.tx_packets represents packets that we created
} else {
static struct vlog_rate_limit trace_rl = VLOG_RATE_LIMIT_INIT(1, 1);
ovs_be16 initial_tci = ctx->base_flow.vlan_tci;
+ uint32_t local_odp_port;
add_sflow_action(ctx);
do_xlate_actions(ofpacts, ofpacts_len, ctx);
}
}
+ local_odp_port = ofp_port_to_odp_port(ctx->ofproto, OFPP_LOCAL);
if (!connmgr_may_set_up_flow(ctx->ofproto->up.connmgr, &ctx->flow,
+ local_odp_port,
ctx->odp_actions->data,
ctx->odp_actions->size)) {
ctx->slow |= SLOW_IN_BAND;