From: Ben Pfaff Date: Wed, 29 Apr 2009 22:27:46 +0000 (-0700) Subject: secchan: Update byte, packet counts for packets switched by hand. X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f41a6212c948e179b26ad6ec5053ff94ece3683a;p=openvswitch secchan: Update byte, packet counts for packets switched by hand. 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. --- diff --git a/secchan/ofproto.c b/secchan/ofproto.c index 07629a93..b0cdec45 100644 --- a/secchan/ofproto.c +++ b/secchan/ofproto.c @@ -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); }