~ubuntu-branches/ubuntu/raring/openvswitch/raring

« back to all changes in this revision

Viewing changes to debian/patches/lp1044318-Reset-upper-layer-protocol-info.patch

  • Committer: Package Import Robot
  • Author(s): Adam Gandelman
  • Date: 2012-09-07 12:12:03 UTC
  • Revision ID: package-import@ubuntu.com-20120907121203-q09srg7abzl49dlj
Tags: 1.4.2+git20120612-9ubuntu3
debian/patches/lp1044318-Reset-upper-layer-protocol-info.patch: Cherry
picked upstream patch to avoid critical issues with SNAT/DNAT when OVS
is chained with other Linux components. May be dropped with 1.4.3 upload.
(LP: #1044318)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
From: Adam Gandelman <adamg@canonical.com>
 
2
Author: Jesse Gross <jesse@nicira.com>
 
3
Date: Fri Sep  7 12:10:58 PDT 2012
 
4
Bug-Ubuntu: https://bugs.launchpad.net/quantum/+bug/1044318
 
5
X-Git-Url: http://openvswitch.org/cgi-bin/gitweb.cgi?p=openvswitch;a=commitdiff_plain;h=53e6421bc83918ac2d00ba5516f205fa7e394140
 
6
Subject: datapath: Reset upper layer protocol info on internal devices.
 
7
 
 
8
datapath: Reset upper layer protocol info on internal devices.
 
9
 
 
10
It's possible that packets that are sent on internal devices (from
 
11
the OVS perspective) have already traversed the local IP stack.
 
12
After they go through the internal device, they will again travel
 
13
through the IP stack which may get confused by the presence of
 
14
existing information in the skb. The problem can be observed
 
15
when switching between namespaces. This clears out that information
 
16
to avoid problems but deliberately leaves other metadata alone.
 
17
This is to provide maximum flexibility in chaining together OVS
 
18
and other Linux components.
 
19
 
 
20
Bug #10995
 
21
 
 
22
Signed-off-by: Jesse Gross <jesse@nicira.com>
 
23
Acked-by: Ben Pfaff <blp@nicira.com>
 
24
---
 
25
 
 
26
 
 
27
Index: openvswitch/datapath/vport-internal_dev.c
 
28
===================================================================
 
29
--- openvswitch.orig/datapath/vport-internal_dev.c      2012-09-07 12:06:26.436795000 -0700
 
30
+++ openvswitch/datapath/vport-internal_dev.c   2012-09-07 12:09:09.223267544 -0700
 
31
@@ -25,6 +25,9 @@
 
32
 #include <linux/skbuff.h>
 
33
 #include <linux/version.h>
 
34
 
 
35
+#include <net/dst.h>
 
36
+#include <net/xfrm.h>
 
37
+
 
38
 #include "checksum.h"
 
39
 #include "datapath.h"
 
40
 #include "vlan.h"
 
41
@@ -281,6 +284,11 @@
 
42
 #endif
 
43
 
 
44
        len = skb->len;
 
45
+
 
46
+       skb_dst_drop(skb);
 
47
+       nf_reset(skb);
 
48
+       secpath_reset(skb);
 
49
+
 
50
        skb->dev = netdev;
 
51
        skb->pkt_type = PACKET_HOST;
 
52
        skb->protocol = eth_type_trans(skb, netdev);