]> git.ipfire.org Git - thirdparty/strongswan.git/commit
libipsec: Also install routes without preferred source to forward traffic
authorBoi Sletterink <boi@sletterink.nl>
Thu, 29 Jun 2023 15:39:37 +0000 (17:39 +0200)
committerTobias Brunner <tobias@strongswan.org>
Mon, 4 Sep 2023 14:54:37 +0000 (16:54 +0200)
commit190d8cbe1931ec57484d9bb451824a7fc57979bd
treee84cd6b403bcec5c62264aebc46eef42a6246728
parentcdc34ddea2625e42e4d02b34978c3a5447505c5c
libipsec: Also install routes without preferred source to forward traffic

Fixes a problem installing policies with source traffic selectors that do
not contain/match any of the local addresses.

When installing a route for a source TS that does contain one or more
local addresses, a preferred source address should be set in the route
(analogous to the `src` option in `ip route add`). This address is used
when the host itself sends traffic via that route (in contrast to
forwarding it).

When the source TS does not encompass any of the local addresses, the
host is not allowed to send traffic via this route and does not need to
set the preferred source address. However, the code would just return a
failure because it could not find a matching local address. This commit
changes this so routes without preferred source IP are installed to
allow non-local traffic to get forwarded via TUN device.

Closes strongswan/strongswan#1766
src/libcharon/plugins/kernel_libipsec/kernel_libipsec_ipsec.c