summaryrefslogtreecommitdiff
path: root/include/net/ip.h
diff options
context:
space:
mode:
authorPaul Gortmaker <paul.gortmaker@windriver.com>2011-06-22 07:33:34 +0400
committerDavid S. Miller <davem@davemloft.net>2011-06-22 07:33:34 +0400
commit56f8a75c17abb854b5907f4a815dc4c3f186ba11 (patch)
tree6ba333b7668ce7dd04cddecf4f15a0a48b335991 /include/net/ip.h
parentf470e5ae34d68880a38aa79ee5c102ebc2a1aef6 (diff)
downloadlinux-56f8a75c17abb854b5907f4a815dc4c3f186ba11.tar.xz
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>
Diffstat (limited to 'include/net/ip.h')
-rw-r--r--include/net/ip.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/include/net/ip.h b/include/net/ip.h
index e9ea7c73f8c1..d603cd329c4e 100644
--- a/include/net/ip.h
+++ b/include/net/ip.h
@@ -250,6 +250,11 @@ int ip_decrease_ttl(struct iphdr *iph)
return --iph->ttl;
}
+static inline bool ip_is_fragment(const struct iphdr *iph)
+{
+ return (iph->frag_off & htons(IP_MF | IP_OFFSET)) != 0;
+}
+
static inline
int ip_dont_fragment(struct sock *sk, struct dst_entry *dst)
{