Don't filter for protocol for routes being removed (linux does not report protocol...
authorHenning Rogge <henning.rogge@fkie.fraunhofer.de>
Tue, 15 May 2018 12:53:09 +0000 (14:53 +0200)
committerHenning Rogge <henning.rogge@fkie.fraunhofer.de>
Tue, 15 May 2018 12:53:09 +0000 (14:53 +0200)
src/generic/layer2_export/layer2_export.c
src/generic/layer2_import/layer2_import.c

index aa4293d..150fcf0 100644 (file)
@@ -444,7 +444,7 @@ _cb_l2neigh_ip_added(void *ptr) {
       OONF_DEBUG(LOG_L2EXPORT, "Add route %s to fib (gw was %s)",
           os_routing_to_string(&rbuf, &l2route->os.p),
           netaddr_to_string(&nbuf, oonf_layer2_neigh_get_nexthop(nip->l2neigh, af)));
-      if (!os_routing_set(&l2route->os, true, false)) {
+      if (!os_routing_set(&l2route->os, true, true)) {
         l2route->status = ROUTE_ADDING;
       }
     }
index 37d79dd..48d4053 100644 (file)
@@ -375,8 +375,8 @@ _cb_rt_event(const struct os_route *route, bool set) {
       continue;
     }
 
-    /* check protocol */
-    if (import->protocol != -1 && import->protocol != route->p.protocol) {
+    /* check protocol only for setting routes, its not reported for removing ones */
+    if (set && import->protocol != -1 && import->protocol != route->p.protocol) {
       OONF_DEBUG(LOG_L2_IMPORT, "Bad protocol %u (filter was %d)", route->p.protocol, import->protocol);
       continue;
     }