Skip to content

Commit

Permalink
openvswitch: Reset upper layer protocol info on internal devices.
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Jesse Gross committed May 25, 2012
1 parent caf2ee1 commit 7fe99e2
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions net/openvswitch/vport-internal_dev.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@
#include <linux/ethtool.h>
#include <linux/skbuff.h>

#include <net/dst.h>
#include <net/xfrm.h>

#include "datapath.h"
#include "vport-internal_dev.h"
#include "vport-netdev.h"
Expand Down Expand Up @@ -209,6 +212,11 @@ static int internal_dev_recv(struct vport *vport, struct sk_buff *skb)
int len;

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);
Expand Down

0 comments on commit 7fe99e2

Please sign in to comment.