[Olsr-dev] [PATCH v1 1/1] linux: olsr_if_isup: fix return code in error path

Ferry Huberts (spam-protected)
Wed Oct 1 16:53:05 CEST 2014


From: Ferry Huberts <(spam-protected)>

Now it really returns false when an interface does not exist.

Signed-off-by: Ferry Huberts <(spam-protected)>
---
 src/linux/net.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/linux/net.c b/src/linux/net.c
index 650773f..00f45fa 100644
--- a/src/linux/net.c
+++ b/src/linux/net.c
@@ -713,7 +713,7 @@ bool olsr_if_isup(const char * dev)
   if (ioctl(olsr_cnf->ioctl_s, SIOCGIFFLAGS, &ifr) < 0) {
     OLSR_PRINTF(1, "ioctl SIOCGIFFLAGS (get flags) error on device %s: %s (%d)\n",
         dev, strerror(errno), errno);
-    return 1;
+    return 0;
   }
   return (ifr.ifr_flags & IFF_UP) != 0;
 }
-- 
1.9.3





More information about the Olsr-dev mailing list