fix aodv-uu build on 2.6.19, Makefile cleanup
authorNicolas Thill <nico@openwrt.org>
Sun, 17 Dec 2006 14:49:45 +0000 (14:49 +0000)
committerNicolas Thill <nico@openwrt.org>
Sun, 17 Dec 2006 14:49:45 +0000 (14:49 +0000)
SVN-Revision: 5818

net/aodv-uu/Makefile
net/aodv-uu/patches/002-linux_2.6.19_ip_route_me_harder_change.patch [new file with mode: 0644]
net/aodv-uu/patches/003-linux_2.6.19_security_netlink_recv_change.patch [new file with mode: 0644]
net/aodv-uu/patches/004-linux_2.6.19_includes.patch [new file with mode: 0644]

index 9d5d7bc61cb78b8f61ad6f01a3ae4a808f9da4e1..773053b4a310a1860040f6494bc178d4eb1ad049 100644 (file)
@@ -13,32 +13,41 @@ PKG_NAME:=aodv-uu
 PKG_VERSION:=0.9.3
 PKG_RELEASE:=1
 
-PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=http://core.it.uu.se/core/files/
 PKG_MD5SUM:=05460543054449cb4b170252a7168c65
 PKG_CAT:=zcat
 
-PKG_INSTALL_DIR:=$(PKG_BUILD_DIR)/ipkg-install
+PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
 
 include $(INCLUDE_DIR)/package.mk
 
-define Package/aodv-uu
-  SECTION:=base
-  CATEGORY:=Network
+define Package/aodv-uu/Default
   TITLE:=Ad-hoc On-demand Distance Vector Routing
   DESCRIPTION:=\
-       Ad-hoc On-demand Distance Vector Routing
-  URL:=http://core.it.uu.se/adhoc/AodvUUImpl
+       AODV is the Ad-hoc On-demand Distance Vector routing protocol \\\
+       implementation created at Uppsala University.
+  URL:=http://core.it.uu.se/core/index.php/AODV-UU
+endef
+
+define Package/aodv-uu
+  $(call Package/aodv-uu/Default)
+  SECTION:=net
+  CATEGORY:=Network
+  TITLE+= (daemon)
+  DESCRIPTION+=\\\
+       \\\
+       This package contains the AODV userland daemon.
 endef
 
 define Package/kmod-aodv-uu
+  $(call Package/aodv-uu/Default)
   SECTION:=kernel
   CATEGORY=Kernel drivers
-  TITLE:=kernel module for Ad-hoc On-demand Distance Vector Routing
-  DESCRIPTION:=\
-       Ad-hoc On-demand Distance Vector Routing
-  URL:=http://core.it.uu.se/adhoc/AodvUUImpl
+  TITLE+= (kernel module)
+  DESCRIPTION+=\\\
+       \\\
+       This package contains the AODV kernel module.
 endef
 
 ifeq ($(CONFIG_LINUX_2_6),y)
@@ -55,9 +64,10 @@ else
   # We assume 2.4 builds are only for brcm-2.4 yet
   define Build/Compile/linux24-brcm
        $(call Build/Compile/Default,\
-               KERNEL_DIR="$(LINUX_DIR)/" \
+               KERNEL_DIR="$(LINUX_DIR)" \
                KCC="$(TARGET_CC)" \
-               CFLAGS="$(TARGET_CFLAGS)" kaodv-mips \
+               CFLAGS="$(TARGET_CFLAGS)" \
+               kaodv-mips \
        )
        cp $(PKG_BUILD_DIR)/lnx/kaodv-mips.$(LINUX_KMOD_SUFFIX) $(PKG_BUILD_DIR)/lnx/kaodv.$(LINUX_KMOD_SUFFIX)
   endef
@@ -67,9 +77,10 @@ define Build/Compile
        $(call Build/Compile/linux26)
        $(call Build/Compile/linux24-brcm)
        $(call Build/Compile/Default,\
-               KERNEL_DIR="$(LINUX_DIR)/" \
-                KCC="$(TARGET_CC)" \
-                CFLAGS="$(TARGET_CFLAGS)" aodvd \
+               KERNEL_DIR="$(LINUX_DIR)" \
+               KCC="$(TARGET_CC)" \
+               CFLAGS="$(TARGET_CFLAGS)" \
+               aodvd \
        )
 endef
 
@@ -79,7 +90,7 @@ define Package/aodv-uu/install
 endef
 
 define Package/kmod-aodv-uu/install
-       mkdir -p $(1)/etc/modules.d
+       $(INSTALL_DIR) $(1)/etc/modules.d
        $(INSTALL_DATA) ./files/aodv-uu.modules $(1)/etc/modules.d/80-aodv-uu
        $(INSTALL_DIR) $(1)/lib/modules/$(LINUX_VERSION)
        $(CP) $(PKG_BUILD_DIR)/lnx/kaodv.$(LINUX_KMOD_SUFFIX) $(1)/lib/modules/$(LINUX_VERSION)/
diff --git a/net/aodv-uu/patches/002-linux_2.6.19_ip_route_me_harder_change.patch b/net/aodv-uu/patches/002-linux_2.6.19_ip_route_me_harder_change.patch
new file mode 100644 (file)
index 0000000..b8b6583
--- /dev/null
@@ -0,0 +1,47 @@
+diff -ruN aodv-uu-0.9.3-old/lnx/kaodv-mod.c aodv-uu-0.9.3-new/lnx/kaodv-mod.c
+--- aodv-uu-0.9.3-old/lnx/kaodv-mod.c  2006-09-20 19:58:38.000000000 +0200
++++ aodv-uu-0.9.3-new/lnx/kaodv-mod.c  2006-12-16 22:08:01.000000000 +0100
+@@ -19,7 +19,7 @@
+  * Author: Erik Nordström, <erik.nordstrom@it.uu.se>
+  * 
+  *****************************************************************************/
+-#include <linux/config.h>
++#include <linux/autoconf.h>
+ #include <linux/version.h>
+ #ifdef KERNEL26
+@@ -258,7 +258,11 @@
+                       if (!(*skb))
+                               return NF_STOLEN;
+                       
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,19)
++                      ip_route_me_harder(skb, RTN_UNSPEC);
++#else
+                       ip_route_me_harder(skb);
++#endif
+               }
+               break;
+       case NF_IP_POST_ROUTING:
+diff -ruN aodv-uu-0.9.3-old/lnx/kaodv-queue.c aodv-uu-0.9.3-new/lnx/kaodv-queue.c
+--- aodv-uu-0.9.3-old/lnx/kaodv-queue.c        2006-09-20 19:58:38.000000000 +0200
++++ aodv-uu-0.9.3-new/lnx/kaodv-queue.c        2006-12-16 22:17:16.000000000 +0100
+@@ -29,6 +29,7 @@
+ #include <linux/spinlock.h>
+ #include <linux/sysctl.h>
+ #include <linux/proc_fs.h>
++#include <linux/version.h>
+ #include <net/sock.h>
+ #include <net/route.h>
+ #include <net/icmp.h>
+@@ -246,7 +247,11 @@
+                               if (!entry->skb)
+                                       goto next;
+                       }
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,19)
++                      ip_route_me_harder(&entry->skb, RTN_UNSPEC);
++#else
+                       ip_route_me_harder(&entry->skb);
++#endif
+                       pkts++;
diff --git a/net/aodv-uu/patches/003-linux_2.6.19_security_netlink_recv_change.patch b/net/aodv-uu/patches/003-linux_2.6.19_security_netlink_recv_change.patch
new file mode 100644 (file)
index 0000000..725f03b
--- /dev/null
@@ -0,0 +1,15 @@
+diff -ruN aodv-uu-0.9.3-old/lnx/kaodv-netlink.c aodv-uu-0.9.3-new/lnx/kaodv-netlink.c
+--- aodv-uu-0.9.3-old/lnx/kaodv-netlink.c      2006-09-20 19:58:38.000000000 +0200
++++ aodv-uu-0.9.3-new/lnx/kaodv-netlink.c      2006-12-16 22:14:14.000000000 +0100
+@@ -284,7 +284,11 @@
+ /*            RCV_SKB_FAIL(-EINVAL); */
+ #ifdef KERNEL26
++# if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,19)     
++      if (security_netlink_recv(skb, CAP_NET_ADMIN))
++# else        
+       if (security_netlink_recv(skb))
++# endif
+               RCV_SKB_FAIL(-EPERM);
+ #endif
+       //write_lock_bh(&queue_lock);
diff --git a/net/aodv-uu/patches/004-linux_2.6.19_includes.patch b/net/aodv-uu/patches/004-linux_2.6.19_includes.patch
new file mode 100644 (file)
index 0000000..7ee2220
--- /dev/null
@@ -0,0 +1,21 @@
+--- aodv-uu-0.9.3-old/main.c   2006-09-20 19:58:38.000000000 +0200
++++ aodv-uu-0.9.3/main.c       2006-12-16 22:27:36.000000000 +0100
+@@ -26,6 +26,8 @@
+ #include <sys/types.h>
+ #include <sys/socket.h>
+ #include <sys/stat.h>
++#include <linux/types.h>
++#include <linux/if.h>
+ #include <linux/sockios.h>
+ #include <linux/wireless.h>
+ #include <getopt.h>
+--- aodv-uu-0.9.3-old/nl.c     2006-09-20 19:58:38.000000000 +0200
++++ aodv-uu-0.9.3/nl.c 2006-12-16 22:29:55.000000000 +0100
+@@ -33,6 +33,7 @@
+ #include <netinet/in.h>
+ #include <arpa/inet.h>
+ #include <linux/rtnetlink.h>
++#include <linux/if_addr.h>
+ #include "defs.h"
+ #include "lnx/kaodv-netlink.h"