#7 compile fixes for kernel >= 2.6.12

open
nobody
None
5
2005-06-19
2005-06-19
Jens Maus
No

Since kernel 2.6.12 some important structures have
slightly changed and the dst_pmtu() function was
replaced by the new dst_mtu() one.
This however leaves cipe to not compile/work with
kernel 2.6.12 and newer.

The following quick patch is a patch to address these
changes and get cipe working for 2.6.12 kernels. The
diff was done against the latest CVS checkout:

-- cut here --

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 19 Jun 2005 22:18:21 -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
===================================================================
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 19 Jun 2005 22:18:21 -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);
}
===================================================================
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 19 Jun 2005 22:18:22 -0000
@@ -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);
}
-- cut here --

Discussion

  • Jens Maus
    Jens Maus
    2005-06-19

    patch against latest CVS checkout to compile for 2.6.12 kernels

     
    Attachments