+++ /dev/null
-#
-# Copyright (C) 2006-2008 OpenWrt.org
-#
-# This is free software, licensed under the GNU General Public License v2.
-# See /LICENSE for more information.
-#
-
-include $(TOPDIR)/rules.mk
-include $(INCLUDE_DIR)/kernel.mk
-
-PKG_NAME:=aodv-uu
-PKG_VERSION:=0.9.3
-PKG_RELEASE:=1
-
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_SOURCE_URL:=http://core.it.uu.se/core/files/
-PKG_MD5SUM:=05460543054449cb4b170252a7168c65
-
-include $(INCLUDE_DIR)/package.mk
-
-define Package/aodv-uu/Default
- TITLE:=Ad-hoc On-demand Distance Vector Routing
- DEPENDS:=@BROKEN
- URL:=http://core.it.uu.se/core/index.php/AODV-UU
-endef
-
-define Package/aodv-uu/Default/description
- AODV is the Ad-hoc On-demand Distance Vector routing protocol
- implementation created at Uppsala University.
-endef
-
-define Package/aodv-uu
-$(call Package/aodv-uu/Default)
- SECTION:=net
- CATEGORY:=Network
- TITLE+= (daemon)
-endef
-
-define Package/aodv-uu/description
-$(call Package/aodv-uu/Default/description)
- This package contains the AODV userland daemon.
-endef
-
-define KernelPackage/aodv-uu
-$(call Package/aodv-uu/Default)
- TITLE+= (kernel module)
- FILES:=$(PKG_BUILD_DIR)/lnx/kaodv.$(LINUX_KMOD_SUFFIX)
- SUBMENU:=Network Support
- AUTOLOAD:=$(call AutoLoad,80,$(shell cat ./files/aodv-uu.modules))
-endef
-
-define KernelPackage/aodv-uu/description
-$(call Package/aodv-uu/Default/description)
- This package contains the AODV kernel module.
-endef
-
-ifneq ($(CONFIG_LINUX_2_4),y)
- define Build/Compile/linux26
- $(MAKE) -C $(LINUX_DIR) \
- ARCH="$(LINUX_KARCH)" \
- CROSS_COMPILE="$(TARGET_CROSS)" \
- PATCHLEVEL="$(LINUX_VERSION)" \
- KERNDIR="$(LINUX_DIR)" \
- SUBDIRS="$(PKG_BUILD_DIR)/lnx" \
- modules
- endef
-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)" \
- KCC="$(TARGET_CC)" \
- CFLAGS="$(TARGET_CFLAGS)" \
- kaodv-mips \
- )
- cp $(PKG_BUILD_DIR)/lnx/kaodv-mips.$(LINUX_KMOD_SUFFIX) $(PKG_BUILD_DIR)/lnx/kaodv.$(LINUX_KMOD_SUFFIX)
- endef
-endif
-
-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 \
- )
-endef
-
-define Package/aodv-uu/install
- $(INSTALL_DIR) $(1)/usr/sbin
- $(INSTALL_BIN) $(PKG_BUILD_DIR)/aodvd $(1)/usr/sbin
-endef
-
-define Package/kmod-aodv-uu/install
- $(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)/
-endef
-
-$(eval $(call BuildPackage,aodv-uu))
-$(eval $(call KernelPackage,aodv-uu))
+++ /dev/null
-Index: aodv-uu-0.9.3/lnx/Makefile
-===================================================================
---- aodv-uu-0.9.3.orig/lnx/Makefile 2007-06-04 13:22:19.859836128 +0200
-+++ aodv-uu-0.9.3/lnx/Makefile 2007-06-04 13:22:19.932825032 +0200
-@@ -30,7 +30,7 @@
- KCFLAGS=-Wall -Wno-strict-aliasing -O2 $(KDEFS) $(KINC) $(XDEFS)
- KCFLAGS_ARM=-Wall -O2 -D__KERNEL__ -DMODULE -nostdinc $(shell $(ARM_CC) -print-search-dirs | sed -ne 's/install: \(.*\)/-I \1include/gp') -I$(KERNEL_INC)
- KCFLAGS_MIPS=-Wall -mips2 -O2 -fno-pic -mno-abicalls -mlong-calls -G0 -msoft-float -D__KERNEL__ -DMODULE -nostdinc $(shell $(MIPS_CC) -print-search-dirs | sed -ne 's/install: \(.*\)/-I \1include/gp') -I$(KERNEL_INC) $(XDEFS)
--
-+endif
- .PHONY: clean clean-2.4 clean-2.6 indent default
-
- # Check for kernel version
-@@ -89,5 +89,3 @@
- etags *.c *.h
- indent:
- indent -kr -i8 -ts8 -sob -l80 -ss -ncs *.c *.h
--endif
--
-Index: aodv-uu-0.9.3/Makefile
-===================================================================
---- aodv-uu-0.9.3.orig/Makefile 2007-06-04 13:22:19.866835064 +0200
-+++ aodv-uu-0.9.3/Makefile 2007-06-04 13:22:19.932825032 +0200
-@@ -87,7 +87,7 @@
- mips: aodvd-mips kaodv-mips
-
- endian.h:
-- $(CC) $(CFLAGS) -o endian endian.c
-+ gcc -o endian endian.c
- ./endian > endian.h
-
- $(OBJS): %.o: %.c Makefile
-@@ -143,19 +143,18 @@
- @makedepend -Y./ -- $(DEFS) -- $(SRC) &>/dev/null
- @makedepend -a -Y./ -- $(KDEFS) kaodv.c &>/dev/null
-
--install: default
-- install -s -m 755 aodvd /usr/sbin/aodvd
-- @if [ ! -d /lib/modules/$(KERNEL)/aodv ]; then \
-- mkdir /lib/modules/$(KERNEL)/aodv; \
-- fi
--
-- @echo "Installing kernel module in /lib/modules/$(KERNEL)/aodv/";
-- @if [ -f ./kaodv.ko ]; then \
-- install -m 644 kaodv.ko /lib/modules/$(KERNEL)/aodv/kaodv.ko; \
-- else \
-- install -m 644 kaodv.o /lib/modules/$(KERNEL)/aodv/kaodv.o; \
-- fi
-- /sbin/depmod -a
-+install: install-aodvd install-kaodv
-+
-+install-aodvd:
-+ @echo "Installing aodv in $(DESTDIR)/usr/sbin";
-+ install -d -m0755 $(DESTDIR)/usr/sbin/
-+ install -m0755 aodvd $(DESTDIR)/usr/sbin/aodvd
-+
-+install-kaodv:
-+ @echo "Installing kernel module in $(DESTDIR)/lib/modules/$(KERNEL)/";
-+ install -d -m0644 $(DESTDIR)/lib/modules/$(KERNEL)/
-+ install -m 644 lnx/kaodv.$(KMOD_SUFFIX) $(DESTDIR)/lib/modules/$(KERNEL)/kaodv.$(KMOD_SUFFIX);
-+
- uninstall:
- rm -f /usr/sbin/aodvd
- rm -rf /lib/modules/$(KERNEL)/aodv
+++ /dev/null
-Index: aodv-uu-0.9.3/lnx/kaodv-mod.c
-===================================================================
---- aodv-uu-0.9.3.orig/lnx/kaodv-mod.c 2007-06-04 13:22:19.830840536 +0200
-+++ aodv-uu-0.9.3/lnx/kaodv-mod.c 2007-06-04 13:22:20.130794936 +0200
-@@ -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:
-Index: aodv-uu-0.9.3/lnx/kaodv-queue.c
-===================================================================
---- aodv-uu-0.9.3.orig/lnx/kaodv-queue.c 2007-06-04 13:22:19.837839472 +0200
-+++ aodv-uu-0.9.3/lnx/kaodv-queue.c 2007-06-04 13:22:20.130794936 +0200
-@@ -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++;
-
+++ /dev/null
-Index: aodv-uu-0.9.3/lnx/kaodv-netlink.c
-===================================================================
---- aodv-uu-0.9.3.orig/lnx/kaodv-netlink.c 2007-06-04 13:22:19.810843576 +0200
-+++ aodv-uu-0.9.3/lnx/kaodv-netlink.c 2007-06-04 13:22:20.326765144 +0200
-@@ -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);
+++ /dev/null
-Index: aodv-uu-0.9.3/main.c
-===================================================================
---- aodv-uu-0.9.3.orig/main.c 2007-06-04 13:22:19.782847832 +0200
-+++ aodv-uu-0.9.3/main.c 2007-06-04 13:22:20.513736720 +0200
-@@ -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>
-Index: aodv-uu-0.9.3/nl.c
-===================================================================
---- aodv-uu-0.9.3.orig/nl.c 2007-06-04 13:22:19.789846768 +0200
-+++ aodv-uu-0.9.3/nl.c 2007-06-04 13:22:20.513736720 +0200
-@@ -33,6 +33,10 @@
- #include <netinet/in.h>
- #include <arpa/inet.h>
- #include <linux/rtnetlink.h>
-+#include <linux/version.h>
-+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,19)
-+#include <linux/if_addr.h>
-+#endif
-
- #include "defs.h"
- #include "lnx/kaodv-netlink.h"
+++ /dev/null
-Index: aodv-uu-0.9.3/lnx/kaodv-compat.h
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ aodv-uu-0.9.3/lnx/kaodv-compat.h 2007-06-17 02:49:46.844217144 +0200
-@@ -0,0 +1,15 @@
-+#ifndef __KAODV_COMPAT_H
-+#define __KAODV_COMPAT_H
-+
-+#include <linux/version.h>
-+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,22)
-+
-+#define ip_hdr(_skb) (_skb)->nh.iph
-+#define skb_reset_network_header(_skb) do { \
-+ _skb->nh.iph = (struct iphdr *)_skb->data; \
-+ } while (0);
-+
-+
-+#endif /* LINUX_VERSION_CODE < KERNEL_VERSION(2,6,22) */
-+
-+#endif
-Index: aodv-uu-0.9.3/lnx/kaodv-ipenc.c
-===================================================================
---- aodv-uu-0.9.3.orig/lnx/kaodv-ipenc.c 2007-06-17 02:31:56.448941960 +0200
-+++ aodv-uu-0.9.3/lnx/kaodv-ipenc.c 2007-06-17 02:45:50.420159064 +0200
-@@ -64,7 +64,7 @@
- if (skb->sk != NULL)
- skb_set_owner_w(nskb, skb->sk);
-
-- iph = skb->nh.iph;
-+ iph = ip_hdr(skb);
-
- skb_put(nskb, sizeof(struct min_ipenc_hdr));
-
-@@ -78,7 +78,8 @@
- skb = nskb;
-
- /* Update pointers */
-- iph = skb->nh.iph = (struct iphdr *)skb->data;
-+ skb_reset_network_header(skb);
-+ iph = (struct iphdr *)skb->data;
-
- ipe = (struct min_ipenc_hdr *)(skb->data + (iph->ihl << 2));
-
-@@ -99,8 +100,8 @@
-
- ip_send_check(iph);
-
-- if (skb->nh.iph->id == 0)
-- ip_select_ident(skb->nh.iph, skb->dst, NULL);
-+ if (ip_hdr(skb)->id == 0)
-+ ip_select_ident(ip_hdr(skb), skb->dst, NULL);
-
- return skb;
- }
-@@ -108,9 +109,7 @@
- struct sk_buff *ip_pkt_decapsulate(struct sk_buff *skb)
- {
- struct min_ipenc_hdr *ipe;
-- /* skb->nh.iph is probably not set yet */
-- struct iphdr *iph = skb->nh.iph;
--
-+ struct iphdr *iph = ip_hdr(skb);
-
- ipe = (struct min_ipenc_hdr *)((char *)iph + (iph->ihl << 2));
-
-@@ -123,8 +122,9 @@
- skb->len - (iph->ihl << 2) - sizeof(struct min_ipenc_hdr));
-
- skb_trim(skb, skb->len - sizeof(struct min_ipenc_hdr));
--
-- skb->nh.iph = iph = (struct iphdr *)skb->data;
-+
-+ skb_reset_network_header(skb);
-+ iph = (struct iphdr *)skb->data;
-
- iph->tot_len = htons((ntohs(iph->tot_len) - sizeof(struct min_ipenc_hdr)));
- ip_send_check(iph);
-Index: aodv-uu-0.9.3/lnx/kaodv-ipenc.h
-===================================================================
---- aodv-uu-0.9.3.orig/lnx/kaodv-ipenc.h 2007-06-17 02:44:13.881835120 +0200
-+++ aodv-uu-0.9.3/lnx/kaodv-ipenc.h 2007-06-17 02:44:16.549429584 +0200
-@@ -27,6 +27,7 @@
- #include <linux/ip.h>
- #include <linux/skbuff.h>
- #include <asm/byteorder.h>
-+#include "kaodv-compat.h"
-
- #define IPPROTO_MIPE 55
-
-Index: aodv-uu-0.9.3/lnx/kaodv-mod.c
-===================================================================
---- aodv-uu-0.9.3.orig/lnx/kaodv-mod.c 2007-06-17 02:43:33.776931992 +0200
-+++ aodv-uu-0.9.3/lnx/kaodv-mod.c 2007-06-17 02:43:39.008136728 +0200
-@@ -120,7 +120,7 @@
- const struct net_device *out,
- int (*okfn) (struct sk_buff *))
- {
-- struct iphdr *iph = (*skb)->nh.iph;
-+ struct iphdr *iph = ip_hdr(*skb);
- struct expl_entry e;
- struct in_addr ifaddr, bcaddr;
- int res = 0;
-@@ -188,7 +188,7 @@
- if (is_gateway && iph->protocol == IPPROTO_MIPE &&
- iph->daddr == ifaddr.s_addr) {
- ip_pkt_decapsulate(*skb);
-- iph = (*skb)->nh.iph;
-+ iph = ip_hdr(*skb);
- return NF_ACCEPT;
- }
- /* Ignore packets generated locally or that are for this
-Index: aodv-uu-0.9.3/lnx/kaodv-mod.h
-===================================================================
---- aodv-uu-0.9.3.orig/lnx/kaodv-mod.h 2007-06-17 02:44:32.498005032 +0200
-+++ aodv-uu-0.9.3/lnx/kaodv-mod.h 2007-06-17 02:44:34.662675952 +0200
-@@ -5,6 +5,7 @@
- #include <linux/inetdevice.h>
- #include <linux/list.h>
- #include <linux/spinlock.h>
-+#include "kaodv-compat.h"
-
- /* Interface information */
- struct if_info {
-Index: aodv-uu-0.9.3/lnx/kaodv-queue.c
-===================================================================
---- aodv-uu-0.9.3.orig/lnx/kaodv-queue.c 2007-06-17 02:45:01.513593992 +0200
-+++ aodv-uu-0.9.3/lnx/kaodv-queue.c 2007-06-17 02:45:11.534070648 +0200
-@@ -152,7 +152,7 @@
- {
- int status = -EINVAL;
- struct kaodv_queue_entry *entry;
-- struct iphdr *iph = skb->nh.iph;
-+ struct iphdr *iph = ip_hdr(skb);
-
- entry = kmalloc(sizeof(*entry), GFP_ATOMIC);
-
-Index: aodv-uu-0.9.3/lnx/kaodv-queue.h
-===================================================================
---- aodv-uu-0.9.3.orig/lnx/kaodv-queue.h 2007-06-17 02:44:50.537262648 +0200
-+++ aodv-uu-0.9.3/lnx/kaodv-queue.h 2007-06-17 02:44:53.629792512 +0200
-@@ -21,6 +21,7 @@
- *****************************************************************************/
- #ifndef _KAODV_QUEUE_H
- #define _KAODV_QUEUE_H
-+#include "kaodv-compat.h"
-
- #define KAODV_QUEUE_DROP 1
- #define KAODV_QUEUE_SEND 2
-Index: aodv-uu-0.9.3/lnx/kaodv-netlink.c
-===================================================================
---- aodv-uu-0.9.3.orig/lnx/kaodv-netlink.c 2007-06-17 02:47:48.927143264 +0200
-+++ aodv-uu-0.9.3/lnx/kaodv-netlink.c 2007-06-17 02:49:11.604574384 +0200
-@@ -338,8 +338,10 @@
- netlink_register_notifier(&kaodv_nl_notifier);
- #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,14))
- kaodvnl = netlink_kernel_create(NETLINK_AODV, kaodv_netlink_rcv_sk);
--#else
-+#elif (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,22))
- kaodvnl = netlink_kernel_create(NETLINK_AODV, AODVGRP_MAX, kaodv_netlink_rcv_sk, THIS_MODULE);
-+#else
-+ kaodvnl = netlink_kernel_create(NETLINK_AODV, AODVGRP_MAX, kaodv_netlink_rcv_sk, NULL, THIS_MODULE);
- #endif
- if (kaodvnl == NULL) {
- printk(KERN_ERR "kaodv_netlink: failed to create netlink socket\n");