[multicat-devel] [PATCH] util.c: accommodate differences in struct ifreq names

Ed Maste emaste at freebsd.org
Wed Jul 6 19:33:58 CEST 2016


---
 util.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/util.c b/util.c
index c5c596a..31223ca 100644
--- a/util.c
+++ b/util.c
@@ -264,7 +264,7 @@ void real_Sleep( uint64_t i_delay )
  *****************************************************************************/
 static int GetInterfaceIndex( const char *psz_name )
 {
-#if !defined(__FreeBSD__) && !defined(__APPLE__)
+#if !defined(__APPLE__)
     int i_fd;
     struct ifreq ifr;
 
@@ -285,7 +285,11 @@ static int GetInterfaceIndex( const char *psz_name )
 
     close( i_fd );
 
+#if defined(__FreeBSD__)
+    return ifr.ifr_index;
+#else
     return ifr.ifr_ifindex;
+#endif
 #else
     return 0;
 #endif
-- 
2.8.1



More information about the multicat-devel mailing list