[ovs-dev] [PATCH] datapath/tunnel: reset skb->pkt_type when sending tunneled packets.

Isaku Yamahata yamahata at valinux.co.jp
Tue Jun 25 08:11:47 UTC 2013


Reset skb->pkt_type when sending tunneled packets.
Packet can have pkt_type of PACKET_OTHERHOST when coming to ovs bridge.
If such packets are handled by loopback device, the packet is dropped
by ip_rcv().
On the other hand when flow rule isn't installed in kernel datapath,
OVS_ACTION_ATTR_OUTPUT is used to send the packet. In that case, packet
isn't dropped.

netns A |                      root netns                     | netns B
   veth<->veth=ovs bridge=gre<-loop back->gre=ovs bridge=veth<->veth

arp packet ->
pkt_type
         BROADCAST------------>ip_rcv()------------------------>

                                                             <- arp reply
                                                                pkt_type

                                                         rule exists
                               ip_rcv()<-----------------OTHERHOST
                               drop

          <--------------------ip_rcv()<--- PACKET_HOST  rule doesn't exists
                               pass         ^              |
                                            |              |upcall
                                            |              V
                                            OVS_ACTION_ATTR_OUTPUT
                                            ovs-switchd

Signed-off-by: Isaku Yamahata <yamahata at valinux.co.jp>
---
 datapath/tunnel.c |    1 +
 1 file changed, 1 insertion(+)

diff --git a/datapath/tunnel.c b/datapath/tunnel.c
index 8c93e18..1975c7b 100644
--- a/datapath/tunnel.c
+++ b/datapath/tunnel.c
@@ -275,6 +275,7 @@ int ovs_tnl_send(struct vport *vport, struct sk_buff *skb,
 			skb_dst_set(skb, dst_clone(&rt_dst(rt)));
 		else
 			skb_dst_set(skb, &rt_dst(rt));
+		skb->pkt_type = PACKET_HOST;
 
 		/* Push Tunnel header. */
 		build_header(vport, skb, tunnel_hlen);
-- 
1.7.10.4




More information about the dev mailing list