ip: introduce ip_is_fragment helper inline function

There are enough instances of this:

    iph->frag_off & htons(IP_MF | IP_OFFSET)

that a helper function is probably warranted.

Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
此提交包含在:
Paul Gortmaker
2011-06-21 20:33:34 -07:00
提交者 David S. Miller
父節點 f470e5ae34
當前提交 56f8a75c17
共有 19 個檔案被更改,包括 27 行新增23 行删除

查看文件

@@ -157,7 +157,7 @@ static unsigned int sfq_hash(struct sfq_sched_data *q, struct sk_buff *skb)
iph = ip_hdr(skb);
h = (__force u32)iph->daddr;
h2 = (__force u32)iph->saddr ^ iph->protocol;
if (iph->frag_off & htons(IP_MF | IP_OFFSET))
if (ip_is_fragment(iph))
break;
poff = proto_ports_offset(iph->protocol);
if (poff >= 0 &&