Module: xenomai-gch
Branch: for-forge
Commit: 271856a06ba91aef465a99a3f794c8a0874e2e29
URL:    
http://git.xenomai.org/?p=xenomai-gch.git;a=commit;h=271856a06ba91aef465a99a3f794c8a0874e2e29

Author: Gilles Chanteperdrix <gilles.chanteperd...@xenomai.org>
Date:   Thu Nov 13 20:46:12 2014 +0100

rtnet/arp: do not answer ARP requests only when rtnetproxy is loaded

When CONFIG_XENO_DRIVERS_NET_ADDON_PROXY_ARP is on but rtnetproxy is not loaded,
we need to answer arp requests, otherwise simple discovery on a network with
rtroute solicit does not work.

---

 kernel/drivers/net/stack/ipv4/arp.c |   12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/kernel/drivers/net/stack/ipv4/arp.c 
b/kernel/drivers/net/stack/ipv4/arp.c
index ecb65f8..98c010d 100644
--- a/kernel/drivers/net/stack/ipv4/arp.c
+++ b/kernel/drivers/net/stack/ipv4/arp.c
@@ -170,11 +170,14 @@ int rt_arp_rcv(struct rtskb *skb, struct rtpacket_type 
*pt)
     if (tip == rtdev->local_ip) {
        rt_ip_route_add_host(sip, sha, rtdev);
 
-#ifndef CONFIG_XENO_DRIVERS_NET_ADDON_PROXY_ARP
-       if (arp->ar_op == __constant_htons(ARPOP_REQUEST))
-           rt_arp_send(ARPOP_REPLY, ETH_P_ARP, sip, rtdev, tip, sha,
-                       rtdev->dev_addr, sha);
+#ifdef CONFIG_XENO_DRIVERS_NET_ADDON_PROXY_ARP
+       if (!rt_ip_fallback_handler)
 #endif /* CONFIG_XENO_DRIVERS_NET_ADDON_PROXY_ARP */
+               if (arp->ar_op == __constant_htons(ARPOP_REQUEST)) {
+                       rt_arp_send(ARPOP_REPLY, ETH_P_ARP, sip, rtdev, tip, 
sha,
+                               rtdev->dev_addr, sha);
+                       goto out1;
+               }
     }
 
 out:
@@ -184,6 +187,7 @@ out:
            return 0;
     }
 #endif /* CONFIG_XENO_DRIVERS_NET_ADDON_PROXY_ARP */
+out1:
     kfree_rtskb(skb);
     return 0;
 }


_______________________________________________
Xenomai-git mailing list
Xenomai-git@xenomai.org
http://www.xenomai.org/mailman/listinfo/xenomai-git

Reply via email to