<< | Thread Index | >> ]    [ << | Date Index | >> ]

To: "CIPE-list" <cipe-l,AT,inka,DOT,de>
Subject: cipe-1.6.0 - 3 patches solving 3 problems
From: "Hans Steegers" <hans,AT,steegers,DOT,nl>
Date: Tue, 8 Feb 2005 15:54:35 +0100
Reply-to: "Hans Steegers" <steegers,AT,steegers,DOT,nl>

Hi All,
The following three patches solve three problems I encountered when building
CIPE 1.6.0, one of which is a serious bug.
-1- conf/Makefile-top.in: Wrong switch when invoking autoconf from top
Makefile.
    "-l" should be replaced by "-I". The same applies also to cipe-1.5.x
-2- configure.in: Dependency on an undocumented autoconf 2.13 behaviour that
    fails using later versions of autoconf.
    The result is that config.h is placed in the root directory instead of
    in the BUILD-directory. The same applies also to cipe-1.5.x
-3- cipe/device.c
    When both the cipcb and cipdb modules are loaded in the same 2.6 kernel,
    the kernel will panic when the cipxb modules are unloaded:
 The first will free memory for both drivers, for example:
 ..
 Feb  5 15:48:34 .. kernel: cipcb: freeing cipdb0
 Feb  5 15:48:34 .. kernel: cipdb: freeing cipdb0
 Feb  5 15:48:37 .. kernel: cipcb: freeing cipcb0
    and the kernel panics..

%<--------------------------------------------------------------------------
1->%
--- Makefile-top.in.orig        2003-05-10 22:07:44.000000000 +0200
+++ Makefile-top.in     2005-02-05 15:45:24.000000000 +0100
@@ -120,7 +120,7 @@
        : nothing to do

 configure: configure.in conf/aclocal.m4
-       autoconf -l conf
+       autoconf -I conf

 config.status: configure
        @if test -f config.status; then mv -f config.status config.tmp; \
%<--------------------------------------------------------------------------
2->%
--- configure.in.orig   2004-08-04 15:51:13.000000000 +0200
+++ configure.in        2005-02-08 01:45:09.000000000 +0100
@@ -11,8 +11,6 @@
 AC_REVISION($Id: configure.in,v 1.49 2004/08/04 13:51:13 olaf81825 Exp $)
 AC_PREREQ(2.13)
 AC_INIT(cipe/ciped.c)
-AC_CONFIG_HEADER($BUILD/config.h:conf/config.h.in pkcipe/config.h)
-dnl $BUILD is set below - this works for autoconf 2.13, somewhat
undocumented

 AC_SUBST(VERSION)
 VERSION=1.6.0
@@ -412,6 +410,8 @@
   BUILD=$KVERS-$ARCH-$verl$crypt$name
 fi

+AC_CONFIG_HEADER($BUILD/config.h:conf/config.h.in pkcipe/config.h)
+
 AC_SUBST(BUILD_PKCIPE)
 set `echo $VERSION | tr . ' '`
 AC_DEFINE_UNQUOTED(VERSION_MAJ, $1)
%<--------------------------------------------------------------------------
3->%
--- device.c.orig       2004-08-03 10:21:17.000000000 +0200
+++ device.c    2005-02-06 01:55:53.000000000 +0100
@@ -634,8 +634,12 @@
         if (cc->cipe.magic!=CIPE_MAGIC) {
             printk(KERN_WARNING DEVNAME ": Ouch: cipe_netdev_event() wrong
struct\n");
         } else {
-            printk(KERN_DEBUG DEVNAME ": freeing %s\n", cc->dev.name);
-            kfree(cc);
+           if (strncmp(DEVNAME,cc->dev.name,5)==0) {
+               printk(KERN_DEBUG DEVNAME ": freeing %s\n", cc->dev.name);
+                kfree(cc);
+//         } else {
+//             printk(KERN_DEBUG DEVNAME ": NOT freeing %s\n",
cc->dev.name);
+           }
         }
     }
     return NOTIFY_DONE;

%<--------------------------------------------------------------------------
-->%

Regards,
Hans Steegers
hsx_AT_dds.nl
%<--------------------------------------------------------------------------1->%
--- Makefile-top.in.orig        2003-05-10 22:07:44.000000000 +0200
+++ Makefile-top.in     2005-02-05 15:45:24.000000000 +0100
@@ -120,7 +120,7 @@
        : nothing to do

 configure: configure.in conf/aclocal.m4
-       autoconf -l conf
+       autoconf -I conf

 config.status: configure
        @if test -f config.status; then mv -f config.status config.tmp; \
%<--------------------------------------------------------------------------2->%
--- configure.in.orig   2004-08-04 15:51:13.000000000 +0200
+++ configure.in        2005-02-08 01:45:09.000000000 +0100
@@ -11,8 +11,6 @@
 AC_REVISION($Id: configure.in,v 1.49 2004/08/04 13:51:13 olaf81825 Exp $)
 AC_PREREQ(2.13)
 AC_INIT(cipe/ciped.c)
-AC_CONFIG_HEADER($BUILD/config.h:conf/config.h.in pkcipe/config.h)
-dnl $BUILD is set below - this works for autoconf 2.13, somewhat undocumented

 AC_SUBST(VERSION)
 VERSION=1.6.0
@@ -412,6 +410,8 @@
   BUILD=$KVERS-$ARCH-$verl$crypt$name
 fi

+AC_CONFIG_HEADER($BUILD/config.h:conf/config.h.in pkcipe/config.h)
+
 AC_SUBST(BUILD_PKCIPE)
 set `echo $VERSION | tr . ' '`
 AC_DEFINE_UNQUOTED(VERSION_MAJ, $1)
%<--------------------------------------------------------------------------3->%
--- device.c.orig       2004-08-03 10:21:17.000000000 +0200
+++ device.c    2005-02-06 01:55:53.000000000 +0100
@@ -634,8 +634,12 @@
         if (cc->cipe.magic!=CIPE_MAGIC) {
             printk(KERN_WARNING DEVNAME ": Ouch: cipe_netdev_event() wrong 
stru
         } else {
-            printk(KERN_DEBUG DEVNAME ": freeing %s\n", cc->dev.name);
-            kfree(cc);
+           if (strncmp(DEVNAME,cc->dev.name,5)==0) {
+               printk(KERN_DEBUG DEVNAME ": freeing %s\n", cc->dev.name);
+                kfree(cc);
+//         } else {
+//             printk(KERN_DEBUG DEVNAME ": NOT freeing %s\n", cc->dev.name);
+           }
         }
     }
     return NOTIFY_DONE;

%<---------------------------------------------------------------------------->%

<< | Thread Index | >> ]    [ << | Date Index | >> ]