xelerance / Openswan

Openswan
Other
856 stars 211 forks source link

CentOS 6.5 64 bit, make programs error, 2.6.43 is ok #171

Closed austgl closed 8 years ago

austgl commented 8 years ago

/root/openswan-2.6.46/include/pluto/log.h:151: error: redefinition of typedef ‘logfunc’ /root/openswan-2.6.46/include/pluto/log.h:151: note: previous declaration of ‘logfunc’ was here make[3]: * [connections.o] Error 1 make[3]: Leaving directory /root/openswan-2.6.46/OBJ.linux.x86_64/programs/pluto' make[2]: *** [programs] Error 1 make[2]: Leaving directory/root/openswan-2.6.46/OBJ.linux.x86_64/programs' make[1]: *\ [programs] Error 1 make[1]: Leaving directory `/root/openswan-2.6.46/OBJ.linux.x86_64' make: * [programs] Error 2


make[3]: Leaving directory /root/openswan-2.6.43/OBJ.linux.x86_64/programs/pf_key' make[3]: Entering directory/root/openswan-2.6.43/OBJ.linux.x86_64/programs/_updown.mast' IN _updown.mast.in -> _updown.mast make[3]: Leaving directory /root/openswan-2.6.43/OBJ.linux.x86_64/programs/_updown.mast' make[3]: Entering directory/root/openswan-2.6.43/OBJ.linux.x86_64/programs/_startnetkey' IN _startnetkey.in -> _startnetkey make[3]: Leaving directory /root/openswan-2.6.43/OBJ.linux.x86_64/programs/_startnetkey' make[3]: Entering directory/root/openswan-2.6.43/OBJ.linux.x86_64/programs/_updown.netkey' IN _updown.netkey.in -> _updown.netkey make[3]: Leaving directory /root/openswan-2.6.43/OBJ.linux.x86_64/programs/_updown.netkey' make[2]: Leaving directory/root/openswan-2.6.43/OBJ.linux.x86_64/programs' make[1]: Leaving directory `/root/openswan-2.6.43/OBJ.linux.x86_64' [root@iZ62nfbnzj5Z openswan-2.6.43]# cd ../openswan-2.6.4 openswan-2.6.43/ openswan-2.6.43.tar.gz openswan-2.6.46/


[root@iZ62nfbnzj5Z openswan-2.6.46]# cat /etc/issue CentOS release 6.5 (Final) Kernel \r on an \m

[root@iZ62nfbnzj5Z openswan-2.6.46]# uname -a Linux iZ62nfbnzj5Z 2.6.32-431.23.3.el6.x86_64 #1 SMP Thu Jul 31 17:20:51 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux [root@iZ62nfbnzj5Z openswan-2.6.46]# uname -r 2.6.32-431.23.3.el6.x86_64 [root@iZ62nfbnzj5Z openswan-2.6.46]#

PrashantSunkari commented 8 years ago

yes I have run this issue as well. Does anyone know a fix for this ?

shussain commented 8 years ago

This issue occurred for me in CentOS 6.7 Ubuntu worked for me.

The issue is the multiple inclusions of pluto/log.h Older versions of gcc will complain about it and giving the above error

This commit should fix the issue: https://github.com/xelerance/Openswan/commit/35b197db67077fa9401b0cbe7956437e69d301de

freedai commented 8 years ago

After applying this patch, there were more errors for log.c. My build is openswan 2.6.47 though.

/builddir/build/BUILD/openswan-2.6.47/programs/pluto/log.c: In function 'connection_state': /builddir/build/BUILD/openswan-2.6.47/programs/pluto/log.c:952: error: 'struct connection' has no member named 'host_pair' /builddir/build/BUILD/openswan-2.6.47/programs/pluto/log.c:952: error: 'struct connection' has no member named 'host_pair'

shussain commented 8 years ago

I could not reproduce on CentOS 6.5 and 6.7 using the patch.

Could you please delete the OBJ* folder (rm -rf OBJ*) and try again.

If the issue still occurs, can you please specify:

freedai commented 8 years ago

It's based on CentOS 6. I don't think the error is caused by your patch. I have HAVE_STATSD=true defined and enabled the function connection_state.

/usr/bin/make 'USERCOMPILE=-g -O2 -g -march=i686 -fPIE -pie' 'USERLINK=-g -pie' HAVE_THREADS=true HAVE_STATSD=true USE_DYNAMICDNS=true USE_LWRES=true INC_USRLOCAL=/usr FINALLIBDIR=/usr/lib/ipsec MANTREE=/usr/share/man INC_RCDEFAULT=/etc/rc.d/init.d programs
Setting up for OBJDIR=OBJ.linux.i386
make[3]: Entering directory `/builddir/build/BUILD/openswan-2.6.47/OBJ.linux.i386/programs/pluto'
CC connections.c
/builddir/build/BUILD/openswan-2.6.47/programs/pluto/connections.c: In function 'delete_end':
/builddir/build/BUILD/openswan-2.6.47/programs/pluto/connections.c:191: warning: unused parameter 'c'
/builddir/build/BUILD/openswan-2.6.47/programs/pluto/connections.c:191: warning: unused parameter 'sr'
/builddir/build/BUILD/openswan-2.6.47/programs/pluto/connections.c: In function 'show_one_sr':
/builddir/build/BUILD/openswan-2.6.47/programs/pluto/connections.c:2984: warning: unused parameter 'num'
/builddir/build/BUILD/openswan-2.6.47/programs/pluto/connections.c: In function 'refine_host_connection':
/builddir/build/BUILD/openswan-2.6.47/programs/pluto/connections.c:2242: warning: 'auth_policy' may be used uninitialized in this function
CC initiate.c
/builddir/build/BUILD/openswan-2.6.47/programs/pluto/initiate.c: In function 'initiate_ondemand_body':
/builddir/build/BUILD/openswan-2.6.47/programs/pluto/initiate.c:829: warning: 'next_step' may be used uninitialized in this function
CC terminate.c
/builddir/build/BUILD/openswan-2.6.47/programs/pluto/terminate.c: In function 'terminate_a_connection':
/builddir/build/BUILD/openswan-2.6.47/programs/pluto/terminate.c:79: warning: unused parameter 'arg'
CC pending.c
/builddir/build/BUILD/openswan-2.6.47/programs/pluto/pending.c: In function 'add_pending':
/builddir/build/BUILD/openswan-2.6.47/programs/pluto/pending.c:78: warning: unused parameter 'uctx'
CC cookie.c
CC crypto.c
CC dpd.c
CC foodgroups.c
CC log.c
/builddir/build/BUILD/openswan-2.6.47/programs/pluto/log.c: In function 'connection_state':
/builddir/build/BUILD/openswan-2.6.47/programs/pluto/log.c:952: error: 'struct connection' has no member named 'host_pair'
/builddir/build/BUILD/openswan-2.6.47/programs/pluto/log.c:952: error: 'struct connection' has no member named 'host_pair'
make[3]: Leaving directory `/builddir/build/BUILD/openswan-2.6.47/OBJ.linux.i386/programs/pluto'
make[3]: *** [log.o] Error 1
make[2]: Leaving directory `/builddir/build/BUILD/openswan-2.6.47/OBJ.linux.i386/programs'
make[2]: *** [programs] Error 1
make[1]: Leaving directory `/builddir/build/BUILD/openswan-2.6.47/OBJ.linux.i386'
make[1]: *** [programs] Error 1
make: *** [programs] Error 2
libreswan commented 8 years ago

note that with today's release of RHEL-6.8, which will shortly find its way into centos6 too, that any openswan install will be obsoleted by libreswan when the system is updated.

freedai commented 8 years ago

Is libreswan supporting nat-t? It used to be not. That's why we still build openswan other than libreswan.

letoams commented 8 years ago

Of course it does. The option nat_traversal= was removed because it is always on

Sent from my iPhone

On May 10, 2016, at 13:26, freedai notifications@github.com wrote:

Is libreswan supporting nat-t? It used to be not. That's why we still build openswan other than libreswan.

— You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub

freedai commented 8 years ago

Good to know. We can go this route in next release. Thanks.

shussain commented 8 years ago

I have looked into the new compile error and the following should fix the compile error:

`diff --git a/programs/pluto/log.c b/programs/pluto/log.c index 2a46c3f..f0a3c9c 100644 --- a/programs/pluto/log.c +++ b/programs/pluto/log.c @@ -949,7 +949,7 @@ connection_state(struct state st, void data) return;

    if (st->st_connection != lc->conn) {

I am currently in the middle of a release. Once it is done, I will be creating a commit and can provide it in this ticket.

shussain commented 8 years ago

Commit 05513000281e61790c8a4df442dfb68d024f376d in the 2.6.48dev now has the fix for the compile error when HAVE_STATSD=true

shussain commented 8 years ago

2.6.48 (and 2.6.49) has been released. Closing this issue.