summaryrefslogtreecommitdiffhomepage
path: root/contrib/package/olsrd-luci/patches/139-olsrd-magicarprefresh.patch
diff options
context:
space:
mode:
authorJo-Philipp Wich <jow@openwrt.org>2009-01-31 02:20:43 +0000
committerJo-Philipp Wich <jow@openwrt.org>2009-01-31 02:20:43 +0000
commit6fef46408b6d86ebb873b92b48261ddf71f1d43d (patch)
tree23a44d16101ddef9abce0e3aa2dd717fdc030c7f /contrib/package/olsrd-luci/patches/139-olsrd-magicarprefresh.patch
parent9de7b71940ce083a49f1ea0e3b58bf520b3d4192 (diff)
contrib/package: switch olsrd-luci to 0.5.6-r3 release + patches for freifunk firmware
Diffstat (limited to 'contrib/package/olsrd-luci/patches/139-olsrd-magicarprefresh.patch')
-rw-r--r--contrib/package/olsrd-luci/patches/139-olsrd-magicarprefresh.patch45
1 files changed, 45 insertions, 0 deletions
diff --git a/contrib/package/olsrd-luci/patches/139-olsrd-magicarprefresh.patch b/contrib/package/olsrd-luci/patches/139-olsrd-magicarprefresh.patch
new file mode 100644
index 0000000000..642abe17b6
--- /dev/null
+++ b/contrib/package/olsrd-luci/patches/139-olsrd-magicarprefresh.patch
@@ -0,0 +1,45 @@
+diff -Nur olsrd-0.5.6-r2.orig/lib/arprefresh/src/olsrd_arprefresh.c olsrd-0.5.6-r2/lib/arprefresh/src/olsrd_arprefresh.c
+--- olsrd-0.5.6-r2.orig/lib/arprefresh/src/olsrd_arprefresh.c 2008-11-26 10:54:16.000000000 +0100
++++ olsrd-0.5.6-r2/lib/arprefresh/src/olsrd_arprefresh.c 2008-11-26 10:56:15.000000000 +0100
+@@ -34,6 +34,8 @@
+ * Plugin to refresh the local ARP cache from received OLSR broadcasts
+ */
+
++#undef ARPREFRESH_DEBUG
++
+ #include <stdio.h>
+ #include <string.h>
+ #include <stdlib.h>
+@@ -46,6 +48,9 @@
+ #include <netinet/ip.h>
+ #include <netinet/udp.h>
+ #include <netpacket/packet.h>
++#ifdef ARPREFRESH_DEBUG
++#include <arpa/inet.h>
++#endif
+ #include <linux/types.h>
+ #include <linux/filter.h>
+
+@@ -53,7 +58,6 @@
+ #include "kernel_routes.h"
+ #include "scheduler.h"
+
+-#undef ARPREFRESH_DEBUG
+ #define PLUGIN_INTERFACE_VERSION 5
+
+ /****************************************************************************
+@@ -128,7 +132,13 @@
+ memcpy(&req.in_pa.sin_addr, &buf.ip.saddr, sizeof(buf.ip.saddr));
+ req.arp.arp_ha.sa_family = AF_LOCAL;
+ memcpy(&req.arp.arp_ha.sa_data, &buf.eth.h_source, sizeof(buf.eth.h_source));
+- req.arp.arp_flags = ATF_COM;
++ /*
++ * Currently, temp arp entries work partially under linux-2.6 (the entries
++ * are timed out after a short period, not after the default 5 minutes. Under
++ * linux 2.4 this does not work. The ATF_MAGIC triggers a hack in the Freifunk
++ * firmware's kernel. ATF_MACIG seem not to be used anywhere...
++ */
++ req.arp.arp_flags = ATF_COM | ATF_MAGIC;
+ if_indextoname(from.sll_ifindex, req.arp.arp_dev);
+ #ifdef ARPREFRESH_DEBUG
+ {