whirler |
11-05-2008 05:31 PM |
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).
|