]> git.proxmox.com Git - mirror_ovs.git/blobdiff - lib/ofp-msgs.c
ofpbuf: New function ofpbuf_const_initializer().
[mirror_ovs.git] / lib / ofp-msgs.c
index bc38f401bb17777b3412d4cdab873d8de22a1f27..de20655b4ecdaa3794f46d64dca86bafe43593bd 100644 (file)
@@ -407,9 +407,7 @@ ofphdrs_len(const struct ofphdrs *hdrs)
 enum ofperr
 ofpraw_decode(enum ofpraw *raw, const struct ofp_header *oh)
 {
-    struct ofpbuf msg;
-
-    ofpbuf_use_const(&msg, oh, ntohs(oh->length));
+    struct ofpbuf msg = ofpbuf_const_initializer(oh, ntohs(oh->length));
     return ofpraw_pull(raw, &msg);
 }