secchan: Update byte, packet counts for packets switched by hand.
authorBen Pfaff <blp@nicira.com>
Wed, 29 Apr 2009 22:27:46 +0000 (15:27 -0700)
committerBen Pfaff <blp@nicira.com>
Fri, 1 May 2009 17:55:28 +0000 (10:55 -0700)
Sometimes packets can get passed down to userspace, in which case secchan
has to send them using dpif_execute().  When this happened we weren't
updating the packet or byte counters.  Fix this.

secchan/ofproto.c

index 07629a935cbfd5e974b50f3226879631f7352e44..b0cdec450e99c69c61537316aa64a3f3465945e3 100644 (file)
@@ -2870,8 +2870,11 @@ handle_odp_msg(struct ofproto *p, struct ofpbuf *packet)
     }
 
     /* Execute subrule on packet. */
-    dpif_execute(&p->dpif, msg->port, subrule->odp_actions,
-                 subrule->n_odp_actions, &payload);
+    if (!dpif_execute(&p->dpif, msg->port, subrule->odp_actions,
+                      subrule->n_odp_actions, &payload)) {
+        subrule->packet_count++;
+        subrule->byte_count += payload.size;
+    }
     ofpbuf_delete(packet);
 }
 \f