summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Pfaff <blp@nicira.com>2012-07-10 14:11:59 -0700
committerBen Pfaff <blp@nicira.com>2012-07-10 15:23:16 -0700
commit629c1c51db663ed0014884358256c82fdf5792ec (patch)
tree26c6133a140bcf88692cacb3eb0ec229b1cdb220
parent34b67d4fd1a27ad1bc760f9488715bd024ea6228 (diff)
downloadopenvswitch-629c1c51db663ed0014884358256c82fdf5792ec.tar.gz
datapath: Check gso_type for correct sk_buff in queue_gso_packets().
At the point where it was used, skb_shinfo(skb)->gso_type referred to a post-GSO sk_buff. Thus, it would always be 0. We want to know the pre-GSO gso_type, so we need to obtain it before segmenting. Before this change, the kernel would pass inconsistent data to userspace: packets for UDP fragments with nonzero offset would be passed along with flow keys that indicate a zero offset (that is, the flow key for "later" fragments claimed to be "first" fragments). This inconsistency tended to confuse Open vSwitch userspace, causing it to log messages about "failed to flow_del" the flows with "later" fragments. Bug #12394. Signed-off-by: Ben Pfaff <blp@nicira.com> Acked-by: Jesse Gross <jesse@nicira.com>
-rw-r--r--datapath/datapath.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/datapath/datapath.c b/datapath/datapath.c
index a16fdb52c..b9ff07f08 100644
--- a/datapath/datapath.c
+++ b/datapath/datapath.c
@@ -405,6 +405,7 @@ static int queue_gso_packets(struct net *net, int dp_ifindex,
struct sk_buff *skb,
const struct dp_upcall_info *upcall_info)
{
+ unsigned short gso_type = skb_shinfo(skb)->gso_type;
struct dp_upcall_info later_info;
struct sw_flow_key later_key;
struct sk_buff *segs, *nskb;
@@ -421,7 +422,7 @@ static int queue_gso_packets(struct net *net, int dp_ifindex,
if (err)
break;
- if (skb == segs && skb_shinfo(skb)->gso_type & SKB_GSO_UDP) {
+ if (skb == segs && gso_type & SKB_GSO_UDP) {
/* The initial flow key extracted by ovs_flow_extract()
* in this case is for a first fragment, so we need to
* properly mark later fragments.