[Olsr-dev] [PATCH v1 4/9] linux: netlink_process_link: always determine the oif

Ferry Huberts (spam-protected)
Wed Feb 10 14:35:43 CET 2016


From: Ferry Huberts <(spam-protected)>

This simplifies it a bit more.

Signed-off-by: Ferry Huberts <(spam-protected)>
---
 src/linux/kernel_routes_nl.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/linux/kernel_routes_nl.c b/src/linux/kernel_routes_nl.c
index 3f363c7..3684060 100644
--- a/src/linux/kernel_routes_nl.c
+++ b/src/linux/kernel_routes_nl.c
@@ -120,7 +120,6 @@ static void netlink_process_link(struct nlmsghdr *h)
   char * ifaceName = NULL;
 
   iface = if_ifwithindex(ifi->ifi_index);
-  oif = NULL;
 
   if (!iface) {
     ifaceName = if_indextoname(ifi->ifi_index, namebuffer);
@@ -128,8 +127,10 @@ static void netlink_process_link(struct nlmsghdr *h)
     ifaceName = iface->int_name;
   }
 
+  oif = ifaceName ? olsrif_ifwithname(ifaceName) : NULL;
+
   if (!iface && ((ifi->ifi_flags & IFF_UP) == IFF_UP)) {
-    if (ifaceName && ((oif = olsrif_ifwithname(ifaceName)) != NULL)) {
+    if (oif) {
       /* try to take interface up, will trigger ifchange */
       chk_if_up(oif, 3);
     }
-- 
2.5.0




More information about the Olsr-dev mailing list