From patchwork Thu Mar 20 18:09:12 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jesse Gross X-Patchwork-Id: 332383 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 9E9992C008F for ; Fri, 21 Mar 2014 07:45:20 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759847AbaCTUpO (ORCPT ); Thu, 20 Mar 2014 16:45:14 -0400 Received: from na6sys009bog001.obsmtp.com ([74.125.150.42]:42968 "HELO na6sys009bog001.obsmtp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1759718AbaCTUpN (ORCPT ); Thu, 20 Mar 2014 16:45:13 -0400 Received: from mail-pa0-f46.google.com ([209.85.220.46]) (using TLSv1) by na6sys009bob001.postini.com ([74.125.148.12]) with SMTP ID DSNKUytTWDzCcuIt8blY73FfKmLlQnsIH/9P@postini.com; Thu, 20 Mar 2014 13:45:13 PDT Received: by mail-pa0-f46.google.com with SMTP id kp14so1461465pab.19 for ; Thu, 20 Mar 2014 13:45:12 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=i84huF7OYlOsFj8c8OXWsIqG0/AsFlpyy3TtfZrK2Gc=; b=fEn9q6AxShFCEKZVKPwBWcW+8YyrgsGWkvEVfDtvO0dCYLo0ZsEVeJR4fgpsOWqgxE BAWbyUqDHtHL5YQHjTKbyei2U0dY4nk1guGkQyWaP53BbEblC274ojEt7Z9Ezk816GoR rZpyTPC9/okSMxeu7ZpVgdgXwmHZq4vS9ZAG2Mp/LG4+aQCUk1uLj2Z/6qzuQe9rYQIL vobnHlhpr02eA8bl6SG+Uc/733UadhJMVxsd+/FXIr9QHk/mZSm2JR5sn4cRuXUoGncf pFnVMrnw7gRrldK02G8zt4NT1PBx8AoRJp7lS4Q62ILoanuazE0YbEOUV4gR+eR399CO tNIw== X-Received: by 10.68.241.73 with SMTP id wg9mr51185059pbc.62.1395347849819; Thu, 20 Mar 2014 13:37:29 -0700 (PDT) X-Gm-Message-State: ALoCoQlHfqi+EL8LL3VuWTKeKJLm1Jo1cQ9gIHaE8VECu9FYVvCf0j1Mn/aSMp2ji9O6Hjd6FSNUIGnyuKqfscF8UwfiMc7jr7fj0zT6UZE/V5Ly0ok9KuZ/cxp9tTZ8D/L2fx3nMiUKO2ptpYX/AO4l8RzijVFGFHJgKbUJAugXPRuuh7hi1I8= X-Received: by 10.68.241.73 with SMTP id wg9mr51185046pbc.62.1395347849710; Thu, 20 Mar 2014 13:37:29 -0700 (PDT) Received: from ubuntu.localdomain ([64.125.181.92]) by mx.google.com with ESMTPSA id ge7sm5619393pbc.61.2014.03.20.13.37.28 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 20 Mar 2014 13:37:29 -0700 (PDT) From: Jesse Gross To: David Miller Cc: netdev@vger.kernel.org, dev@openvswitch.org, Jarno Rajahalme , Jesse Gross Subject: [PATCH net 2/4] openvswitch: Read tcp flags only then the tranport header is present. Date: Thu, 20 Mar 2014 11:09:12 -0700 Message-Id: <1395338954-26206-3-git-send-email-jesse@nicira.com> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1395338954-26206-1-git-send-email-jesse@nicira.com> References: <1395338954-26206-1-git-send-email-jesse@nicira.com> Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Jarno Rajahalme Only the first IP fragment can have a TCP header, check for this. Signed-off-by: Jarno Rajahalme Signed-off-by: Jesse Gross --- net/openvswitch/flow.c | 1 + 1 file changed, 1 insertion(+) diff --git a/net/openvswitch/flow.c b/net/openvswitch/flow.c index 16f4b46..d71e60f 100644 --- a/net/openvswitch/flow.c +++ b/net/openvswitch/flow.c @@ -73,6 +73,7 @@ void ovs_flow_stats_update(struct sw_flow *flow, struct sk_buff *skb) if ((flow->key.eth.type == htons(ETH_P_IP) || flow->key.eth.type == htons(ETH_P_IPV6)) && + flow->key.ip.frag != OVS_FRAG_TYPE_LATER && flow->key.ip.proto == IPPROTO_TCP && likely(skb->len >= skb_transport_offset(skb) + sizeof(struct tcphdr))) { tcp_flags = TCP_FLAGS_BE16(tcp_hdr(skb));