Commit 3fbd6c45 authored by Jeremy Sowden's avatar Jeremy Sowden Committed by Pablo Neira Ayuso

netfilter: ipset: move function to ip_set_bitmap_ip.c.

One inline function in ip_set_bitmap.h is only called in
ip_set_bitmap_ip.c: move it and remove inline function specifier.
Signed-off-by: default avatarJeremy Sowden <jeremy@azazel.net>
Acked-by: default avatarJozsef Kadlecsik <kadlec@netfilter.org>
Signed-off-by: default avatarPablo Neira Ayuso <pablo@netfilter.org>
parent 85639185
...@@ -12,18 +12,4 @@ enum { ...@@ -12,18 +12,4 @@ enum {
IPSET_ADD_START_STORED_TIMEOUT, IPSET_ADD_START_STORED_TIMEOUT,
}; };
/* Common functions */
static inline u32
range_to_mask(u32 from, u32 to, u8 *bits)
{
u32 mask = 0xFFFFFFFE;
*bits = 32;
while (--(*bits) > 0 && mask && (to & mask) != from)
mask <<= 1;
return mask;
}
#endif /* __IP_SET_BITMAP_H */ #endif /* __IP_SET_BITMAP_H */
...@@ -237,6 +237,18 @@ init_map_ip(struct ip_set *set, struct bitmap_ip *map, ...@@ -237,6 +237,18 @@ init_map_ip(struct ip_set *set, struct bitmap_ip *map,
return true; return true;
} }
static u32
range_to_mask(u32 from, u32 to, u8 *bits)
{
u32 mask = 0xFFFFFFFE;
*bits = 32;
while (--(*bits) > 0 && mask && (to & mask) != from)
mask <<= 1;
return mask;
}
static int static int
bitmap_ip_create(struct net *net, struct ip_set *set, struct nlattr *tb[], bitmap_ip_create(struct net *net, struct ip_set *set, struct nlattr *tb[],
u32 flags) u32 flags)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment