An upcoming commit will want to pass a different command.
---
lib/ofp-parse.c | 6 +++---
lib/ofp-parse.h | 4 ++--
utilities/ovs-controller.c | 3 ++-
utilities/ovs-ofctl.c | 10 +++++-----
4 files changed, 12 insertions(+), 11 deletions(-)
diff --git a/lib/ofp-parse.c b/lib/ofp-parse.c
index 1c69d88..de7cd9c 100644
--- a/lib/ofp-parse.c
+++ b/lib/ofp-parse.c
@@ -871,8 +871,8 @@ parse_ofp_flow_mod_str(struct list *packets, enum
nx_flow_format *cur_format,
* 'stream' and the command is always OFPFC_ADD. Returns false if end-of-file
* is reached before reading a flow, otherwise true. */
bool
-parse_ofp_add_flow_file(struct list *packets, enum nx_flow_format *cur,
- FILE *stream)
+parse_ofp_flow_mod_file(struct list *packets, enum nx_flow_format *cur,
+ FILE *stream, uint16_t command)
{
struct ds s;
bool ok;
@@ -880,7 +880,7 @@ parse_ofp_add_flow_file(struct list *packets, enum
nx_flow_format *cur,
ds_init(&s);
ok = ds_get_preprocessed_line(&s, stream) == 0;
if (ok) {
- parse_ofp_flow_mod_str(packets, cur, ds_cstr(&s), OFPFC_ADD);
+ parse_ofp_flow_mod_str(packets, cur, ds_cstr(&s), command);
}
ds_destroy(&s);
diff --git a/lib/ofp-parse.h b/lib/ofp-parse.h
index 3132f16..c8cdade 100644
--- a/lib/ofp-parse.h
+++ b/lib/ofp-parse.h
@@ -34,8 +34,8 @@ void parse_ofp_str(struct flow_mod *, uint8_t *table_idx,
void parse_ofp_flow_mod_str(struct list *packets, enum nx_flow_format *cur,
char *string, uint16_t command);
-bool parse_ofp_add_flow_file(struct list *packets, enum nx_flow_format *cur,
- FILE *);
+bool parse_ofp_flow_mod_file(struct list *packets, enum nx_flow_format *cur,
+ FILE *, uint16_t command);
void parse_ofp_flow_stats_request_str(struct flow_stats_request *,
bool aggregate, char *string);
diff --git a/utilities/ovs-controller.c b/utilities/ovs-controller.c
index f5e5014..af9e11f 100644
--- a/utilities/ovs-controller.c
+++ b/utilities/ovs-controller.c
@@ -269,7 +269,8 @@ read_flow_file(const char *name)
}
flow_format = NXFF_OPENFLOW10;
- while (parse_ofp_add_flow_file(&default_flows, &flow_format, stream)) {
+ while (parse_ofp_flow_mod_file(&default_flows, &flow_format, stream,
+ OFPFC_ADD)) {
continue;
}
diff --git a/utilities/ovs-ofctl.c b/utilities/ovs-ofctl.c
index 2fe0bdd..4f2dc7f 100644
--- a/utilities/ovs-ofctl.c
+++ b/utilities/ovs-ofctl.c
@@ -705,7 +705,7 @@ do_add_flows(int argc OVS_UNUSED, char *argv[])
flow_format = set_initial_format_for_flow_mod(&requests);
open_vconn(argv[1], &vconn);
- while (parse_ofp_add_flow_file(&requests, &flow_format, file)) {
+ while (parse_ofp_flow_mod_file(&requests, &flow_format, file, OFPFC_ADD)) {
check_final_format_for_flow_mod(flow_format);
transact_multiple_noreply(vconn, &requests);
}
@@ -964,9 +964,9 @@ static bool
fte_version_equals(const struct fte_version *a, const struct fte_version *b)
{
return (a->cookie == b->cookie
- && a->idle_timeout != b->idle_timeout
- && a->hard_timeout != b->hard_timeout
- && a->n_actions != b->n_actions
+ && a->idle_timeout == b->idle_timeout
+ && a->hard_timeout == b->hard_timeout
+ && a->n_actions == b->n_actions
&& !memcmp(a->actions, b->actions,
a->n_actions * sizeof *a->actions));
}
@@ -1370,7 +1370,7 @@ do_parse_flows(int argc OVS_UNUSED, char *argv[])
}
list_init(&packets);
- while (parse_ofp_add_flow_file(&packets, &flow_format, file)) {
+ while (parse_ofp_flow_mod_file(&packets, &flow_format, file, OFPFC_ADD)) {
print_packet_list(&packets);
}
fclose(file);
--
1.7.1
_______________________________________________
dev mailing list
[email protected]
http://openvswitch.org/mailman/listinfo/dev