From c23875d41b602163ac151e2c41f6191c7348e3f1 Mon Sep 17 00:00:00 2001 From: Marek Wilniewiec Date: Wed, 25 Oct 2017 14:10:37 +0200 Subject: [PATCH] Multicasts fix for OSX --- src/util/netif-mgmt.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/util/netif-mgmt.c b/src/util/netif-mgmt.c index 9f550667..3d835161 100644 --- a/src/util/netif-mgmt.c +++ b/src/util/netif-mgmt.c @@ -206,6 +206,12 @@ netif_mgmt_get_ifindex(int reqfd, const char* if_name) { if (ret >= 0) { ret = ifr.ifr_ifindex; } +#else + ret = if_nametoindex(if_name); + // if_nametoindex returns 0 on error and sets errno + if (ret == 0) { + ret = -1; + } #endif return ret;