Summary:ASTERISK-03124: [patch] zconfig.h kernel version check incorrect for 2.4.20
Reporter:drmac (drmac)Labels:
Date Opened:2004-12-29 08:49:50.000-0600Date Closed:2008-06-07 10:47:03
Versions:Frequency of
Environment:Attachments:( 0) makefile_patch.txt
Description:Hey gang,
I've got 2.4.20-8 kernel here and tried to compile zaptel for HDLC last night. I kept getting the following error:

[root@asterisk zaptel]# make
cc -I. -O4 -g -Wall -DBUILDING_TONEZONE    -DSTANDALONE_ZAPATA -DZAPTEL_CONFIG=\"/etc/zaptel.conf\"   -c -o gendigits.o gendigits.c
cc -o gendigits gendigits.o -lm
gcc -I/usr/src/linux-2.4/include -O6 -DMODULE -D__KERNEL__ -DEXPORT_SYMTAB -I/usr/src/linux/drivers/net -Wall -I. -Wstrict-prototypes -fomit-frame-pointer -I/usr/src/linux/drivers/net/wan -I /usr/src/linux/include -I/usr/src/linux/include/net -DMODVERSIONS -include /usr/src/linux-2.4/include/linux/modversions.h  -DSTANDALONE_ZAPATA -c zaptel.c
zaptel.c: In function `zt_ctl_ioctl':
zaptel.c:3164: warning: assignment from incompatible pointer type
zaptel.c:3166: warning: assignment from incompatible pointer type
zaptel.c:3174: structure has no member named `close'
zaptel.c:3175: structure has no member named `set_mode'
zaptel.c:3176: warning: assignment from incompatible pointer type
zaptel.c: In function `__zt_putbuf_chunk':
zaptel.c:5757: warning: implicit declaration of function `hdlc_netif_rx'
make: *** [zaptel.o] Error 1

After reading thru the code, I found out that if I changed line 63 in zaptel.c from #ifndef to #ifdef then everything compiled and worked.

I switched the #ifdef back to original, then I found the kernel check in zconfig.h and changed it to (2,4,19) and everything compiled fine and worked.

So I'm guessing that kernels 2.4.20 and higher need the new methods.


And yes, I read the section around line 100 of zconfig.h about uncommenting this, but if I'm using a freshly downloaded copy of the kernel, then all 2.4.20 users would need to uncomment this. Right?
Comments:By: drmac (drmac) 2004-12-29 08:50:46.000-0600

Also, digium says you need to uncomment it if using 2.4.19 or prior.


So thats why I'm throwing in this tiny patch.

By: drmac (drmac) 2004-12-29 08:52:27.000-0600

Oh and even though digium says:

make sethdlc-new ;use "make sethdlc" for
                ;kernels 2.4.20 and prior

that is wrong too. I had to use make sethdlc-new on my 2.4.20 kernel.

By: Malcolm Davenport (mdavenport) 2004-12-29 09:16:43.000-0600

Got it.  Change in CVS and to the HDLC.txt document.  Thanks for the find. :)

By: Russell Bryant (russell) 2005-01-01 18:15:05.000-0600

fixed in 1.0

By: Digium Subversion (svnbot) 2008-06-07 10:46:57

Repository: dahdi
Revision: 523

U   trunk/zconfig.h

r523 | malcolmd | 2008-06-07 10:46:56 -0500 (Sat, 07 Jun 2008) | 2 lines

Small change per bug ASTERISK-3124



By: Digium Subversion (svnbot) 2008-06-07 10:47:03

Repository: dahdi
Revision: 529

U   branches/v1-0/zconfig.h

r529 | russell | 2008-06-07 10:47:03 -0500 (Sat, 07 Jun 2008) | 2 lines

fix for linux 2.4.20 (bug ASTERISK-3124)