Skip to content

Commit

Permalink
netfilter: xt_HMARK: Use ip_is_fragment() helper
Browse files Browse the repository at this point in the history
Use ip_is_fragment() to simpify code.

Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
  • Loading branch information
YueHaibing authored and Pablo Neira Ayuso committed Aug 28, 2020
1 parent ff73e74 commit f5143e1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion net/netfilter/xt_HMARK.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit f5143e1

Please sign in to comment.