]> xenbits.xensource.com Git - libvirt.git/commitdiff
macvtap: fix 2 nla_put expressions (non-serious bug)
authorStefan Berger <stefanb@us.ibm.com>
Thu, 3 Feb 2011 19:36:27 +0000 (14:36 -0500)
committerStefan Berger <stefanb@us.ibm.com>
Thu, 3 Feb 2011 19:36:27 +0000 (14:36 -0500)
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.

src/util/macvtap.c

index 09d7b782139e545eb1f2f9f79ececc4acf26d1e9..8814400f7b3319297344cd018c7660aa99d33cbc 100644 (file)
@@ -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;
         }