Since ARP performs its own route lookup call, eventually
returned tunnel metadata must be attached manually.

Signed-off-by: Thomas Graf <tg...@suug.ch>
---
 net/ipv4/arp.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/net/ipv4/arp.c b/net/ipv4/arp.c
index 933a928..6cf0502 100644
--- a/net/ipv4/arp.c
+++ b/net/ipv4/arp.c
@@ -489,6 +489,7 @@ struct sk_buff *arp_create(int type, int ptype, __be32 
dest_ip,
        unsigned char *arp_ptr;
        int hlen = LL_RESERVED_SPACE(dev);
        int tlen = dev->needed_tailroom;
+       struct rtable *rt;
 
        /*
         *      Allocate a buffer
@@ -577,6 +578,13 @@ struct sk_buff *arp_create(int type, int ptype, __be32 
dest_ip,
        }
        memcpy(arp_ptr, &dest_ip, 4);
 
+       rt = ip_route_output(dev_net(dev), dest_ip, src_ip, 0, dev->ifindex);
+       if (!IS_ERR(rt)) {
+               if (rt->rt_tun_info)
+                       skb_attach_tunnel_info(skb, rt->rt_tun_info);
+               ip_rt_put(rt);
+       }
+
        return skb;
 
 out:
-- 
2.3.5

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to