Signed-off-by: YAMAMOTO Takashi <[email protected]>
---
ryu/tests/packet_data_generator2/gen.c | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
diff --git a/ryu/tests/packet_data_generator2/gen.c
b/ryu/tests/packet_data_generator2/gen.c
index e41aba0..62dc03f 100644
--- a/ryu/tests/packet_data_generator2/gen.c
+++ b/ryu/tests/packet_data_generator2/gen.c
@@ -25,6 +25,21 @@
#include <stdio.h>
void
+clear_xid(struct ofpbuf *buf)
+{
+ /*
+ * some of libofproto message encoding routines automatically
+ * allocate XID for the message. e.g. ofputil_encode_flow_mod
+ * zero-out the XID so that test_parser can perform a simple
+ * bit-wise comparison.
+ */
+
+ struct ofp_header *oh = ofpbuf_at_assert(buf, 0, sizeof(*oh));
+
+ oh->xid = htonl(0);
+}
+
+void
dump_ofpbuf(const char *name, const struct ofpbuf *buf)
{
FILE *fp;
@@ -172,6 +187,7 @@ main(int argc, char *argv[])
snprintf(name, sizeof(name),
"../packet_data/%s/libofproto-%s-%s.packet",
p->dir_name, p->name, m->name);
+ clear_xid(buf);
dump_ofpbuf(name, buf);
ofpbuf_delete(buf);
}
--
2.1.0
------------------------------------------------------------------------------
BPM Camp - Free Virtual Workshop May 6th at 10am PDT/1PM EDT
Develop your own process in accordance with the BPMN 2 standard
Learn Process modeling best practices with Bonita BPM through live exercises
http://www.bonitasoft.com/be-part-of-it/events/bpm-camp-virtual- event?utm_
source=Sourceforge_BPM_Camp_5_6_15&utm_medium=email&utm_campaign=VA_SF
_______________________________________________
Ryu-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ryu-devel