Loading include/linux/netfilter/ipset/ip_set.h +2 −3 Original line number Diff line number Diff line Loading @@ -354,7 +354,6 @@ ip_set_put_skbinfo(struct sk_buff *skb, struct ip_set_skbinfo *skbinfo) (skbinfo->skbqueue && nla_put_net16(skb, IPSET_ATTR_SKBQUEUE, cpu_to_be16(skbinfo->skbqueue))); } static inline void Loading include/uapi/linux/netfilter/ipset/ip_set.h +3 −3 Original line number Diff line number Diff line Loading @@ -15,12 +15,12 @@ /* The protocol version */ #define IPSET_PROTOCOL 6 /* The maximum permissible comment length we will accept over netlink */ #define IPSET_MAX_COMMENT_SIZE 255 /* The max length of strings including NUL: set and type identifiers */ #define IPSET_MAXNAMELEN 32 /* The maximum permissible comment length we will accept over netlink */ #define IPSET_MAX_COMMENT_SIZE 255 /* Message types and commands */ enum ipset_cmd { IPSET_CMD_NONE, Loading net/netfilter/ipset/ip_set_bitmap_gen.h +6 −5 Original line number Diff line number Diff line Loading @@ -272,7 +272,8 @@ mtype_gc(unsigned long ul_set) u32 id; /* We run parallel with other readers (test element) * but adding/deleting new entries is locked out */ * but adding/deleting new entries is locked out */ spin_lock_bh(&set->lock); for (id = 0; id < map->elements; id++) if (mtype_gc_test(id, map, set->dsize)) { Loading net/netfilter/ipset/ip_set_bitmap_ip.c +7 −5 Original line number Diff line number Diff line Loading @@ -175,8 +175,9 @@ bitmap_ip_uadt(struct ip_set *set, struct nlattr *tb[], if (!cidr || cidr > HOST_MASK) return -IPSET_ERR_INVALID_CIDR; ip_set_mask_from_to(ip, ip_to, cidr); } else } else { ip_to = ip; } if (ip_to > map->last_ip) return -IPSET_ERR_BITMAP_RANGE; Loading @@ -187,7 +188,7 @@ bitmap_ip_uadt(struct ip_set *set, struct nlattr *tb[], if (ret && !ip_set_eexist(ret, flags)) return ret; else ret = 0; } return ret; Loading Loading @@ -278,8 +279,9 @@ bitmap_ip_create(struct net *net, struct ip_set *set, struct nlattr *tb[], if (cidr >= HOST_MASK) return -IPSET_ERR_INVALID_CIDR; ip_set_mask_from_to(first_ip, last_ip, cidr); } else } else { return -IPSET_ERR_PROTOCOL; } if (tb[IPSET_ATTR_NETMASK]) { netmask = nla_get_u8(tb[IPSET_ATTR_NETMASK]); Loading net/netfilter/ipset/ip_set_bitmap_ipmac.c +11 −10 Original line number Diff line number Diff line Loading @@ -90,7 +90,7 @@ bitmap_ipmac_do_test(const struct bitmap_ipmac_adt_elem *e, return 0; elem = get_elem(map->extensions, e->id, dsize); if (elem->filled == MAC_FILLED) return e->ether == NULL || return !e->ether || ether_addr_equal(e->ether, elem->ether); /* Trigger kernel to fill out the ethernet address */ return -EAGAIN; Loading Loading @@ -131,7 +131,8 @@ bitmap_ipmac_add_timeout(unsigned long *timeout, /* If MAC is unset yet, we store plain timeout value * because the timer is not activated yet * and we can reuse it later when MAC is filled out, * possibly by the kernel */ * possibly by the kernel */ if (e->ether) ip_set_timeout_set(timeout, t); else Loading @@ -155,7 +156,7 @@ bitmap_ipmac_do_add(const struct bitmap_ipmac_adt_elem *e, /* memcpy isn't atomic */ clear_bit(e->id, map->members); smp_mb__after_atomic(); memcpy(elem->ether, e->ether, ETH_ALEN); ether_addr_copy(elem->ether, e->ether); } return IPSET_ADD_FAILED; } else if (!e->ether) Loading @@ -164,20 +165,19 @@ bitmap_ipmac_do_add(const struct bitmap_ipmac_adt_elem *e, /* Fill the MAC address and trigger the timer activation */ clear_bit(e->id, map->members); smp_mb__after_atomic(); memcpy(elem->ether, e->ether, ETH_ALEN); ether_addr_copy(elem->ether, e->ether); elem->filled = MAC_FILLED; return IPSET_ADD_START_STORED_TIMEOUT; } else if (e->ether) { /* We can store MAC too */ memcpy(elem->ether, e->ether, ETH_ALEN); ether_addr_copy(elem->ether, e->ether); elem->filled = MAC_FILLED; return 0; } else { } elem->filled = MAC_UNSET; /* MAC is not stored yet, don't start timer */ return IPSET_ADD_STORE_PLAIN_TIMEOUT; } } static inline int bitmap_ipmac_do_del(const struct bitmap_ipmac_adt_elem *e, Loading Loading @@ -352,8 +352,9 @@ bitmap_ipmac_create(struct net *net, struct ip_set *set, struct nlattr *tb[], if (cidr >= HOST_MASK) return -IPSET_ERR_INVALID_CIDR; ip_set_mask_from_to(first_ip, last_ip, cidr); } else } else { return -IPSET_ERR_PROTOCOL; } elements = (u64)last_ip - first_ip + 1; Loading Loading
include/linux/netfilter/ipset/ip_set.h +2 −3 Original line number Diff line number Diff line Loading @@ -354,7 +354,6 @@ ip_set_put_skbinfo(struct sk_buff *skb, struct ip_set_skbinfo *skbinfo) (skbinfo->skbqueue && nla_put_net16(skb, IPSET_ATTR_SKBQUEUE, cpu_to_be16(skbinfo->skbqueue))); } static inline void Loading
include/uapi/linux/netfilter/ipset/ip_set.h +3 −3 Original line number Diff line number Diff line Loading @@ -15,12 +15,12 @@ /* The protocol version */ #define IPSET_PROTOCOL 6 /* The maximum permissible comment length we will accept over netlink */ #define IPSET_MAX_COMMENT_SIZE 255 /* The max length of strings including NUL: set and type identifiers */ #define IPSET_MAXNAMELEN 32 /* The maximum permissible comment length we will accept over netlink */ #define IPSET_MAX_COMMENT_SIZE 255 /* Message types and commands */ enum ipset_cmd { IPSET_CMD_NONE, Loading
net/netfilter/ipset/ip_set_bitmap_gen.h +6 −5 Original line number Diff line number Diff line Loading @@ -272,7 +272,8 @@ mtype_gc(unsigned long ul_set) u32 id; /* We run parallel with other readers (test element) * but adding/deleting new entries is locked out */ * but adding/deleting new entries is locked out */ spin_lock_bh(&set->lock); for (id = 0; id < map->elements; id++) if (mtype_gc_test(id, map, set->dsize)) { Loading
net/netfilter/ipset/ip_set_bitmap_ip.c +7 −5 Original line number Diff line number Diff line Loading @@ -175,8 +175,9 @@ bitmap_ip_uadt(struct ip_set *set, struct nlattr *tb[], if (!cidr || cidr > HOST_MASK) return -IPSET_ERR_INVALID_CIDR; ip_set_mask_from_to(ip, ip_to, cidr); } else } else { ip_to = ip; } if (ip_to > map->last_ip) return -IPSET_ERR_BITMAP_RANGE; Loading @@ -187,7 +188,7 @@ bitmap_ip_uadt(struct ip_set *set, struct nlattr *tb[], if (ret && !ip_set_eexist(ret, flags)) return ret; else ret = 0; } return ret; Loading Loading @@ -278,8 +279,9 @@ bitmap_ip_create(struct net *net, struct ip_set *set, struct nlattr *tb[], if (cidr >= HOST_MASK) return -IPSET_ERR_INVALID_CIDR; ip_set_mask_from_to(first_ip, last_ip, cidr); } else } else { return -IPSET_ERR_PROTOCOL; } if (tb[IPSET_ATTR_NETMASK]) { netmask = nla_get_u8(tb[IPSET_ATTR_NETMASK]); Loading
net/netfilter/ipset/ip_set_bitmap_ipmac.c +11 −10 Original line number Diff line number Diff line Loading @@ -90,7 +90,7 @@ bitmap_ipmac_do_test(const struct bitmap_ipmac_adt_elem *e, return 0; elem = get_elem(map->extensions, e->id, dsize); if (elem->filled == MAC_FILLED) return e->ether == NULL || return !e->ether || ether_addr_equal(e->ether, elem->ether); /* Trigger kernel to fill out the ethernet address */ return -EAGAIN; Loading Loading @@ -131,7 +131,8 @@ bitmap_ipmac_add_timeout(unsigned long *timeout, /* If MAC is unset yet, we store plain timeout value * because the timer is not activated yet * and we can reuse it later when MAC is filled out, * possibly by the kernel */ * possibly by the kernel */ if (e->ether) ip_set_timeout_set(timeout, t); else Loading @@ -155,7 +156,7 @@ bitmap_ipmac_do_add(const struct bitmap_ipmac_adt_elem *e, /* memcpy isn't atomic */ clear_bit(e->id, map->members); smp_mb__after_atomic(); memcpy(elem->ether, e->ether, ETH_ALEN); ether_addr_copy(elem->ether, e->ether); } return IPSET_ADD_FAILED; } else if (!e->ether) Loading @@ -164,20 +165,19 @@ bitmap_ipmac_do_add(const struct bitmap_ipmac_adt_elem *e, /* Fill the MAC address and trigger the timer activation */ clear_bit(e->id, map->members); smp_mb__after_atomic(); memcpy(elem->ether, e->ether, ETH_ALEN); ether_addr_copy(elem->ether, e->ether); elem->filled = MAC_FILLED; return IPSET_ADD_START_STORED_TIMEOUT; } else if (e->ether) { /* We can store MAC too */ memcpy(elem->ether, e->ether, ETH_ALEN); ether_addr_copy(elem->ether, e->ether); elem->filled = MAC_FILLED; return 0; } else { } elem->filled = MAC_UNSET; /* MAC is not stored yet, don't start timer */ return IPSET_ADD_STORE_PLAIN_TIMEOUT; } } static inline int bitmap_ipmac_do_del(const struct bitmap_ipmac_adt_elem *e, Loading Loading @@ -352,8 +352,9 @@ bitmap_ipmac_create(struct net *net, struct ip_set *set, struct nlattr *tb[], if (cidr >= HOST_MASK) return -IPSET_ERR_INVALID_CIDR; ip_set_mask_from_to(first_ip, last_ip, cidr); } else } else { return -IPSET_ERR_PROTOCOL; } elements = (u64)last_ip - first_ip + 1; Loading