Module: xenomai-gch
Branch: stable-3.0.x
Commit: 7d697ea1ab099e762c593a80cc5aa2d9d9367623
URL:    
http://git.xenomai.org/?p=xenomai-gch.git;a=commit;h=7d697ea1ab099e762c593a80cc5aa2d9d9367623

Author: Gilles Chanteperdrix <gilles.chanteperd...@xenomai.org>
Date:   Wed Jun 15 13:18:56 2016 +0200

icmp: forward unused packet to proxy

in order to get ping from the proxy interface to work

---

 kernel/drivers/net/stack/ipv4/icmp.c |   14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

diff --git a/kernel/drivers/net/stack/ipv4/icmp.c 
b/kernel/drivers/net/stack/ipv4/icmp.c
index 58d97cd..f5c1ec6 100644
--- a/kernel/drivers/net/stack/ipv4/icmp.c
+++ b/kernel/drivers/net/stack/ipv4/icmp.c
@@ -37,6 +37,7 @@
 #include <ipv4/icmp.h>
 #include <ipv4/ip_fragment.h>
 #include <ipv4/ip_output.h>
+#include <ipv4/ip_input.h>
 #include <ipv4/protocol.h>
 #include <ipv4/route.h>
 
@@ -144,10 +145,16 @@ void rt_icmp_cleanup_echo_requests(void)
  */
 static void rt_icmp_discard(struct rtskb *skb)
 {
+#ifdef CONFIG_RTNET_ADDON_PROXY
+    if (rt_ip_fallback_handler) {
+        /* If a fallback handler for IP protocol has been installed,
+         * call it. */
+       __rtskb_push(skb, skb->nh.iph->ihl*4 + sizeof(struct icmphdr));
+        rt_ip_fallback_handler(skb);
+    }
+#endif /* CONFIG_RTNET_ADDON_PROXY */
 }
 
-
-
 static int rt_icmp_glue_reply_bits(const void *p, unsigned char *to,
                                   unsigned int offset, unsigned int fraglen)
 {
@@ -446,6 +453,9 @@ static struct rt_icmp_control 
rt_icmp_pointers[NR_ICMP_TYPES+1] =
  */
 struct rtsocket *rt_icmp_dest_socket(struct rtskb *skb)
 {
+    if (list_empty(&echo_calls))
+       return NULL;
+
     rt_socket_reference(icmp_socket);
     return icmp_socket;
 }


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

Reply via email to