[PATCH] macvtap: work-around for 2.6.32 and older kernels

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This patch works around a recent extension of the netlink driver I had made use of when building the netlink messages. Unfortunately older kernels don't accept IFLA_IFNAME + name of interface as a replacement for the interface's index, so this patch now gets the interface index ifindex if it's not provided (ifindex <= 0).

Signed-off-by: Stefan Berger <stefanb@xxxxxxxxxx>

---
 src/util/macvtap.c |    3 +++
 1 file changed, 3 insertions(+)

Index: libvirt-acl/src/util/macvtap.c
===================================================================
--- libvirt-acl.orig/src/util/macvtap.c
+++ libvirt-acl/src/util/macvtap.c
@@ -905,6 +905,9 @@ ifaceGetNthParent(int ifindex, const cha

     *nth = 0;

+    if (ifindex <= 0 && ifaceGetIndex(true, ifname, &ifindex) != 0)
+        return 1;
+
     while (!end && i <= nthParent) {
         rc = link_dump(true, ifname, ifindex, tb, &recvbuf);
         if (rc)

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list


[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]