Received: by 2002:a05:6a10:6006:0:0:0:0 with SMTP id w6csp468950pxa; Thu, 27 Aug 2020 07:17:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxwAVj1YfbnIq2C6aFM7/xeae9n06oS3gLnQJ1tYo0IHu608P/f6hUuLlH9m+T8tP9mkiUV X-Received: by 2002:a17:906:f28b:: with SMTP id gu11mr20592588ejb.407.1598537862784; Thu, 27 Aug 2020 07:17:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598537862; cv=none; d=google.com; s=arc-20160816; b=0Ddyp5/uyu4eNWwW/XgkStOi9JZVA+6zFnGGJRkK5IihTA7aZx161qKh+V5i/RA6Aw R6mkuO6ofF8UPbe5JTh0adzm/aFqh6Qf6+xRYmnFm8PK88AHWnugg4jEz8oBxAK8R6vQ VWmmB8leUa90xaXGnIPoaiGldAeAE7FIk2t1101VKLx2xTp0yIpwzEo9SloaqVtELuOb j1fy0OoHdSwfFdZvXymhJBoI9A/n24rAytOshRhTmdt2945RDC6WYrgYPklmq770lFse 5ox2mxy8H3gBpv7sH24Vk5gGHfXI+hjSgsULPQVgQH/nbE+oI/egOfqO3ZZ3edFgM7EK 0gag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:subject:cc :to:from; bh=DkpGAIcdsaOooJ3AyoEEVpT9xz1Dl1k+3aAfVb5M05E=; b=fOH1IMVfcMY9rtDeIJZodZZMpTiNPXR4wLD6S+oEvORotQk3MXQkJ+qczFdUzLae20 x1hwhd7jUsLT/QDqz4yON6C3azB+JEd2HaOUP5Jkc38QUWsoiQZTKO/FKNFw07sDFEUS QKnVQzOCBoevqr9rcBzUjckZgg0e9IeGH/NYEV4AaulnXXGjpU50LSlyBSN3ZQlVR8kX 8nDvAa9VDVcGE0WoCvww2480+h9TXx/jCzmfR7vg/W3Gaj2X9n+qLAdMj0rp1btCI8U6 OFY8gk70flhRdWRGPAS9hQNbkP4s52oA5vl4mzbdbWEaqFo9h+/SF1qqfu1QaRvLHcE/ oYQg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n16si1566151eds.250.2020.08.27.07.17.18; Thu, 27 Aug 2020 07:17:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726153AbgH0OP7 (ORCPT + 99 others); Thu, 27 Aug 2020 10:15:59 -0400 Received: from szxga04-in.huawei.com ([45.249.212.190]:10339 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727781AbgH0OKO (ORCPT ); Thu, 27 Aug 2020 10:10:14 -0400 Received: from DGGEMS404-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id A14B365A25F8A4801769; Thu, 27 Aug 2020 22:09:55 +0800 (CST) Received: from localhost (10.174.179.108) by DGGEMS404-HUB.china.huawei.com (10.3.19.204) with Microsoft SMTP Server id 14.3.487.0; Thu, 27 Aug 2020 22:09:48 +0800 From: YueHaibing To: , , , , , CC: , , , , YueHaibing Subject: [PATCH net-next] netfilter: xt_HMARK: Use ip_is_fragment() helper Date: Thu, 27 Aug 2020 22:08:13 +0800 Message-ID: <20200827140813.28624-1-yuehaibing@huawei.com> X-Mailer: git-send-email 2.10.2.windows.1 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.174.179.108] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Use ip_is_fragment() to simpify code. Signed-off-by: YueHaibing --- net/netfilter/xt_HMARK.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/netfilter/xt_HMARK.c b/net/netfilter/xt_HMARK.c index 713fb38541df..8928ec56c388 100644 --- a/net/netfilter/xt_HMARK.c +++ b/net/netfilter/xt_HMARK.c @@ -276,7 +276,7 @@ hmark_pkt_set_htuple_ipv4(const struct sk_buff *skb, struct hmark_tuple *t, return 0; /* follow-up fragments don't contain ports, skip all fragments */ - if (ip->frag_off & htons(IP_MF | IP_OFFSET)) + if (ip_is_fragment(ip)) return 0; hmark_set_tuple_ports(skb, (ip->ihl * 4) + nhoff, t, info); -- 2.17.1