static void queue_tx(struct lswitch *, struct rconn *, struct ofpbuf *);
static void send_features_request(struct lswitch *, struct rconn *);
-static void send_default_flows(struct lswitch *sw, struct rconn *rconn,
+static void send_default_flows(struct lswitch *sw, struct rconn *rconn,
FILE *default_flows);
typedef void packet_handler_func(struct lswitch *, struct rconn *, void *);
}
static void
-send_default_flows(struct lswitch *sw, struct rconn *rconn,
+send_default_flows(struct lswitch *sw, struct rconn *rconn,
FILE *default_flows)
{
char line[1024];
uint16_t priority, idle_timeout, hard_timeout;
uint64_t cookie;
struct ofp_match match;
-
+
char *comment;
-
+
/* Delete comments. */
comment = strchr(line, '#');
- if (comment) {
+ if (comment) {
*comment = '\0';
}
-
+
/* Drop empty lines. */
if (line[strspn(line, " \t\n")] == '\0') {
continue;
- }
-
+ }
+
/* Parse and send. str_to_flow() will expand and reallocate the data
* in 'buffer', so we can't keep pointers to across the str_to_flow()
* call. */
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;