Skip to content

Commit a1b5d0d

Browse files
blpjessegross
authored andcommitted
openvswitch: 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. Signed-off-by: Ben Pfaff <blp@nicira.com> Signed-off-by: Jesse Gross <jesse@nicira.com>
1 parent 92e5dfc commit a1b5d0d

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

‎net/openvswitch/datapath.c‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -263,6 +263,7 @@ int ovs_dp_upcall(struct datapath *dp, struct sk_buff *skb,
263263
static int queue_gso_packets(int dp_ifindex, struct sk_buff *skb,
264264
const struct dp_upcall_info *upcall_info)
265265
{
266+
unsigned short gso_type = skb_shinfo(skb)->gso_type;
266267
struct dp_upcall_info later_info;
267268
struct sw_flow_key later_key;
268269
struct sk_buff *segs, *nskb;
@@ -279,7 +280,7 @@ static int queue_gso_packets(int dp_ifindex, struct sk_buff *skb,
279280
if (err)
280281
break;
281282

282-
if (skb == segs && skb_shinfo(skb)->gso_type & SKB_GSO_UDP) {
283+
if (skb == segs && gso_type & SKB_GSO_UDP) {
283284
/* The initial flow key extracted by ovs_flow_extract()
284285
* in this case is for a first fragment, so we need to
285286
* properly mark later fragments.

0 commit comments

Comments
 (0)