diff --git a/ryu/tests/packet_data_generator2/gen.c b/ryu/tests/packet_data_generator2/gen.c index 70f28d25..e2043bef 100644 --- a/ryu/tests/packet_data_generator2/gen.c +++ b/ryu/tests/packet_data_generator2/gen.c @@ -18,6 +18,7 @@ #include #include +#include #include #include @@ -58,6 +59,14 @@ dump_ofpbuf(const char *name, const struct ofpbuf *buf) } } +void +dump_message(const char *name, struct ofpbuf *buf) +{ + + ofpmsg_update_length(buf); + dump_ofpbuf(name, buf); +} + void fill_match(struct match *match) { @@ -208,7 +217,7 @@ main(int argc, char *argv[]) "../packet_data/%s/libofproto-%s-%s.packet", p->dir_name, p->name, m->name); clear_xid(buf); - dump_ofpbuf(name, buf); + dump_message(name, buf); ofpbuf_delete(buf); } }