31st Jan 2005 Stuart Hughes stuarth@freescale.com -------------------------------------------------- When building net-tools with a toolchain that has Linux 2.6 kernel headers, you see the following error: cc -D_GNU_SOURCE -O2 -Wall -g -I. -idirafter ./include/ -Ilib -I/home/seh/beijing/cwtb/rfs/rpm/BUILD/net-tools-1.60 -idirafter /home/seh/beijing/cwtb/rfs/rpm/BUILD/net-tools-1.60/include -c -o x25_sr.o x25_sr.c x25_sr.c: In function `X25_setroute': x25_sr.c:80: error: `x25_address' undeclared (first use in this function) x25_sr.c:80: error: (Each undeclared identifier is reported only once x25_sr.c:80: error: for each function it appears in.) This is due to a header file change in linux/x25.h. This patch fixes that. Modified this patch so that it's backward compatible with 2.4 kernels diff --exclude CVS -uNr net-tools-1.60/lib/x25_sr.c net-tools-1.60.modified/lib/x25_sr.c --- net-tools-1.60/lib/x25_sr.c Sat May 20 14:38:10 2000 +++ net-tools-1.60.modified/lib/x25_sr.c Mon Jan 31 14:18:46 2005 @@ -22,6 +22,7 @@ #include #include #include +#include #include #include #include @@ -77,7 +78,12 @@ rt.sigdigits=sigdigits; /* x25_route_struct.address isn't type struct sockaddr_x25, Why? */ +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0) +#warning this is a 2.4 kernel memcpy(&rt.address, &sx25.sx25_addr, sizeof(x25_address)); +#else + memcpy(&rt.address, &sx25.sx25_addr, sizeof(struct x25_address)); +#endif while (*args) { if (!strcmp(*args,"device") || !strcmp(*args,"dev")) {