~ubuntu-branches/ubuntu/lucid/xtables-addons/lucid

« back to all changes in this revision

Viewing changes to extensions/ipset/ip_set_setlist.c

  • Committer: Bazaar Package Importer
  • Author(s): Pierre Chifflier
  • Date: 2009-09-10 21:42:05 UTC
  • mfrom: (1.2.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20090910214205-neqgwq7y5nctaty7
Tags: 1.18-1
* New Upstream Version
  This version has support for 2.6.31 (Closes: #545542)
* Bump standards version (no changes)
* Depend on quilt (Closes: #533653)

Show diffs side-by-side

added added

removed removed

Lines of Context:
21
21
 * after  ==> ref, index
22
22
 */
23
23
 
24
 
static inline bool
 
24
static inline int
25
25
next_index_eq(const struct ip_set_setlist *map, int i, ip_set_id_t index)
26
26
{
27
27
        return i < map->size && map->index[i] == index;
38
38
        struct ip_set *s;
39
39
        
40
40
        if (req->before && req->ref[0] == '\0')
41
 
                return -EINVAL;
 
41
                return 0;
42
42
 
43
43
        index = __ip_set_get_byname(req->name, &s);
44
44
        if (index == IP_SET_INVALID_ID)
45
 
                return -EEXIST;
 
45
                return 0;
46
46
        if (req->ref[0] != '\0') {
47
47
                ref = __ip_set_get_byname(req->ref, &s);
48
 
                if (ref == IP_SET_INVALID_ID) {
49
 
                        res = -EEXIST;
 
48
                if (ref == IP_SET_INVALID_ID)
50
49
                        goto finish;
51
 
                }
52
50
        }
53
51
        for (i = 0; i < map->size
54
52
                    && map->index[i] != IP_SET_INVALID_ID; i++) {
172
170
        return res;
173
171
}
174
172
 
175
 
static inline bool
 
173
static inline int
176
174
unshift_setlist(struct ip_set_setlist *map, int i)
177
175
{
178
176
        int j;