Prepare Open vSwitch 1.1.2 release.
[sliver-openvswitch.git] / lib / ofp-parse.c
index 1c69d88..e58ae27 100644 (file)
@@ -440,6 +440,7 @@ str_to_action(char *str, struct ofpbuf *b)
             if (remainder) {
                 ofpbuf_put_zeros(b, OFP_ACTION_ALIGN - remainder);
             }
+            nan = (struct nx_action_note *)((char *)b->data + start_ofs);
             nan->len = htons(b->size - start_ofs);
         } else if (!strcasecmp(act, "move")) {
             struct nx_action_reg_move *move;
@@ -820,7 +821,8 @@ parse_ofp_str(struct flow_mod *fm, uint8_t *table_idx,
                 } else {
                     parse_field_value(&fm->cr, f->index, value);
                 }
-            } else if (!strncmp(name, "reg", 3) && isdigit(name[3])) {
+            } else if (!strncmp(name, "reg", 3)
+                       && isdigit((unsigned char) name[3])) {
                 unsigned int reg_idx = atoi(name + 3);
                 if (reg_idx >= FLOW_N_REGS) {
                     ovs_fatal(0, "only %d registers supported", FLOW_N_REGS);
@@ -871,8 +873,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 +882,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);