]> git.ipfire.org Git - thirdparty/strongswan.git/commitdiff
Revert "kernel-netlink: Don't fallback to peer address as gateway"
authorTobias Brunner <tobias@strongswan.org>
Mon, 3 Mar 2025 08:46:14 +0000 (09:46 +0100)
committerTobias Brunner <tobias@strongswan.org>
Mon, 3 Mar 2025 08:46:14 +0000 (09:46 +0100)
This reverts commit f717bb5249caea550bc6e2baeb09ca309ad83b39.

Causes issues in our testing environment. Default route via host is
preferred if no gateway is set in the installed routes.  Needs some
investigation.

References strongswan/strongswan#2548

src/libcharon/plugins/kernel_netlink/kernel_netlink_net.c

index 7d49d73b4ff94dd1eb915b793512f9cc9d2e9a85..416ae78116738d95ce4ee12e08214fb9192ed7e3 100644 (file)
@@ -2075,6 +2075,10 @@ static host_t *get_route(private_kernel_netlink_net_t *this, host_t *dest,
                                *iface = get_interface_name_by_index(this, best->oif);
                        }
                }
+               if (!addr && !match_net)
+               {       /* fallback to destination address */
+                       addr = dest->clone(dest);
+               }
        }
        else
        {