Skip to content

Commit

Permalink
Fix Libreswan flags
Browse files Browse the repository at this point in the history
- Fix Libreswan flags on e.g. some Raspbian versions, where VERSION_CODENAME
  is undefined in /etc/os-release
  Ref: https://github.com/libreswan/libreswan/blob/main/mk/defaults/linux.mk
  • Loading branch information
hwdsl2 committed Dec 14, 2020
1 parent cf96051 commit fe8f0a0
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
4 changes: 2 additions & 2 deletions extras/vpnupgrade.sh
Expand Up @@ -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
Expand All @@ -190,7 +190,7 @@ 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 [ "$SWAN_VER" != "4.1" ] || [ "$debian_ver" = "8" ] || ! grep -qs 'VERSION_CODENAME=' /etc/os-release; 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
Expand Down
11 changes: 11 additions & 0 deletions vpnsetup.sh
Expand Up @@ -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
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 [ "$(packaging/utils/lswan_detect.sh init)" = "systemd" ]; then
apt-get -yq install libsystemd-dev || exiterr2
fi
Expand Down

0 comments on commit fe8f0a0

Please sign in to comment.