From patchwork Thu Jan 18 10:32:36 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wolfgang Bumiller X-Patchwork-Id: 862813 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3zMgJm2CTTz9s7f for ; Thu, 18 Jan 2018 21:32:56 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755867AbeARKcz (ORCPT ); Thu, 18 Jan 2018 05:32:55 -0500 Received: from proxmox-new.maurer-it.com ([212.186.127.180]:38877 "EHLO proxmox-new.maurer-it.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755729AbeARKcj (ORCPT ); Thu, 18 Jan 2018 05:32:39 -0500 Received: from proxmox-new.maurer-it.com (localhost.localdomain [127.0.0.1]) by proxmox-new.maurer-it.com (Proxmox) with ESMTP id 705534257F; Thu, 18 Jan 2018 11:32:38 +0100 (CET) From: Wolfgang Bumiller To: netdev@vger.kernel.org Cc: Stephen Hemminger , Jamal Hadi Salim , Cong Wang , Jiri Pirko , "David S . Miller" Subject: [PATCH net 2/2] net_sched: fix TCF_LAYER_LINK case in tcf_get_base_ptr Date: Thu, 18 Jan 2018 11:32:36 +0100 Message-Id: <20180118103236.32494-4-w.bumiller@proxmox.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180118103236.32494-1-w.bumiller@proxmox.com> References: <20180118103236.32494-1-w.bumiller@proxmox.com> Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org TCF_LAYER_LINK and TCF_LAYER_NETWORK returned the same pointer as skb->data points to the network header. Use skb_mac_header instead. Signed-off-by: Wolfgang Bumiller --- Alternatively this could return skb->head directly, but 'sk_buff->mac_header' is documented as 'Link layer header' and this seemed more clear. Since on the first read I thought "it looks fine" while in fact skb->head comes before skb->data, so this seems less confusing. include/net/pkt_cls.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/net/pkt_cls.h b/include/net/pkt_cls.h index 8e08b6da72f3..753ac9361154 100644 --- a/include/net/pkt_cls.h +++ b/include/net/pkt_cls.h @@ -522,7 +522,7 @@ static inline unsigned char * tcf_get_base_ptr(struct sk_buff *skb, int layer) { switch (layer) { case TCF_LAYER_LINK: - return skb->data; + return skb_mac_header(skb); case TCF_LAYER_NETWORK: return skb_network_header(skb); case TCF_LAYER_TRANSPORT: