fix same for handling of on-the-fly gateway routes
authorMarkus Kittenberger <Markus.Kittenberger@gmx.at>
Tue, 4 Aug 2009 18:28:30 +0000 (20:28 +0200)
committerMarkus Kittenberger <Markus.Kittenberger@gmx.at>
Tue, 4 Aug 2009 18:28:30 +0000 (20:28 +0200)
src/linux/kernel_routes.c

index f18590e..7e97be4 100644 (file)
@@ -109,8 +109,9 @@ olsr_netlink_route_int(const struct rt_entry *rt, uint8_t family, uint8_t rttabl
       : RT_METRIC_DEFAULT
       : 0;
   const struct rt_nexthop *nexthop = ( ( cmd != RTM_NEWRULE ) || ( cmd != RTM_DELRULE ) ) ? 
-                                       ( RTM_NEWROUTE == cmd ) ? &rt->rt_best->rtp_nexthop : &rt->rt_nexthop 
-                                       : NULL;
+                                             ( ( ( RT_DELETE_SIMILAR_ROUTE == flag || RT_DELETE_SIMILAR_AUTO_ROUTE == flag ) && ( RTM_DELROUTE == cmd ) ) 
+                                             || ( RTM_NEWROUTE == cmd ) ) ? &rt->rt_best->rtp_nexthop : &rt->rt_nexthop 
+                                     : NULL;
   memset(&req, 0, sizeof(req));
 
   req.n.nlmsg_len = NLMSG_LENGTH(sizeof(struct rtmsg));