[ovs-dev] [PATCH 1/2] netdev-windows: fix ofpbuf initialization

Alin Serdean aserdean at cloudbasesolutions.com
Thu Oct 27 19:20:01 UTC 2016


ofpbuf_const_initializer takes only two parameters see:

https://github.com/openvswitch/ovs/blob/master/include/openvswitch/ofpbuf.h#L96

the compiler only gives the following warning:

lib/netdev-windows.c(229) : warning C4020: 'ofpbuf_const_initializer' :
too many actual parameters

which in result will put junk data into "ofpbuf b".

This patch fixes the initialization.

Signed-off-by: Alin Gabriel Serdean <aserdean at cloudbasesolutions.com>
---
 lib/netdev-windows.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/netdev-windows.c b/lib/netdev-windows.c
index 3218490..423a00b 100644
--- a/lib/netdev-windows.c
+++ b/lib/netdev-windows.c
@@ -226,7 +226,7 @@ netdev_windows_netdev_from_ofpbuf(struct netdev_windows_netdev_info *info,
 
     netdev_windows_info_init(info);
 
-    struct ofpbuf b = ofpbuf_const_initializer(&b, buf->data, buf->size);
+    struct ofpbuf b = ofpbuf_const_initializer(buf->data, buf->size);
     struct nlmsghdr *nlmsg = ofpbuf_try_pull(&b, sizeof *nlmsg);
     struct genlmsghdr *genl = ofpbuf_try_pull(&b, sizeof *genl);
     struct ovs_header *ovs_header = ofpbuf_try_pull(&b, sizeof *ovs_header);
-- 
2.9.2.windows.1



More information about the dev mailing list