Replace most uses of assert by ovs_assert.
[sliver-openvswitch.git] / lib / match.c
index 7d6e8cc..f1bf63c 100644 (file)
 
 #include <config.h>
 #include "match.h"
-#include <assert.h>
 #include <stdlib.h>
 #include "byte-order.h"
 #include "dynamic-string.h"
+#include "ofp-util.h"
 #include "packets.h"
 #include "vlog.h"
 
@@ -176,7 +176,7 @@ void
 match_set_reg_masked(struct match *match, unsigned int reg_idx,
                      uint32_t value, uint32_t mask)
 {
-    assert(reg_idx < FLOW_N_REGS);
+    ovs_assert(reg_idx < FLOW_N_REGS);
     flow_wildcards_set_reg_mask(&match->wc, reg_idx, mask);
     match->flow.regs[reg_idx] = value & mask;
 }
@@ -865,7 +865,9 @@ match_format(const struct match *match, struct ds *s, unsigned int priority)
         break;
     }
     if (wc->masks.in_port) {
-        ds_put_format(s, "in_port=%"PRIu16",", f->in_port);
+        ds_put_cstr(s, "in_port=");
+        ofputil_format_port(f->in_port, s);
+        ds_put_char(s, ',');
     }
     if (wc->masks.vlan_tci) {
         ovs_be16 vid_mask = wc->masks.vlan_tci & htons(VLAN_VID_MASK);