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

[libvirt] [PATCH v3 2/4] Make virNetDevSetupControl() public.



---
 src/libvirt_private.syms | 1 +
 src/util/virnetdev.c     | 6 ++++--
 src/util/virnetdev.h     | 6 ++++++
 3 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms
index c589236..8ad4634 100644
--- a/src/libvirt_private.syms
+++ b/src/libvirt_private.syms
@@ -1518,6 +1518,7 @@ virNetDevSetMTUFromDevice;
 virNetDevSetName;
 virNetDevSetNamespace;
 virNetDevSetOnline;
+virNetDevSetupControl;
 virNetDevValidateConfig;
 
 
diff --git a/src/util/virnetdev.c b/src/util/virnetdev.c
index 503db9d..9ee84c3 100644
--- a/src/util/virnetdev.c
+++ b/src/util/virnetdev.c
@@ -78,8 +78,9 @@ static int virNetDevSetupControlFull(const char *ifname,
 }
 
 
-static int virNetDevSetupControl(const char *ifname,
-                                 struct ifreq *ifr)
+int
+virNetDevSetupControl(const char *ifname,
+                          struct ifreq *ifr)
 {
 #if defined(__FreeBSD__)
     return virNetDevSetupControlFull(ifname, ifr, AF_LOCAL, SOCK_DGRAM);
@@ -87,6 +88,7 @@ static int virNetDevSetupControl(const char *ifname,
     return virNetDevSetupControlFull(ifname, ifr, AF_PACKET, SOCK_DGRAM);
 #endif
 }
+#else /* !(defined(HAVE_STRUCT_IFREQ) || defined(__FreeBSD__)) */
 #endif
 
 #if defined(SIOCGIFFLAGS) && (defined(HAVE_STRUCT_IFREQ) || defined(__FreeBSD__))
diff --git a/src/util/virnetdev.h b/src/util/virnetdev.h
index d588e89..63871cc 100644
--- a/src/util/virnetdev.h
+++ b/src/util/virnetdev.h
@@ -28,6 +28,12 @@
 # include "virmacaddr.h"
 # include "virpci.h"
 
+# include <net/if.h>
+
+int virNetDevSetupControl(const char *ifname,
+                          struct ifreq *ifr)
+    ATTRIBUTE_RETURN_CHECK;
+
 int virNetDevExists(const char *brname)
     ATTRIBUTE_NONNULL(1) ATTRIBUTE_RETURN_CHECK;
 
-- 
1.8.0


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