diff options
author | Sergey Popovich <popovich_sergei@mail.ua> | 2015-06-12 21:14:09 +0200 |
---|---|---|
committer | Jozsef Kadlecsik <kadlec@blackhole.kfki.hu> | 2015-06-14 10:40:13 +0200 |
commit | 7dd37bc8e605d3ce14e6a1bc88ebbfae7ef43b9f (patch) | |
tree | e4a72aabc8328616343e6d4d27bd21d6e93518d7 /net/netfilter/ipset/ip_set_hash_mac.c | |
parent | netfilter: ipset: Use SET_WITH_*() helpers to test set extensions (diff) | |
download | linux-dev-7dd37bc8e605d3ce14e6a1bc88ebbfae7ef43b9f.tar.xz linux-dev-7dd37bc8e605d3ce14e6a1bc88ebbfae7ef43b9f.zip |
netfilter: ipset: Check extensions attributes before getting extensions.
Make all extensions attributes checks within ip_set_get_extensions()
and reduce number of duplicated code.
Signed-off-by: Sergey Popovich <popovich_sergei@mail.ua>
Signed-off-by: Jozsef Kadlecsik <kadlec@blackhole.kfki.hu>
Diffstat (limited to 'net/netfilter/ipset/ip_set_hash_mac.c')
-rw-r--r-- | net/netfilter/ipset/ip_set_hash_mac.c | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/net/netfilter/ipset/ip_set_hash_mac.c b/net/netfilter/ipset/ip_set_hash_mac.c index 1f8668d7a538..0d4951997943 100644 --- a/net/netfilter/ipset/ip_set_hash_mac.c +++ b/net/netfilter/ipset/ip_set_hash_mac.c @@ -107,13 +107,7 @@ hash_mac4_uadt(struct ip_set *set, struct nlattr *tb[], struct ip_set_ext ext = IP_SET_INIT_UEXT(set); int ret; - if (unlikely(!tb[IPSET_ATTR_ETHER] || - !ip_set_optattr_netorder(tb, IPSET_ATTR_TIMEOUT) || - !ip_set_optattr_netorder(tb, IPSET_ATTR_PACKETS) || - !ip_set_optattr_netorder(tb, IPSET_ATTR_BYTES) || - !ip_set_optattr_netorder(tb, IPSET_ATTR_SKBMARK) || - !ip_set_optattr_netorder(tb, IPSET_ATTR_SKBPRIO) || - !ip_set_optattr_netorder(tb, IPSET_ATTR_SKBQUEUE))) + if (unlikely(!tb[IPSET_ATTR_ETHER])) return -IPSET_ERR_PROTOCOL; if (tb[IPSET_ATTR_LINENO]) |