kernel-pfroute: Use DST as nexthop for host routes
authorTobias Brunner <tobias@strongswan.org>
Sun, 16 Jun 2013 16:59:13 +0000 (18:59 +0200)
committerTobias Brunner <tobias@strongswan.org>
Fri, 21 Jun 2013 15:03:21 +0000 (17:03 +0200)
These are created as cache/clone on Mac OS X.

src/libhydra/plugins/kernel_pfroute/kernel_pfroute_net.c

index e7e6da3..21bbf1a 100644 (file)
@@ -1153,6 +1153,12 @@ static host_t *get_route(private_kernel_pfroute_net_t *this, bool nexthop,
                                        host = host_create_from_sockaddr(addr);
                                        break;
                                }
+                               if (nexthop && type == RTAX_DST &&
+                                       this->reply->rtm_flags & RTF_HOST)
+                               {       /* probably a cloned direct route */
+                                       host = host_create_from_sockaddr(addr);
+                                       break;
+                               }
                                if (!nexthop && type == RTAX_IFA)
                                {
                                        host = host_create_from_sockaddr(addr);