ofproto: Fix behavior when special_cb not present (as with ovs-openflowd).
authorBen Pfaff <blp@nicira.com>
Thu, 17 Feb 2011 23:04:44 +0000 (15:04 -0800)
committerBen Pfaff <blp@nicira.com>
Fri, 18 Feb 2011 00:04:08 +0000 (16:04 -0800)
The special_cb hook allows ofproto's client to intercept packets.  When
it is not present (as in ovs-openflowd), no packets need to be intercepted,
but ofproto implemented the opposite behavior.  This fixes the problem.

Reported-by: kk yap <yapkke@stanford.edu>
ofproto/ofproto.c

index 39d345736375efa04bf1a28a484507668ba0c79c..e4c3528aeef0e194e4422c35e9b42ffeca11beab 100644 (file)
@@ -3134,9 +3134,9 @@ xlate_actions(struct action_xlate_ctx *ctx,
     ctx->last_pop_priority = -1;
 
     if (!ctx->check_special
-        || (ctx->ofproto->ofhooks->special_cb
-            && ctx->ofproto->ofhooks->special_cb(&ctx->flow, ctx->packet,
-                                                 ctx->ofproto->aux))) {
+        || !ctx->ofproto->ofhooks->special_cb
+        || ctx->ofproto->ofhooks->special_cb(&ctx->flow, ctx->packet,
+                                             ctx->ofproto->aux)) {
         do_xlate_actions(in, n_in, ctx);
     } else {
         ctx->may_set_up_flow = false;