mirror of
git://git.code.sf.net/p/xtables-addons/xtables-addons
synced 2025-09-06 04:35:12 +02:00
ipset: fast forward to v3.2
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
|
||||
|
||||
- build: support for Linux 2.6.31-rc1
|
||||
- ipset: fast forward to v3.2
|
||||
- quota2: support anonymous counters
|
||||
- quota2: reduce memory footprint for anonymous counters
|
||||
- quota2: extend locked period during cleanup (locking bugfix)
|
||||
|
@@ -1911,13 +1911,23 @@ ip_set_sockfn_get(struct sock *sk, int optval, void *user, int *len)
|
||||
res = -ENOENT;
|
||||
goto done;
|
||||
}
|
||||
|
||||
#define SETLIST(set) (strcmp(set->type->typename, "setlist") == 0)
|
||||
|
||||
used = 0;
|
||||
if (index == IP_SET_INVALID_ID) {
|
||||
/* Save all sets */
|
||||
/* Save all sets: ugly setlist type dependency */
|
||||
int setlist = 0;
|
||||
setlists:
|
||||
for (i = 0; i < ip_set_max && res == 0; i++) {
|
||||
if (ip_set_list[i] != NULL)
|
||||
if (ip_set_list[i] != NULL
|
||||
&& !(setlist ^ SETLIST(ip_set_list[i])))
|
||||
res = ip_set_save_set(i, data, &used, *len);
|
||||
}
|
||||
if (!setlist) {
|
||||
setlist = 1;
|
||||
goto setlists;
|
||||
}
|
||||
} else {
|
||||
/* Save an individual set */
|
||||
res = ip_set_save_set(index, data, &used, *len);
|
||||
|
@@ -338,7 +338,7 @@ KADT(iptreemap, add, ipaddr, ip)
|
||||
|
||||
static inline int
|
||||
__delip_single(struct ip_set *set, ip_set_ip_t *hash_ip,
|
||||
ip_set_ip_t ip, unsigned int __nocast flags)
|
||||
ip_set_ip_t ip, gfp_t flags)
|
||||
{
|
||||
struct ip_set_iptreemap *map = set->data;
|
||||
struct ip_set_iptreemap_b *btree;
|
||||
@@ -364,7 +364,7 @@ __delip_single(struct ip_set *set, ip_set_ip_t *hash_ip,
|
||||
|
||||
static inline int
|
||||
iptreemap_del(struct ip_set *set, ip_set_ip_t *hash_ip,
|
||||
ip_set_ip_t start, ip_set_ip_t end, unsigned int __nocast flags)
|
||||
ip_set_ip_t start, ip_set_ip_t end, gfp_t flags)
|
||||
{
|
||||
struct ip_set_iptreemap *map = set->data;
|
||||
struct ip_set_iptreemap_b *btree;
|
||||
|
@@ -40,7 +40,7 @@ struct harray {
|
||||
};
|
||||
|
||||
static inline void *
|
||||
__harray_malloc(size_t hashsize, size_t typesize, int flags)
|
||||
__harray_malloc(size_t hashsize, size_t typesize, gfp_t flags)
|
||||
{
|
||||
struct harray *harray;
|
||||
size_t max_elements, size, i, j;
|
||||
@@ -88,7 +88,7 @@ __harray_malloc(size_t hashsize, size_t typesize, int flags)
|
||||
}
|
||||
|
||||
static inline void *
|
||||
harray_malloc(size_t hashsize, size_t typesize, int flags)
|
||||
harray_malloc(size_t hashsize, size_t typesize, gfp_t flags)
|
||||
{
|
||||
void *harray;
|
||||
|
||||
|
@@ -21,7 +21,7 @@
|
||||
* after ==> ref, index
|
||||
*/
|
||||
|
||||
static inline bool
|
||||
static inline int
|
||||
next_index_eq(const struct ip_set_setlist *map, int i, ip_set_id_t index)
|
||||
{
|
||||
return i < map->size && map->index[i] == index;
|
||||
@@ -38,18 +38,16 @@ setlist_utest(struct ip_set *set, const void *data, u_int32_t size,
|
||||
struct ip_set *s;
|
||||
|
||||
if (req->before && req->ref[0] == '\0')
|
||||
return -EINVAL;
|
||||
return 0;
|
||||
|
||||
index = __ip_set_get_byname(req->name, &s);
|
||||
if (index == IP_SET_INVALID_ID)
|
||||
return -EEXIST;
|
||||
return 0;
|
||||
if (req->ref[0] != '\0') {
|
||||
ref = __ip_set_get_byname(req->ref, &s);
|
||||
if (ref == IP_SET_INVALID_ID) {
|
||||
res = -EEXIST;
|
||||
if (ref == IP_SET_INVALID_ID)
|
||||
goto finish;
|
||||
}
|
||||
}
|
||||
for (i = 0; i < map->size
|
||||
&& map->index[i] != IP_SET_INVALID_ID; i++) {
|
||||
if (req->before && map->index[i] == index) {
|
||||
@@ -172,7 +170,7 @@ setlist_kadd(struct ip_set *set,
|
||||
return res;
|
||||
}
|
||||
|
||||
static inline bool
|
||||
static inline int
|
||||
unshift_setlist(struct ip_set_setlist *map, int i)
|
||||
{
|
||||
int j;
|
||||
|
@@ -50,6 +50,9 @@ IP set bindings pointing to sets and iptables matches and targets
|
||||
referring to sets creates references, which protects the given sets in
|
||||
the kernel. A set cannot be removed (destroyed) while there is a single
|
||||
reference pointing to it.
|
||||
.P
|
||||
.B
|
||||
Please note, binding sets is a deprecated feature and will be removed in a later release. Switch to the multidata type of sets from using bindings.
|
||||
.SH OPTIONS
|
||||
The options that are recognized by
|
||||
.B ipset
|
||||
|
@@ -30,7 +30,7 @@
|
||||
#define PROC_SYS_MODPROBE "/proc/sys/kernel/modprobe"
|
||||
#endif
|
||||
|
||||
#define IPSET_VERSION "2.5.0"
|
||||
#define IPSET_VERSION "3.2"
|
||||
|
||||
char program_name[] = "ipset";
|
||||
char program_version[] = IPSET_VERSION;
|
||||
|
Reference in New Issue
Block a user