Hello All,
I am not sure if this is the most appropriate forum to post this information or not, but it's worth a shot and may help someone along the way.
Last week, I got a licensed copy of Apini's (Nortel) VPN client for linux cvc_linux-rh-gcc3-3.3 and I tried to install it against my fedora core 4 laptop with all the stable updates (including the kernel). Currently, I am at kernel version 2.6.14.xx.
Out of the box, when I invoked the make on Fedora Core 4 with 2.6.14-1, I got:
[root@hadji cvc_linux-rh-gcc3-3.3]# make all
cd src && make all
make[1]: Entering directory `/usr/src/redhat/TARBALLS/cvc_linux-rh-gcc3-3.3/src'
cd k2.6 && make
make[2]: Entering directory `/usr/src/redhat/TARBALLS/cvc_linux-rh-gcc3-3.3/src/k2.6'
make -C /lib/modules/2.6.14-1.1644_FC4/build SUBDIRS=/usr/src/redhat/TARBALLS/cvc_linux-rh-gcc3-3.3/src/k2.6 modules
make[3]: Entering directory `/usr/src/kernels/2.6.14-1.1644_FC4-i686'
CC [M] /usr/src/redhat/TARBALLS/cvc_linux-rh-gcc3-3.3/src/k2.6/linux_wrapper.o
/usr/src/redhat/TARBALLS/cvc_linux-rh-gcc3-3.3/src/k2.6/linux_wrapper.c: In function ‘nl_ip_rcv’:
/usr/src/redhat/TARBALLS/cvc_linux-rh-gcc3-3.3/src/k2.6/linux_wrapper.c:418: error: too few arguments to function ‘ip_rcv’
/usr/src/redhat/TARBALLS/cvc_linux-rh-gcc3-3.3/src/k2.6/linux_wrapper.c: In function ‘nl_skb_dup’:
/usr/src/redhat/TARBALLS/cvc_linux-rh-gcc3-3.3/src/k2.6/linux_wrapper.c:526: error: ‘struct sk_buff’ has no member named ‘stamp’
/usr/src/redhat/TARBALLS/cvc_linux-rh-gcc3-3.3/src/k2.6/linux_wrapper.c:526: error: ‘struct sk_buff’ has no member named ‘stamp’
/usr/src/redhat/TARBALLS/cvc_linux-rh-gcc3-3.3/src/k2.6/linux_wrapper.c:527: error: ‘struct sk_buff’ has no member named ‘security’
/usr/src/redhat/TARBALLS/cvc_linux-rh-gcc3-3.3/src/k2.6/linux_wrapper.c:527: error: ‘struct sk_buff’ has no member named ‘security’
/usr/src/redhat/TARBALLS/cvc_linux-rh-gcc3-3.3/src/k2.6/linux_wrapper.c: In function ‘nl_skb_hdr_copy’:
/usr/src/redhat/TARBALLS/cvc_linux-rh-gcc3-3.3/src/k2.6/linux_wrapper.c:553: error: ‘struct sk_buff’ has no member named ‘stamp’
/usr/src/redhat/TARBALLS/cvc_linux-rh-gcc3-3.3/src/k2.6/linux_wrapper.c:553: error: ‘struct sk_buff’ has no member named ‘stamp’
make[4]: *** [/usr/src/redhat/TARBALLS/cvc_linux-rh-gcc3-3.3/src/k2.6/linux_wrapper.o] Error 1
make[3]: *** [_module_/usr/src/redhat/TARBALLS/cvc_linux-rh-gcc3-3.3/src/k2.6] Error 2
make[3]: Leaving directory `/usr/src/kernels/2.6.14-1.1644_FC4-i686'
make[2]: *** [kmod_build] Error 2
make[2]: Leaving directory `/usr/src/redhat/TARBALLS/cvc_linux-rh-gcc3-3.3/src/k2.6'
make[1]: *** [all] Error 2
make[1]: Leaving directory `/usr/src/redhat/TARBALLS/cvc_linux-rh-gcc3-3.3/src'
make: *** [all] Error 2
The compilation errors are due to the fact that sk_buff has undergone some changes between 2.6.13 and 2.6.14, namely, stamp has been redefined as tstamp (for time stamp) and security has been redefined to sp (for security path). I am guessing for clarity ?? Since the functions that use the sk_buff attributes are simply doing a copy from sk_buff structure to sk_buff structure, I felt it was safe to just make a global substitution for these attributes.
The other change in the 2.6.14 kernel is that ip_rcv takes an extra pointer to sk_buff than it had previously. If I'm not mistaken, this change was made several releases prior? The current prototype looks like this:
extern int ip_rcv(struct sk_buff *skb, struct net_device *dev,
struct packet_type *pt, struct net_device *orig_dev);
I initially thought by passing the same pointer twice would solve the problem. When I did this, I got...
[root@hadji cvc_linux-rh-gcc3-3.3]# make all
cd src && make all
make[1]: Entering directory `/usr/local/cvc_linux-rh-gcc3-3.3/src'
cd k2.6 && make
make[2]: Entering directory `/usr/local/cvc_linux-rh-gcc3-3.3/src/k2.6'
make -C /lib/modules/2.6.14-1.1644_FC4/build SUBDIRS=/usr/local/cvc_linux-rh-gcc3-3.3/src/k2.6 modules
make[3]: Entering directory `/usr/src/kernels/2.6.14-1.1644_FC4-i686'
Building modules, stage 2.
MODPOST
Warning: could not find /usr/local/cvc_linux-rh-gcc3-3.3/src/k2.6/../.libmishim-2.6.a.cmd for /usr/local/cvc_linux-rh-gcc3-3.3/src/k2.6/../libmishim-2.6.a
*** Warning: "ip_rcv" [/usr/local/cvc_linux-rh-gcc3-3.3/src/k2.6/mishim.ko] undefined!
make[3]: Leaving directory `/usr/src/kernels/2.6.14-1.1644_FC4-i686'
make[2]: Leaving directory `/usr/local/cvc_linux-rh-gcc3-3.3/src/k2.6'
make[1]: Leaving directory `/usr/local/cvc_linux-rh-gcc3-3.3/src'
Unfortunately, the problem with that was that the new kernel (in ip_input.c) the EXPORT_SYMBOL(ip_rcv) was removed so that modules cannot directly call on ip routines. I noticed in the kernel mailing lists somewhere that modules should use netif calls instead (in this case, netif_rx which takes a single argument, the pointer to sk_buff). After making that change, I invoked make again and got:
[root@hadji cvc_linux-rh-gcc3-3.3]# make all
cd src && make all
make[1]: Entering directory `/usr/local/cvc_linux-rh-gcc3-3.3/src'
cd k2.6 && make
make[2]: Entering directory `/usr/local/cvc_linux-rh-gcc3-3.3/src/k2.6'
make -C /lib/modules/2.6.14-1.1653_FC4/build SUBDIRS=/usr/local/cvc_linux-rh-gcc3-3.3/src/k2.6 modules
make[3]: Entering directory `/usr/src/kernels/2.6.14-1.1653_FC4-i686'
CC [M] /usr/local/cvc_linux-rh-gcc3-3.3/src/k2.6/linux_wrapper.o
LD [M] /usr/local/cvc_linux-rh-gcc3-3.3/src/k2.6/mishim.o
CC [M] /usr/local/cvc_linux-rh-gcc3-3.3/src/k2.6/nlvcard.o
Building modules, stage 2.
MODPOST
Warning: could not find /usr/local/cvc_linux-rh-gcc3-3.3/src/k2.6/../.libmishim-2.6.a.cmd for /usr/local/cvc_linux-rh-gcc3-3.3/src/k2.6/../libmishim-2.6.a
CC /usr/local/cvc_linux-rh-gcc3-3.3/src/k2.6/mishim.mod.o
LD [M] /usr/local/cvc_linux-rh-gcc3-3.3/src/k2.6/mishim.ko
CC /usr/local/cvc_linux-rh-gcc3-3.3/src/k2.6/nlvcard.mod.o
LD [M] /usr/local/cvc_linux-rh-gcc3-3.3/src/k2.6/nlvcard.ko
make[3]: Leaving directory `/usr/src/kernels/2.6.14-1.1653_FC4-i686'
make[2]: Leaving directory `/usr/local/cvc_linux-rh-gcc3-3.3/src/k2.6'
make[1]: Leaving directory `/usr/local/cvc_linux-rh-gcc3-3.3/src'
This last error is a little puzzling to me. At this current moment, I am kind of leaning to a problem in the makefile. Maybe someone can shed some light on it. So far as I can tell, the makefile is trying to link in some static libraries (archives) but for some reason, the kernel make system does not seem to know how handle them or that they are not being specified correctly in the makefile such that the kernel make system can generate a proper command for linking in these static libraries.
Is there somewhere else that I should be looking at?
# Makefile
obj-m += mishim.o nlvcard.o
mishim-libs += ../libmishim-2.6.a ../libnlcmp.a ../libz.a ../liblzs.a
mishim-c-objs += linux_wrapper.o
mishim-objs += $(mishim-c-objs) $(mishim-libs)
EXTRA_CFLAGS += -fno-common -w
ifeq ($(KERNELRELEASE),)
KVER = $(shell uname -r)
ifeq (1,1)
KDIR = /lib/modules/$(KVER)/build
else
KDIR = /usr/src/linux-$(KVER)
endif
PWD = $(shell pwd)
mishim-cfiles = ${mishim-c-objs:.o=.c}
kmod_build:: $(mishim-libs) $(mishim-cfiles)
$(MAKE) -C $(KDIR) SUBDIRS=$(PWD) modules
@cp mishim.ko ../mishim.o
@cp nlvcard.ko ../nlvcard.o
%.c:
@ln -s ../linux_wrapper.c
clean:
-rm -rf *.o *.ko *.mod.* .??*
install: all
@echo "Installing VPN agent."
cd .. && ./install.sh
uninstall:
@echo "Uninstalling VPN agent."
cd .. && ./uninstall.sh
endif


Reply With Quote
a little confused, but here's a snippet from my working linux_wrapper.c. This is NOT a diff output (obviously).
