Re: [OpenWrt-Devel] [PATCH] relayd: add host route on local ip arp request

2015-02-11 Thread Felix Fietkau
On 2015-02-11 00:43, Alejandro Enrique wrote:
 This patch fixes relayd not adding a host on an ARP request for the local
 IP address.
 When relayd is launched using the -L option, it was not adding the
 necessary host routes when it receives an ARP request for the local
 IP address.
 
 This issue makes a host not able to connect to the device running
 relayd until there is ARP traffic involving a third host.
 
 Signed-off-by: Alejandro Enrique alejandro.enri...@fon.com
Please resend as patches against the relayd git tree instead of the
OpenWrt tree.

- Felix
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH] relayd: add host route on local ip arp request

2015-02-10 Thread Alejandro Enrique
This patch fixes relayd not adding a host on an ARP request for the local
IP address.
When relayd is launched using the -L option, it was not adding the
necessary host routes when it receives an ARP request for the local
IP address.

This issue makes a host not able to connect to the device running
relayd until there is ARP traffic involving a third host.

Signed-off-by: Alejandro Enrique alejandro.enri...@fon.com
---
 .../001-add_host_on_local_arp_request.patch|   22 
 1 file changed, 22 insertions(+)
 create mode 100644 
package/network/services/relayd/patches/001-add_host_on_local_arp_request.patch

diff --git 
a/package/network/services/relayd/patches/001-add_host_on_local_arp_request.patch
 
b/package/network/services/relayd/patches/001-add_host_on_local_arp_request.patch
new file mode 100644
index 000..aa7dfc7
--- /dev/null
+++ 
b/package/network/services/relayd/patches/001-add_host_on_local_arp_request.patch
@@ -0,0 +1,22 @@
+--- a/main.c
 b/main.c
+@@ -386,15 +386,15 @@ static void recv_arp_request(struct rela
+   if (!memcmp(pkt-arp.arp_spa, \x00\x00\x00\x00, 4))
+   return;
+ 
++  host = find_host_by_ipaddr(NULL, pkt-arp.arp_spa);
++  if (!host || host-rif != rif)
++  relayd_refresh_host(rif, pkt-eth.ether_shost, 
pkt-arp.arp_spa);
++
+   if (local_route_table  !memcmp(pkt-arp.arp_tpa, local_addr, 
sizeof(local_addr))) {
+   send_arp_reply(rif, local_addr, pkt-arp.arp_sha, 
pkt-arp.arp_spa);
+   return;
+   }
+ 
+-  host = find_host_by_ipaddr(NULL, pkt-arp.arp_spa);
+-  if (!host || host-rif != rif)
+-  relayd_refresh_host(rif, pkt-eth.ether_shost, 
pkt-arp.arp_spa);
+-
+   host = find_host_by_ipaddr(NULL, pkt-arp.arp_tpa);
+ 
+   /*
-- 
1.7.10.4
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel