You've already forked linux-apfs
mirror of
https://github.com/linux-apfs/linux-apfs.git
synced 2026-05-01 15:00:59 -07:00
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>
This commit is contained in:
committed by
David S. Miller
parent
f470e5ae34
commit
56f8a75c17
+2
-2
@@ -165,7 +165,7 @@ int ip_call_ra_chain(struct sk_buff *skb)
|
||||
(!sk->sk_bound_dev_if ||
|
||||
sk->sk_bound_dev_if == dev->ifindex) &&
|
||||
net_eq(sock_net(sk), dev_net(dev))) {
|
||||
if (ip_hdr(skb)->frag_off & htons(IP_MF | IP_OFFSET)) {
|
||||
if (ip_is_fragment(ip_hdr(skb))) {
|
||||
if (ip_defrag(skb, IP_DEFRAG_CALL_RA_CHAIN))
|
||||
return 1;
|
||||
}
|
||||
@@ -256,7 +256,7 @@ int ip_local_deliver(struct sk_buff *skb)
|
||||
* Reassemble IP fragments.
|
||||
*/
|
||||
|
||||
if (ip_hdr(skb)->frag_off & htons(IP_MF | IP_OFFSET)) {
|
||||
if (ip_is_fragment(ip_hdr(skb))) {
|
||||
if (ip_defrag(skb, IP_DEFRAG_LOCAL_DELIVER))
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user