contrib/package: switch olsrd-luci to 0.5.6-r3 release + patches for freifunk firmware
[project/luci.git] / contrib / package / olsrd-luci / patches / 139-olsrd-magicarprefresh.patch
1 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
2 --- olsrd-0.5.6-r2.orig/lib/arprefresh/src/olsrd_arprefresh.c   2008-11-26 10:54:16.000000000 +0100
3 +++ olsrd-0.5.6-r2/lib/arprefresh/src/olsrd_arprefresh.c        2008-11-26 10:56:15.000000000 +0100
4 @@ -34,6 +34,8 @@
5   * Plugin to refresh the local ARP cache from received OLSR broadcasts
6   */
7  
8 +#undef ARPREFRESH_DEBUG
9 +
10  #include <stdio.h>
11  #include <string.h>
12  #include <stdlib.h>
13 @@ -46,6 +48,9 @@
14  #include <netinet/ip.h>
15  #include <netinet/udp.h>
16  #include <netpacket/packet.h>
17 +#ifdef ARPREFRESH_DEBUG
18 +#include <arpa/inet.h>
19 +#endif
20  #include <linux/types.h>
21  #include <linux/filter.h>
22  
23 @@ -53,7 +58,6 @@
24  #include "kernel_routes.h"
25  #include "scheduler.h"
26  
27 -#undef ARPREFRESH_DEBUG
28  #define PLUGIN_INTERFACE_VERSION 5
29  
30  /****************************************************************************
31 @@ -128,7 +132,13 @@
32        memcpy(&req.in_pa.sin_addr, &buf.ip.saddr, sizeof(buf.ip.saddr));
33        req.arp.arp_ha.sa_family = AF_LOCAL;
34        memcpy(&req.arp.arp_ha.sa_data, &buf.eth.h_source, sizeof(buf.eth.h_source));
35 -      req.arp.arp_flags = ATF_COM;
36 +      /*
37 +       * Currently, temp arp entries work partially under linux-2.6 (the entries
38 +       * are timed out after a short period, not after the default 5 minutes. Under
39 +       * linux 2.4 this does not work. The ATF_MAGIC triggers a hack in the Freifunk
40 +       * firmware's kernel. ATF_MACIG seem not to be used anywhere...
41 +       */
42 +      req.arp.arp_flags = ATF_COM | ATF_MAGIC;
43        if_indextoname(from.sll_ifindex, req.arp.arp_dev);
44  #ifdef ARPREFRESH_DEBUG
45        {