X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=lib%2Flearning-switch.c;h=4e7645d7cf7d7fcada11d680aa210c93b0fa7623;hb=aed133bf9bce8f35b666c3052907f525c803c83b;hp=88a8618c8849ec8b983f5c2ae8b52c4dc000b46c;hpb=6699af68e60e0d03671d1424a5f53258928b16d4;p=openvswitch diff --git a/lib/learning-switch.c b/lib/learning-switch.c index 88a8618c..4e7645d7 100644 --- a/lib/learning-switch.c +++ b/lib/learning-switch.c @@ -63,7 +63,7 @@ static struct vlog_rate_limit rl = VLOG_RATE_LIMIT_INIT(30, 300); 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 *); @@ -220,10 +220,10 @@ lswitch_process_packet(struct lswitch *sw, struct rconn *rconn, } } if (VLOG_IS_DBG_ENABLED()) { - char *p = ofp_to_string(msg->data, msg->size, 2); + char *s = ofp_to_string(msg->data, msg->size, 2); VLOG_DBG_RL(&rl, "%016llx: OpenFlow packet ignored: %s", - sw->datapath_id, p); - free(p); + sw->datapath_id, s); + free(s); } } @@ -249,7 +249,7 @@ send_features_request(struct lswitch *sw, struct rconn *rconn) } 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]; @@ -260,20 +260,20 @@ send_default_flows(struct lswitch *sw, struct rconn *rconn, 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. */