You are not logged in.

#1 2004-12-10 14:28:30

tomk
Forum Fellow
From: Ireland
Registered: 2004-07-21
Posts: 9,838

Openswan and setkey

I'm trying to compile and install Openswan on Arch, and I've managed the first couple of stages, following the Openswan README. Now I need to compile ipsec-tools, because Openswan need the setkey command, and I'm getting the following error, which is not mentioned in the ipsec-tools mailing list:

pfkey.c: In function 'pfkey_recv':
pfkey.c:1752: error: 'EINTR' undeclared (first use in this function)
pfkey.c:1752: error: (Each undeclared identifier is reported only once
pfkey.c:1752: error: for each function it appears in.)

Apart from custom kernels, this is only about the fourth or fifth time I have compiled anything from source, so it's possible I'm doing something wrong.

Any suggestions anyone?

Offline

#2 2004-12-10 15:18:18

i3839
Member
Registered: 2004-02-04
Posts: 1,185

Re: Openswan and setkey

This shouldn't be needed, but adding a '#include <errno.h>' to the top of pfkey.c should fix it. You probably don't do anything wrong, the code is either buggy or the buildsystem used is. It's unlikely that they release code which doesn't compile, so it's probably something else that's wrong. If after adding that extra include you get other errors, then there's more going on. Better to check if there is a newer version then. (If you use CVS then try updating).

Offline

#3 2004-12-11 01:33:54

tomk
Forum Fellow
From: Ireland
Registered: 2004-07-21
Posts: 9,838

Re: Openswan and setkey

Thanks for the advice, i3839, but that include is already there. I've now downloaded the latest ipsec-tools snapshot from sourceforge, and I'm still getting the same error.

I'll post it up on their list.

Offline

#4 2004-12-11 17:41:33

i3839
Member
Registered: 2004-02-04
Posts: 1,185

Re: Openswan and setkey

To figure out what the hell is going on I downloaded the code (ipsec-tools-0.4) and tried it myself. I get exactly the same error as you do.

The problem is that the kernel headers are included directy in such way that the errno.h of the kernel is used, which doesn't define EINTR. The ironic thing is that the stuff seems to be added to work around glibc bugs.

I think the easiest way to bypass the problem is to replace '#include <errno.h>' with '#include "/usr/include/errno.h"' in pfkey.c. It's not pretty, but at least it works.

Offline

#5 2004-12-11 23:47:26

tomk
Forum Fellow
From: Ireland
Registered: 2004-07-21
Posts: 9,838

Re: Openswan and setkey

Thanks for going to all that trouble - I'll try your latest suggestion as soon as I get the chance.

I have to admit that I cheated in the meantime by copying the setkey and libipsec binaries from the Debian partition on my machine, and they work fine. I just needed to add the iproute package and my VPN was up and running.

Offline

#6 2004-12-28 19:42:26

jason
Member
From: /dev/null
Registered: 2003-01-13
Posts: 100

Re: Openswan and setkey

Any update on this?  I can't compile this either :-/  I tried to use that fix, still has errors... sad

Offline

#7 2004-12-28 20:16:32

i3839
Member
Registered: 2004-02-04
Posts: 1,185

Re: Openswan and setkey

Ah yes, the compile won't complete without errors, I forgot about that. But the setkey program will be compiled without errors, and that's the important thing in this case.

If you need other parts too then you'll probably need to add similar workarounds elsewhere. It may help to send emails to the developers of ipsec-tools, complaining that it doesn't work, and hopefully they fix it for once and for all.

Offline

Board footer

Powered by FluxBB