aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJesse Gross <jesse@nicira.com>2012-05-25 14:29:30 -0400
committerJesse Gross <jesse@nicira.com>2012-05-25 14:29:30 -0400
commit7fe99e2d434eafeac0c57b279a77e5de39212636 (patch)
tree7648c2656ba21d500ba21f0f38b489e5643d0564
parentcaf2ee14bbc2c6bd73cf0decf576007e0239a482 (diff)
openvswitch: 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. Signed-off-by: Jesse Gross <jesse@nicira.com>
-rw-r--r--net/openvswitch/vport-internal_dev.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/net/openvswitch/vport-internal_dev.c b/net/openvswitch/vport-internal_dev.c
index de509d347112..4061b9ee07f7 100644
--- a/net/openvswitch/vport-internal_dev.c
+++ b/net/openvswitch/vport-internal_dev.c
@@ -24,6 +24,9 @@
24#include <linux/ethtool.h> 24#include <linux/ethtool.h>
25#include <linux/skbuff.h> 25#include <linux/skbuff.h>
26 26
27#include <net/dst.h>
28#include <net/xfrm.h>
29
27#include "datapath.h" 30#include "datapath.h"
28#include "vport-internal_dev.h" 31#include "vport-internal_dev.h"
29#include "vport-netdev.h" 32#include "vport-netdev.h"
@@ -209,6 +212,11 @@ static int internal_dev_recv(struct vport *vport, struct sk_buff *skb)
209 int len; 212 int len;
210 213
211 len = skb->len; 214 len = skb->len;
215
216 skb_dst_drop(skb);
217 nf_reset(skb);
218 secpath_reset(skb);
219
212 skb->dev = netdev; 220 skb->dev = netdev;
213 skb->pkt_type = PACKET_HOST; 221 skb->pkt_type = PACKET_HOST;
214 skb->protocol = eth_type_trans(skb, netdev); 222 skb->protocol = eth_type_trans(skb, netdev);