aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilip Prindeville <philipp@redfish-solutions.com>2021-02-16 15:19:14 -0700
committerGitHub <noreply@github.com>2021-02-16 15:19:14 -0700
commitd053df65e9421c57741d3369922a0c9b15bb8926 (patch)
tree530f2d6c67016e86a11c3b05b6f5d67b852dc82e
parent441a7e5cd2c94025f45c7d7c060fdbd9a1f0d5e1 (diff)
parentec72d3a9e47954f0be844fb32abb5ca1e4dda667 (diff)
Merge pull request #14758 from pprindeville/strongswan-drop-route-uid0
strongswan: fix local_gateway discovery
-rw-r--r--net/strongswan/Makefile2
-rw-r--r--net/strongswan/files/ipsec.init2
2 files changed, 2 insertions, 2 deletions
diff --git a/net/strongswan/Makefile b/net/strongswan/Makefile
index 2ff5ec51a..f292290d4 100644
--- a/net/strongswan/Makefile
+++ b/net/strongswan/Makefile
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=strongswan
PKG_VERSION:=5.9.1
-PKG_RELEASE:=2
+PKG_RELEASE:=3
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
PKG_SOURCE_URL:=https://download.strongswan.org/ https://download2.strongswan.org/
diff --git a/net/strongswan/files/ipsec.init b/net/strongswan/files/ipsec.init
index 63b7507a2..1881e1f14 100644
--- a/net/strongswan/files/ipsec.init
+++ b/net/strongswan/files/ipsec.init
@@ -249,7 +249,7 @@ config_remote() {
local ipdest
[ "$remote_gateway" = "%any" ] && ipdest="1.1.1.1" || ipdest="$remote_gateway"
- local_gateway=`ip route get $ipdest | awk -F"src" '/src/{gsub(/ /,"");print $2}'`
+ local_gateway=$(ip -o route get "$ipdest" | awk '/ src / { print gensub(/^.* src ([^ ]*) .*$/, "\\1", "g"); }')
}
[ -n "$local_identifier" ] && secret_xappend -n "$local_identifier " || secret_xappend -n "$local_gateway "