static void bundle_run(struct ofbundle *);
static void bundle_wait(struct ofbundle *);
static struct ofbundle *lookup_input_bundle(struct ofproto_dpif *,
- uint16_t in_port, bool warn);
+ uint16_t in_port, bool warn,
+ struct ofport_dpif **in_ofportp);
/* A controller may use OFPP_NONE as the ingress port to indicate that
* it did not arrive on a "real" port. 'ofpp_none_bundle' exists for
size_t left;
in_bundle = lookup_input_bundle(ctx->ofproto, orig_flow->in_port,
- ctx->packet != NULL);
+ ctx->packet != NULL, NULL);
if (!in_bundle) {
return;
}
}
static struct ofbundle *
-lookup_input_bundle(struct ofproto_dpif *ofproto, uint16_t in_port, bool warn)
+lookup_input_bundle(struct ofproto_dpif *ofproto, uint16_t in_port, bool warn,
+ struct ofport_dpif **in_ofportp)
{
struct ofport_dpif *ofport;
- /* Special-case OFPP_NONE, which a controller may use as the ingress
- * port for traffic that it is sourcing. */
- if (in_port == OFPP_NONE) {
- return &ofpp_none_bundle;
- }
-
/* Find the port and bundle for the received packet. */
ofport = get_ofp_port(ofproto, in_port);
+ if (in_ofportp) {
+ *in_ofportp = ofport;
+ }
if (ofport && ofport->bundle) {
return ofport->bundle;
}
+ /* Special-case OFPP_NONE, which a controller may use as the ingress
+ * port for traffic that it is sourcing. */
+ if (in_port == OFPP_NONE) {
+ return &ofpp_none_bundle;
+ }
+
/* Odd. A few possible reasons here:
*
* - We deleted a port but there are still a few packets queued up
ctx->has_normal = true;
in_bundle = lookup_input_bundle(ctx->ofproto, ctx->flow.in_port,
- ctx->packet != NULL);
+ ctx->packet != NULL, &in_port);
if (!in_bundle) {
return;
}
- /* We know 'in_port' exists unless it is "ofpp_none_bundle",
- * since lookup_input_bundle() succeeded. */
- in_port = get_ofp_port(ctx->ofproto, ctx->flow.in_port);
-
/* Drop malformed frames. */
if (ctx->flow.dl_type == htons(ETH_TYPE_VLAN) &&
!(ctx->flow.vlan_tci & htons(VLAN_CFI))) {