From f41a6212c948e179b26ad6ec5053ff94ece3683a Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Wed, 29 Apr 2009 15:27:46 -0700 Subject: [PATCH] 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. --- secchan/ofproto.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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); } -- 2.30.2