sgw: fix interface monitor for single-sgw mode
authorFerry Huberts <ferry.huberts@pelagic.nl>
Thu, 1 Dec 2016 17:08:14 +0000 (18:08 +0100)
committerFerry Huberts <ferry.huberts@pelagic.nl>
Mon, 5 Dec 2016 15:41:10 +0000 (16:41 +0100)
Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
src/gateway.c

index 60ffa20..07fe7d7 100644 (file)
@@ -659,8 +659,17 @@ static void doEgressInterface(int if_index, enum olsr_ifchg_flag flag) {
  * @param flag interface change flags
  */
 static void smartgw_tunnel_monitor(int if_index, struct interface_olsr *ifh, enum olsr_ifchg_flag flag) {
-  if (!ifh && multi_gateway_mode()) {
-    /* non-olsr interface in multi-sgw mode */
+  if (!multi_gateway_mode()) {
+    /* single-sgw mode */
+
+    olsr_trigger_gatewayloss_check();
+    return;
+  }
+
+  /* multi-sgw mode */
+
+  if (!ifh) {
+    /* non-olsr interface */
     doEgressInterface(if_index, flag);
   }