teddysun / across

Across the Great Wall we can reach every corner in the world
https://teddysun.com
Apache License 2.0
4.97k stars 2.22k forks source link

Fix a compilation error in l2tp.sh #32

Closed VincentSit closed 5 years ago

VincentSit commented 5 years ago

I created a brand new Ubuntu VPS running 18.04 in Vultr, but it failed to compile libreswan in this script. So I fixed it and submit this PR.

  1. Fixed the script failed to compile in the Ubuntu 18.04 x64, kernel 4.15.0-36-generic.
  2. Update libreswan to 3.27, you may need to upload this version file to your server if you merge the PR.

This fix was copy and modified from hwdsl2/setup-ipsec-vpn. It is also used in CentOS.

Error log:

......
/root/l2tp/libreswan-3.27/programs/pluto/ikev2_ipseckey.c:28:10: fatal error: ldns/ldns.h: No such file or directory
 #include <ldns/ldns.h> /* from ldns-devel */
          ^~~~~~~~~~~~~
compilation terminated.
../../mk/depend.mk:34: recipe for target 'ikev2_ipseckey.o' failed
make[3]: *** [ikev2_ipseckey.o] Error 1
../../mk/targets.mk:82: recipe for target 'all' failed
make[2]: *** [all] Error 2
make[2]: Leaving directory '/root/l2tp/libreswan-3.27/programs/pluto'
../mk/targets.mk:82: recipe for target 'recursive-all' failed
make[1]: *** [recursive-all] Error 2
make[1]: Leaving directory '/root/l2tp/libreswan-3.27/programs'
mk/targets.mk:82: recipe for target 'recursive-all' failed
make: *** [recursive-all] Error 2
libreswan-3.27 install failed.

Same error with libreswan 3.20.