LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   Error compiling CIPE 1.6.0 in Slackware 12.1 (https://www.linuxquestions.org/questions/slackware-14/error-compiling-cipe-1-6-0-in-slackware-12-1-a-681349/)

whirler 11-05-2008 02:09 PM

Error compiling CIPE 1.6.0 in Slackware 12.1
 
I'm working on compiling version 1.6.0 of the CIPE module on my Slackware 12.1 machine with kernel version 2.6.24.5-smp.

I did have an issue with the configure script not recognizing my kernel version but after doing some research online found a solution. I had to edit the KVERS variable to manually set my kernel version. Now the configure script runs without any errors (I mention this just in case it could have ramifications on what I'm trying to do).

However, I'm now getting an error when I run "make". Here is the ouput I receive:

Code:

gmake -C lib all
gmake[1]: Entering directory `/usr/src/cipe-1.6.0/lib'
gcc  -Wall -Wstrict-prototypes -fomit-frame-pointer -fno-strength-reduce -g  -Wmissing-prototypes -DHAVE_CONFIG_H -DLIBRARY  -MD -c cipe_syslog.c
gcc  -Wall -Wstrict-prototypes -fomit-frame-pointer -fno-strength-reduce -g  -Wmissing-prototypes -DHAVE_CONFIG_H -DLIBRARY  -MD -c debug.c
gcc  -Wall -Wstrict-prototypes -fomit-frame-pointer -fno-strength-reduce -g  -Wmissing-prototypes -DHAVE_CONFIG_H -DLIBRARY  -MD -c dsprintf.c
gcc  -Wall -Wstrict-prototypes -fomit-frame-pointer -fno-strength-reduce -g  -Wmissing-prototypes -DHAVE_CONFIG_H -DLIBRARY  -MD -c getaddr.c
gcc  -Wall -Wstrict-prototypes -fomit-frame-pointer -fno-strength-reduce -g  -Wmissing-prototypes -DHAVE_CONFIG_H -DLIBRARY  -MD -c gethex.c
gcc  -Wall -Wstrict-prototypes -fomit-frame-pointer -fno-strength-reduce -g  -Wmissing-prototypes -DHAVE_CONFIG_H -DLIBRARY  -MD -c hex.c
gcc  -Wall -Wstrict-prototypes -fomit-frame-pointer -fno-strength-reduce -g  -Wmissing-prototypes -DHAVE_CONFIG_H -DLIBRARY  -MD -c hexdump.c
gcc  -Wall -Wstrict-prototypes -fomit-frame-pointer -fno-strength-reduce -g  -Wmissing-prototypes -DHAVE_CONFIG_H -DLIBRARY  -MD -c hexstr.c
gcc  -Wall -Wstrict-prototypes -fomit-frame-pointer -fno-strength-reduce -g  -Wmissing-prototypes -DHAVE_CONFIG_H -DLIBRARY  -MD -c parseopt.c
gcc  -Wall -Wstrict-prototypes -fomit-frame-pointer -fno-strength-reduce -g  -Wmissing-prototypes -DHAVE_CONFIG_H -DLIBRARY  -MD -c retstatus.c
gcc  -Wall -Wstrict-prototypes -fomit-frame-pointer -fno-strength-reduce -g  -Wmissing-prototypes -DHAVE_CONFIG_H -DLIBRARY  -MD -c setsig.c
gcc  -Wall -Wstrict-prototypes -fomit-frame-pointer -fno-strength-reduce -g  -Wmissing-prototypes -DHAVE_CONFIG_H -DLIBRARY  -MD -c secchk.c
gcc  -Wall -Wstrict-prototypes -fomit-frame-pointer -fno-strength-reduce -g  -Wmissing-prototypes -DHAVE_CONFIG_H -DLIBRARY  -MD -c sighand.c
gcc  -Wall -Wstrict-prototypes -fomit-frame-pointer -fno-strength-reduce -g  -Wmissing-prototypes -DHAVE_CONFIG_H -DLIBRARY  -MD -c socks_errlist.c
gcc  -Wall -Wstrict-prototypes -fomit-frame-pointer -fno-strength-reduce -g  -Wmissing-prototypes -DHAVE_CONFIG_H -DLIBRARY  -MD -c socks5_open.c
socks5_open.c: In function 'socks5_open':
socks5_open.c:58: warning: pointer targets in passing argument 2 of 'writen' differ in signedness
socks5_open.c:60: warning: pointer targets in passing argument 2 of 'writen' differ in signedness
gcc  -Wall -Wstrict-prototypes -fomit-frame-pointer -fno-strength-reduce -g  -Wmissing-prototypes -DHAVE_CONFIG_H -DLIBRARY  -MD -c socks5_cmd.c
gcc  -Wall -Wstrict-prototypes -fomit-frame-pointer -fno-strength-reduce -g  -Wmissing-prototypes -DHAVE_CONFIG_H -DLIBRARY  -MD -c xread.c
gcc  -Wall -Wstrict-prototypes -fomit-frame-pointer -fno-strength-reduce -g  -Wmissing-prototypes -DHAVE_CONFIG_H -DLIBRARY  -MD -c xwrite.c
gcc  -Wall -Wstrict-prototypes -fomit-frame-pointer -fno-strength-reduce -g  -Wmissing-prototypes -DHAVE_CONFIG_H -DLIBRARY  -MD -c xwritev.c
ar rcs libcipe.a cipe_syslog.o debug.o dsprintf.o getaddr.o gethex.o hex.o hexdump.o hexstr.o parseopt.o retstatus.o setsig.o secchk.o sighand.o socks_errlist.o socks5_open.o socks5_cmd.o xread.o xwrite.o xwritev.o
gmake[1]: Leaving directory `/usr/src/cipe-1.6.0/lib'
gmake -C 2.6.24.5-smp-i386-SMP-cb all
gmake[1]: Entering directory `/usr/src/cipe-1.6.0/2.6.24.5-smp-i386-SMP-cb'
ln -sf ../cipe/*.[chS] .
ln -sf crc32.c ucrc32.c
gcc -Wp,-MD,.crcgen.o.d  -I/usr/src/linux-2.6.24.5/include -I. -include ./config.h -I/usr/src/linux-2.6.24.5/include  -I../lib -pipe -O3 -Wall -Wstrict-prototypes -fomit-frame-pointer -fno-strength-reduce -g  -o crcgen.o -c crcgen.c
crcgen.c: In function 'main':
crcgen.c:37: warning: pointer targets in passing argument 2 of 'crc32' differ in signedness
crcgen.c:41: warning: pointer targets in passing argument 2 of 'crc32' differ in signedness
gcc -Wp,-MD,.ucrc32.o.d  -I/usr/src/linux-2.6.24.5/include -I. -include ./config.h -I/usr/src/linux-2.6.24.5/include  -I../lib -pipe -O3 -Wall -Wstrict-prototypes -fomit-frame-pointer -fno-strength-reduce -g  -o ucrc32.o -c ucrc32.c
gcc  -o crcgen crcgen.o ucrc32.o
sed -n '/@api/{n;s,[/*#],,g;s,^,  ,p;}' config.h | ./crcgen - >version.h
gcc -Wp,-MD,.ciped.o.d  -I/usr/src/linux-2.6.24.5/include -I. -include ./config.h -I/usr/src/linux-2.6.24.5/include  -I../lib -pipe -O3 -Wall -Wstrict-prototypes -fomit-frame-pointer -fno-strength-reduce -g  -o ciped.o -c ciped.c
ciped.c: In function 'opendev':
ciped.c:345: warning: pointer targets in passing argument 3 of 'getsockname' differ in signedness
ciped.c:401: warning: pointer targets in initialization differ in signedness
ciped.c:416: warning: pointer targets in passing argument 1 of 'gethex' differ in signedness
ciped.c:417: warning: pointer targets in passing argument 1 of 'strlen' differ in signedness
ciped.c: In function 'kxchg':
ciped.c:752: warning: pointer targets in passing argument 2 of 'ctrl' differ in signedness
gcc -Wp,-MD,.options.o.d  -I/usr/src/linux-2.6.24.5/include -I. -include ./config.h -I/usr/src/linux-2.6.24.5/include  -I../lib -pipe -O3 -Wall -Wstrict-prototypes -fomit-frame-pointer -fno-strength-reduce -g  -o options.o -c options.c
gcc -Wp,-MD,.ioctl.o.d  -I/usr/src/linux-2.6.24.5/include -I. -include ./config.h -I/usr/src/linux-2.6.24.5/include  -I../lib -pipe -O3 -Wall -Wstrict-prototypes -fomit-frame-pointer -fno-strength-reduce -g  -o ioctl.o -c ioctl.c
gcc  -o ciped-cb ciped.o options.o ioctl.o ucrc32.o  -L../lib -lcipe
gmake -C /usr/src/linux-2.6.24.5 SUBDIRS=/usr/src/cipe-1.6.0/2.6.24.5-smp-i386-SMP-cb modules
gmake[2]: Entering directory `/usr/src/linux-2.6.24.5'
  CC [M]  /usr/src/cipe-1.6.0/2.6.24.5-smp-i386-SMP-cb/module.o
In file included from /usr/src/cipe-1.6.0/2.6.24.5-smp-i386-SMP-cb/../cipe/cipe.h:161,
                from /usr/src/cipe-1.6.0/2.6.24.5-smp-i386-SMP-cb/../cipe/module.c:15:
/usr/src/cipe-1.6.0/2.6.24.5-smp-i386-SMP-cb/../cipe/cryptoapi.h:94: error: redefinition of 'crypto_tfm_ctx'
include/linux/crypto.h:509: error: previous definition of 'crypto_tfm_ctx' was here
In file included from /usr/src/cipe-1.6.0/2.6.24.5-smp-i386-SMP-cb/../cipe/module.c:15:
/usr/src/cipe-1.6.0/2.6.24.5-smp-i386-SMP-cb/../cipe/cipe.h:274:1: warning: "CURRENT_TIME_SEC" redefined
In file included from include/linux/skbuff.h:19,
                from include/linux/if_ether.h:113,
                from include/linux/netdevice.h:29,
                from /usr/src/cipe-1.6.0/2.6.24.5-smp-i386-SMP-cb/../cipe/cipe.h:152,
                from /usr/src/cipe-1.6.0/2.6.24.5-smp-i386-SMP-cb/../cipe/module.c:15:
include/linux/time.h:106:1: warning: this is the location of the previous definition
gmake[3]: *** [/usr/src/cipe-1.6.0/2.6.24.5-smp-i386-SMP-cb/module.o] Error 1
gmake[2]: *** [_module_/usr/src/cipe-1.6.0/2.6.24.5-smp-i386-SMP-cb] Error 2
gmake[2]: Leaving directory `/usr/src/linux-2.6.24.5'
gmake[1]: *** [all25] Error 2
gmake[1]: Leaving directory `/usr/src/cipe-1.6.0/2.6.24.5-smp-i386-SMP-cb'
make: *** [all] Error 2

Note the errors at the bottom of the output. Has anyone encountered this problem before or know of a potential solution?

Here is the site for the CIPE project just in case:
http://sites.inka.de/~bigred/devel/cipe.html

Alien Bob 11-05-2008 03:14 PM

The linux-cipe project has been dead for 4 years. The code will not compile against the 2.6.x kernel for several years now.

Eric

rhermsen 11-05-2008 03:35 PM

Maybe this link will help:
http://sites.inka.de/~W1011/archive/.../msg00002.html

or this one
http://www.nabble.com/Compile-error-...td4592562.html

Hopefully you get one step further.

whirler 11-05-2008 03:41 PM

Thanks for the links. I'll give those a try and see if that helps.

whirler 11-05-2008 05:31 PM

Quote:

Maybe this link will help:
http://sites.inka.de/~W1011/archive/.../msg00002.html

or this one
http://www.nabble.com/Compile-error-...td4592562.html

Hopefully you get one step further.
I was able to download the patch and make some of the the suggested changes to one of the source code files. However, I'm not sure what to do to install the patch. I tried running it as a regular shell script (./cipe-2.6.14.patch) but it doesn't seem to work. Here is the contents of the patch file:

Code:

Index: cipe/cipe.h
===================================================================
RCS file: /cvsroot/cipe-linux/cipe-linux/cipe/cipe.h,v
retrieving revision 1.61
diff -u -r1.61 cipe.h
--- cipe/cipe.h 10 May 2005 19:17:37 -0000      1.61
+++ cipe/cipe.h 6 Nov 2005 17:40:31 -0000
@@ -250,8 +250,10 @@
 #endif
 
 #if LINUX_VERSION_CODE > KERNEL_VERSION(2,4,17)
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,14)
 #define get_fast_time do_gettimeofday
 #endif
+#endif
 
 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,71)
 #define sk_shutdown shutdown
Index: cipe/cryptoapi.h
===================================================================
RCS file: /cvsroot/cipe-linux/cipe-linux/cipe/cryptoapi.h,v
retrieving revision 1.6
diff -u -r1.6 cryptoapi.h
--- cipe/cryptoapi.h    3 Aug 2004 08:21:17 -0000      1.6
+++ cipe/cryptoapi.h    6 Nov 2005 17:40:31 -0000
@@ -90,10 +90,12 @@
 
 #endif
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,13)
 static inline void *crypto_tfm_ctx(struct crypto_tfm *tfm)
 {
    return (void *)&tfm[1];
 }
+#endif
 
 static inline void crypto_cipher_encrypt_blk(struct crypto_tfm *tfm,
                                              u8 *dst,
Index: cipe/device.c
===================================================================
RCS file: /cvsroot/cipe-linux/cipe-linux/cipe/device.c,v
retrieving revision 1.56
diff -u -r1.56 device.c
--- cipe/device.c        3 Aug 2004 08:21:17 -0000        1.56
+++ cipe/device.c        6 Nov 2005 17:40:31 -0000
@@ -441,7 +441,7 @@
        dprintk(DEB_CALL, (KERN_INFO "%s: closing\n", c->dev->name));
        /* Tell the attached socket we're going down */
        SOCK(c)->sk_shutdown=SHUTDOWN_MASK;
-        SOCK(c)->sk_zapped=1;
+        sock_set_flag(SOCK(c), SOCK_ZAPPED);
        SOCK(c)->sk_err=ENXIO;
        SOCK(c)->sk_error_report(SOCK(c));
 #ifdef LINUX_21
Index: cipe/output.c
===================================================================
RCS file: /cvsroot/cipe-linux/cipe-linux/cipe/output.c,v
retrieving revision 1.52
diff -u -r1.52 output.c
--- cipe/output.c        6 Mar 2004 22:16:41 -0000        1.52
+++ cipe/output.c        6 Nov 2005 17:40:32 -0000
@@ -210,7 +210,7 @@
        if (tunnel->flags&CIPF_FORCE_MTU) {
                mtu = dev->mtu;
        } else {
-                mtu = dst_pmtu(&rt->u.dst) - (cipehdrlen+cipefootlen);
+                mtu = dst_mtu(&rt->u.dst) - (cipehdrlen+cipefootlen);
                if (tunnel->sockshost)
                            mtu -= sizeof(struct sockshdr);
        }
Index: cipe/sock.c
===================================================================
RCS file: /cvsroot/cipe-linux/cipe-linux/cipe/sock.c,v
retrieving revision 1.47
diff -u -r1.47 sock.c
--- cipe/sock.c        6 Mar 2004 22:16:41 -0000        1.47
+++ cipe/sock.c        6 Nov 2005 17:40:32 -0000
@@ -49,6 +49,17 @@
    BUG_ON((!c) || (c->magic!=CIPE_MAGIC)); \
    dprintk(DEB_CALL, (KERN_INFO "%s: " nam "\n", c->dev->name));
 
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,14)
+/* since kernel 2.6.14 the sk_buff structure doesn't use struct timeval anymore
+ * so we have to copy that stuff on our own */
+static inline void get_fast_time(struct skb_timeval *skbtv)
+{
+    struct timeval tv;
+    do_gettimeofday(&tv);
+    skbtv->off_sec = tv.tv_sec;
+    skbtv->off_usec= tv.tv_usec;
+}
+#endif
 
 /* Close the socket */
 void cipe_sock_close(struct sock *sock, timeout_t timeout)
@@ -318,8 +329,12 @@
        }
 
 #ifdef LINUX_21
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,14)
+        get_fast_time(&n->tstamp);
+#else
        get_fast_time(&n->stamp);
 #endif
+#endif
        /* No checkpeer() here because not authenticated! */
        n->h.uh->check=0;
        return n;
@@ -347,8 +362,12 @@
            dprintk(DEB_INP, (KERN_DEBUG "TW_NEWKEY data=%p len=" FLEN
                              " length=%d\n", n->data, n->len, length));
 #ifdef LINUX_21
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,14)
+            get_fast_time(&n->tstamp);
+#else
            get_fast_time(&n->stamp);
 #endif
+#endif
            skb_trim(n, length);
            checkpeer(c, rsaddr, rsport);
 #if 0
@@ -509,7 +528,11 @@
 #else
        memcpy_toiovec(msg->msg_iov, skb->data, copied);
 #endif
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,14)
+        skb_get_timestamp(skb, &sk->sk_stamp);
+#else
        sk->sk_stamp=skb->stamp;
+#endif
 
        /* Copy the address. */
        if (sin
@@ -554,7 +577,7 @@
    if (!(file=fget(parm->fd)))
        return(-EBADF);
    inode = file->f_dentry->d_inode;
-    if (!inode || !inode->i_sock || !(sock=SOCKET_I(inode))) {
+    if (!inode || !S_ISSOCK(inode->i_mode) || !(sock=SOCKET_I(inode))) {
        fput(file);
        return(-ENOTSOCK);
    }

Does this have to be included in the compilation process somehow so that the patch is compiled as part of the module? I suspect this should work with some tinkering since I have another linux machine with the 2.6.x kernel that is using CIPE (I didn't set it up though).

T3slider 11-05-2008 07:27 PM

Patch the source by executing the following command in the build directory:
Code:

$ patch -p0 < /path/to/cipe-2.6.14.patch
Then just compile as usual. The patch just edits a few files, adding (or removing) lines from the listed .c files. When they are patched, it should compile properly.


All times are GMT -5. The time now is 05:18 AM.