aboutsummaryrefslogtreecommitdiff
path: root/include/net/ip.h
diff options
context:
space:
mode:
authorAndy Zhou2015-05-15 14:15:35 -0700
committerDavid S. Miller2015-05-19 00:15:26 -0400
commit5cf422808244ca8f1177c72fe6e1ce8322794b57 (patch)
tree4d708b5e01fc30682d5f4f2f4d6e6144e57eabaf /include/net/ip.h
parenta2ad5d2ad96e8d5b3b8f33583a82eae78dce4d49 (diff)
ipv4: introduce frag_expire_skip_icmp()
Improve readability of skip ICMP for de-fragmentation expiration logic. This change will also make the logic easier to maintain when the following patches in this series are applied. Signed-off-by: Andy Zhou <azhou@nicira.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net/ip.h')
-rw-r--r--include/net/ip.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/include/net/ip.h b/include/net/ip.h
index 0ed6d768e606..43f6f39df9fc 100644
--- a/include/net/ip.h
+++ b/include/net/ip.h
@@ -478,6 +478,16 @@ enum ip_defrag_users {
IP_DEFRAG_MACVLAN,
};
+/* Return true if the value of 'user' is between 'lower_bond'
+ * and 'upper_bond' inclusively.
+ */
+static inline bool ip_defrag_user_in_between(u32 user,
+ enum ip_defrag_users lower_bond,
+ enum ip_defrag_users upper_bond)
+{
+ return user >= lower_bond && user <= upper_bond;
+}
+
int ip_defrag(struct sk_buff *skb, u32 user);
#ifdef CONFIG_INET
struct sk_buff *ip_check_defrag(struct sk_buff *skb, u32 user);