summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJesse Gross <jesse@nicira.com>2012-05-17 11:43:15 -0700
committerJesse Gross <jesse@nicira.com>2012-08-31 15:19:17 -0700
commit6467e95332be63d83610a794a42c85bda387ab07 (patch)
treea285d8b6c65da7840c980b5cabdf22b5cf2a25da
parent196ba341736b273c1ddf15e2545beec623d95bbd (diff)
downloadopenvswitch-6467e95332be63d83610a794a42c85bda387ab07.tar.gz
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 <jesse@nicira.com> Acked-by: Ben Pfaff <blp@nicira.com>
-rw-r--r--datapath/vport-internal_dev.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/datapath/vport-internal_dev.c b/datapath/vport-internal_dev.c
index c56f3b295..165eef3a1 100644
--- a/datapath/vport-internal_dev.c
+++ b/datapath/vport-internal_dev.c
@@ -25,6 +25,9 @@
#include <linux/skbuff.h>
#include <linux/version.h>
+#include <net/dst.h>
+#include <net/xfrm.h>
+
#include "checksum.h"
#include "datapath.h"
#include "vlan.h"
@@ -281,6 +284,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);