From: Jesse Gross Date: Thu, 17 May 2012 18:43:15 +0000 (-0700) Subject: datapath: Reset upper layer protocol info on internal devices. X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=53e6421bc83918ac2d00ba5516f205fa7e394140;p=openvswitch datapath: Reset upper layer protocol info on internal devices. It's possible that packets that are sent on internal devices (from the OVS perspective) have already traversed the local IP stack. After they go through the internal device, they will again travel through the IP stack which may get confused by the presence of existing information in the skb. The problem can be observed when switching between namespaces. This clears out that information to avoid problems but deliberately leaves other metadata alone. This is to provide maximum flexibility in chaining together OVS and other Linux components. Bug #10995 Signed-off-by: Jesse Gross Acked-by: Ben Pfaff --- diff --git a/datapath/vport-internal_dev.c b/datapath/vport-internal_dev.c index af7fe649..4dc2eb47 100644 --- a/datapath/vport-internal_dev.c +++ b/datapath/vport-internal_dev.c @@ -25,6 +25,9 @@ #include #include +#include +#include + #include "checksum.h" #include "datapath.h" #include "vlan.h" @@ -289,6 +292,11 @@ static int internal_dev_recv(struct vport *vport, struct sk_buff *skb) #endif len = skb->len; + + skb_dst_drop(skb); + nf_reset(skb); + secpath_reset(skb); + skb->dev = netdev; skb->pkt_type = PACKET_HOST; skb->protocol = eth_type_trans(skb, netdev);