From: Stefan Berger Date: Thu, 3 Feb 2011 19:36:27 +0000 (-0500) Subject: macvtap: fix 2 nla_put expressions (non-serious bug) X-Git-Tag: v0.8.8~90 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=be23e2bd655ce1672b7b7d4aeb082e9b9d18facf;p=thirdparty%2Flibvirt.git macvtap: fix 2 nla_put expressions (non-serious bug) This patch fixes 2 occurrences of nla_put expression with a '!' in front of them that basically prevented the detection that the buffer is too small. However, code further below would then detect that the buffer is too small when further parts are added to the netlink message. --- diff --git a/src/util/macvtap.c b/src/util/macvtap.c index 09d7b78213..8814400f7b 100644 --- a/src/util/macvtap.c +++ b/src/util/macvtap.c @@ -1048,8 +1048,8 @@ doPortProfileOpSetLink(bool nltarget_kernel, memcpy(ifla_vf_mac.mac, macaddr, 6); - if (!nla_put(nl_msg, IFLA_VF_MAC, sizeof(ifla_vf_mac), - &ifla_vf_mac) < 0) + if (nla_put(nl_msg, IFLA_VF_MAC, sizeof(ifla_vf_mac), + &ifla_vf_mac) < 0) goto buffer_too_small; } @@ -1060,8 +1060,8 @@ doPortProfileOpSetLink(bool nltarget_kernel, .qos = 0, }; - if (!nla_put(nl_msg, IFLA_VF_VLAN, sizeof(ifla_vf_vlan), - &ifla_vf_vlan) < 0) + if (nla_put(nl_msg, IFLA_VF_VLAN, sizeof(ifla_vf_vlan), + &ifla_vf_vlan) < 0) goto buffer_too_small; }