[Olsr-dev] [PATCH v1 7/9] linux: netlink_process_link: simplify an if/else

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


From: Ferry Huberts <(spam-protected)>

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

diff --git a/src/linux/kernel_routes_nl.c b/src/linux/kernel_routes_nl.c
index c3a3f73..ca69182 100644
--- a/src/linux/kernel_routes_nl.c
+++ b/src/linux/kernel_routes_nl.c
@@ -143,11 +143,7 @@ static void netlink_process_link(struct nlmsghdr *h)
 
   if (!iface && !oif) {
     /* this is not an OLSR interface */
-    if (up) {
-      olsr_trigger_ifchange(ifi->ifi_index, NULL, IFCHG_IF_ADD);
-    } else if (!up) {
-      olsr_trigger_ifchange(ifi->ifi_index, NULL, IFCHG_IF_REMOVE);
-    }
+    olsr_trigger_ifchange(ifi->ifi_index, NULL, up ? IFCHG_IF_ADD : IFCHG_IF_REMOVE);
   }
 }
 
-- 
2.5.0




More information about the Olsr-dev mailing list