From f9d84216d6c6c11a1436355207d52d95ae691ac9 Mon Sep 17 00:00:00 2001 From: hwdsl2 Date: Mon, 14 Dec 2020 10:58:35 -0600 Subject: [PATCH] Fix Libreswan flags - Fix Libreswan flags on e.g. Raspbian 10 --- extras/vpnupgrade.sh | 8 +++----- vpnsetup.sh | 11 +++++++++++ 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/extras/vpnupgrade.sh b/extras/vpnupgrade.sh index baa9283..820d67c 100644 --- a/extras/vpnupgrade.sh +++ b/extras/vpnupgrade.sh @@ -180,7 +180,7 @@ cat > Makefile.inc.local <<'EOF' WERROR_CFLAGS=-w USE_DNSSEC=false EOF -if [ "$SWAN_VER" != "4.1" ] || [ "$debian_ver" = "8" ]; then +if [ "$SWAN_VER" != "4.1" ] || [ "$debian_ver" = "8" ] || ! grep -qs 'VERSION_CODENAME=' /etc/os-release; then cat >> Makefile.inc.local <<'EOF' USE_DH31=false USE_NSS_AVA_COPY=true @@ -190,10 +190,8 @@ EOF fi if [ "$SWAN_VER" = "3.31" ] || [ "$SWAN_VER" = "3.32" ] || [ "$SWAN_VER" = "4.1" ]; then echo "USE_DH2=true" >> Makefile.inc.local - if [ "$SWAN_VER" != "4.1" ] || [ "$debian_ver" = "8" ]; then - if ! grep -qs IFLA_XFRM_LINK /usr/include/linux/if_link.h; then - echo "USE_XFRM_INTERFACE_IFLA_HEADER=true" >> Makefile.inc.local - fi + if ! grep -qs IFLA_XFRM_LINK /usr/include/linux/if_link.h; then + echo "USE_XFRM_INTERFACE_IFLA_HEADER=true" >> Makefile.inc.local fi fi if [ "$SWAN_VER" = "4.1" ]; then diff --git a/vpnsetup.sh b/vpnsetup.sh index 87906fd..5118f9c 100755 --- a/vpnsetup.sh +++ b/vpnsetup.sh @@ -204,6 +204,17 @@ USE_DH2=true USE_NSS_KDF=false FINALNSSDIR=/etc/ipsec.d EOF +if ! grep -qs 'VERSION_CODENAME=' /etc/os-release; then +cat >> Makefile.inc.local <<'EOF' +USE_DH31=false +USE_NSS_AVA_COPY=true +USE_NSS_IPSEC_PROFILE=false +USE_GLIBC_KERN_FLIP_HEADERS=true +EOF +fi +if ! grep -qs IFLA_XFRM_LINK /usr/include/linux/if_link.h; then + echo "USE_XFRM_INTERFACE_IFLA_HEADER=true" >> Makefile.inc.local +fi if [ "$(packaging/utils/lswan_detect.sh init)" = "systemd" ]; then apt-get -yq install libsystemd-dev || exiterr2 fi