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?
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).
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.
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.
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.
Any update on this? I can't compile this either :-/ I tried to use that fix, still has errors...
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.