linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next] netfilter: xt_HMARK: Use ip_is_fragment() helper
@ 2020-08-27 14:08 YueHaibing
  2020-08-28 17:56 ` Pablo Neira Ayuso
  0 siblings, 1 reply; 2+ messages in thread
From: YueHaibing @ 2020-08-27 14:08 UTC (permalink / raw)
  To: pablo, kadlec, fw, davem, kuba, mcroce
  Cc: netfilter-devel, coreteam, netdev, linux-kernel, YueHaibing

Use ip_is_fragment() to simpify code.

Signed-off-by: YueHaibing <yuehaibing@huawei.com>
---
 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



^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH net-next] netfilter: xt_HMARK: Use ip_is_fragment() helper
  2020-08-27 14:08 [PATCH net-next] netfilter: xt_HMARK: Use ip_is_fragment() helper YueHaibing
@ 2020-08-28 17:56 ` Pablo Neira Ayuso
  0 siblings, 0 replies; 2+ messages in thread
From: Pablo Neira Ayuso @ 2020-08-28 17:56 UTC (permalink / raw)
  To: YueHaibing
  Cc: kadlec, fw, davem, kuba, mcroce, netfilter-devel, coreteam,
	netdev, linux-kernel

On Thu, Aug 27, 2020 at 10:08:13PM +0800, YueHaibing wrote:
> Use ip_is_fragment() to simpify code.

Applied.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-08-28 17:56 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-27 14:08 [PATCH net-next] netfilter: xt_HMARK: Use ip_is_fragment() helper YueHaibing
2020-08-28 17:56 ` Pablo Neira Ayuso

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).