Patch to build CIPE 1.6.0 for gentoo-sources-2.6.13-r3
Dimas Moreira Junior <[email protected]> Sat, 15 Oct 2005 04:44:22 -0300
| Newsgroups | gmane.comp.encryption.cipe |
|---|---|
| Message-ID | <1129362262.19732.12.camel@localhost> |
--=-OaYLkvgWIPQOl10j9FfJ Content-Type: text/plain Content-Transfer-Encoding: 7bit A patch for Gentoo users, to make CIPE 1.6.0 build under gentoo-sources-2.6.13-r3. I hope it will work with a vanilla kernel too. I doubt it will work with earlier versions, it's just a dirty hack from a java programmer needing to make it work in gentoo with the latest kernel. It includes the patch sent by Dick St.Peters <[email protected]> for the kernel API changes as of kernel 2.6.12.3. --=-OaYLkvgWIPQOl10j9FfJ Content-Disposition: attachment; filename=cipe-1.6.0-gentoo-sources-2.6.13-r3.patch Content-Type: text/x-patch; name=cipe-1.6.0-gentoo-sources-2.6.13-r3.patch; charset=UTF-8 Content-Transfer-Encoding: 7bit This patches cipe-1.6.0 for compiling with gentoo-sources-2.6.13-r3. It builds upon the patch sent by Dick St.Peters <[email protected]> for the kernel API changes as of kernel 2.6.12.3. Patch generated 20051015 by Dimas M. Junior <[email protected]>. --- cipe-1.6.0/cipe/cipe.h 2004-08-04 10:51:14.000000000 -0300 +++ cipe-1.6.0/cipe/cipe.h 2005-10-15 03:55:30.000000000 -0300 @@ -271,10 +271,10 @@ #endif #ifdef LINUX_25 -#define CURRENT_TIME_SEC (xtime.tv_sec) +#define CURRENT_TIME_SECONDS (xtime.tv_sec) #define ip_send dst_output #else -#define CURRENT_TIME_SEC (CURRENT_TIME) +#define CURRENT_TIME_SECONDS (CURRENT_TIME) #define SOCKET_I(inode) (&(inode)->u.socket_i) /* XX: the SCTP headers in 2.4 contain definitions for the following two macros which differ from those needed in CIPE */ @@ -346,7 +346,7 @@ #ifdef LINUX_25 struct inet_sock *sock; #define SOCK(c) ((struct sock*)((c)->sock)) -#define IOPT(c) (&(c)->sock->inet) +#define IOPT(c) ((c)->sock) #else struct sock *sock; #define SOCK(c) ((c)->sock) --- cipe-1.6.0/cipe/cryptoapi.h 2004-08-03 05:21:17.000000000 -0300 +++ cipe-1.6.0/cipe/cryptoapi.h 2005-10-15 03:10:52.000000000 -0300 @@ -90,11 +90,6 @@ #endif -static inline void *crypto_tfm_ctx(struct crypto_tfm *tfm) -{ - return (void *)&tfm[1]; -} - static inline void crypto_cipher_encrypt_blk(struct crypto_tfm *tfm, u8 *dst, const u8 *src) diff -uNr cipe-1.6.0/cipe/device.c cipe-1.6.0-gentoo-2.6.13-r3/cipe/device.c --- cipe-1.6.0/cipe/device.c 2004-08-03 05:21:17.000000000 -0300 +++ cipe-1.6.0/cipe/device.c 2005-10-15 04:04:45.000000000 -0300 @@ -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 @@ -670,7 +670,7 @@ driver_version, cipe_maxdev); #endif - prnseed=(~jiffies)^CURRENT_TIME_SEC; + prnseed=(~jiffies)^CURRENT_TIME_SECONDS; cipe_ctrls = (struct cipe_ctrl **) kmalloc(sizeof(void*)*cipe_maxdev, GFP_KERNEL); if (!cipe_ctrls) { diff -uNr cipe-1.6.0/cipe/output.c cipe-1.6.0-gentoo-2.6.13-r3/cipe/output.c --- cipe-1.6.0/cipe/output.c 2004-03-06 19:16:41.000000000 -0300 +++ cipe-1.6.0/cipe/output.c 2005-10-15 03:05:52.000000000 -0300 @@ -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); } diff -uNr cipe-1.6.0/cipe/sock.c cipe-1.6.0-gentoo-2.6.13-r3/cipe/sock.c --- cipe-1.6.0/cipe/sock.c 2004-03-06 19:16:41.000000000 -0300 +++ cipe-1.6.0/cipe/sock.c 2005-10-15 04:04:45.000000000 -0300 @@ -110,7 +110,7 @@ return -EINVAL; } } - (*(__u32 *)(buf+KEYXCHGTSPOS))=htonl(CURRENT_TIME_SEC); /* timestamp */ + (*(__u32 *)(buf+KEYXCHGTSPOS))=htonl(CURRENT_TIME_SECONDS); /* timestamp */ if (msg->msg_flags&MSG_OOB) { memset(buf, 0, ivs); } else { @@ -554,7 +554,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); } @@ -744,7 +744,7 @@ one _bit_... */ skb->data[sizeof(struct udphdr)]=typ; (*(__u32 *)(skb->data+sizeof(struct udphdr)+KEYXCHGTSPOS))= - htonl(CURRENT_TIME_SEC); /* even need timestamp */ + htonl(CURRENT_TIME_SECONDS); /* even need timestamp */ if (sock_queue_rcv_skb(SOCK(c), skb)<0) { printk(KERN_WARNING "%s: cipe_fakenkey: enqueuing failed\n", --- cipe-1.6.0/pkcipe/Makefile.in 2003-05-10 17:07:44.000000000 -0300 +++ cipe-1.6.0/pkcipe/Makefile.in 2005-10-15 04:29:25.000000000 -0300 @@ -46,7 +46,7 @@ chmod 700 /etc/cipe /etc/cipe/pk /var/run/cipe @if [ ! -f /etc/cipe/identity.priv ] ; then \ echo "*** Generating new identity (host) key ***" ;\ - rsa-keygen /etc/cipe/identity ;\ + $(bindir)/rsa-keygen /etc/cipe/identity ;\ fi clean: --=-OaYLkvgWIPQOl10j9FfJ-- -- Message sent by the [email protected] mailing list. Unsubscribe: mail [email protected], "unsubscribe cipe-l" in body Other commands available with "help" in body to the same address. CIPE info and list archive: <URL:http://sites.inka.de/~bigred/devel/cipe.html>