[ovs-dev] [PATCH 3/3] learning-switch: Ignore "packet_in"s caused by OFPP_CONTROLLER actions.

Ben Pfaff blp at nicira.com
Tue Aug 10 18:24:38 UTC 2010


It seems best to ignore "packet_in"s caused by OFPP_CONTROLLER actions in
learning-switch, since someone might be experimenting and it's best not
to interfere with that.
---
 lib/learning-switch.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/lib/learning-switch.c b/lib/learning-switch.c
index aba3525..49f5604 100644
--- a/lib/learning-switch.c
+++ b/lib/learning-switch.c
@@ -522,6 +522,13 @@ process_packet_in(struct lswitch *sw, struct rconn *rconn, void *opi_)
     struct ofpbuf pkt;
     flow_t flow;
 
+    /* Ignore packets sent via output to OFPP_CONTROLLER.  This library never
+     * uses such an action.  You never know what experiments might be going on,
+     * though, and it seems best not to interfere with them. */
+    if (opi->reason != OFPR_NO_MATCH) {
+        return;
+    }
+
     /* Extract flow data from 'opi' into 'flow'. */
     pkt_ofs = offsetof(struct ofp_packet_in, data);
     pkt_len = ntohs(opi->header.length) - pkt_ofs;
-- 
1.7.1





More information about the dev mailing list