Improve secchan.8 manpage.
[sliver-openvswitch.git] / secchan / ratelimit.c
index 5f0da2d..7a1e495 100644 (file)
@@ -36,7 +36,7 @@
 #include <arpa/inet.h>
 #include <stdlib.h>
 #include "ofpbuf.h"
-#include "openflow.h"
+#include "openflow/openflow.h"
 #include "poll-loop.h"
 #include "queue.h"
 #include "rconn.h"
@@ -160,6 +160,13 @@ rate_limit_local_packet_cb(struct relay *r, void *rl_)
         return false;
     }
 
+    if (opi->reason == OFPR_ACTION) {
+        /* Don't rate-limit 'ofp-packet_in's generated by flows that the
+         * controller set up.  XXX we should really just rate-limit them
+         * *separately* so that no one can flood the controller this way. */
+        return false;
+    }
+
     if (!rl->n_queued && get_token(rl)) {
         /* In the common case where we are not constrained by the rate limit,
          * let the packet take the normal path. */
@@ -237,8 +244,7 @@ static struct hook_class rate_limit_hook_class = {
 
 void
 rate_limit_start(struct secchan *secchan, const struct settings *s,
-                 struct switch_status *ss,
-                 struct rconn *local, struct rconn *remote)
+                 struct switch_status *ss, struct rconn *remote)
 {
     struct rate_limiter *rl;
     size_t i;