|
@@ -423,12 +423,16 @@ hash_ipportnet6_uadt(struct ip_set *set, struct nlattr *tb[],
|
|
|
if (unlikely(!tb[IPSET_ATTR_IP] || !tb[IPSET_ATTR_IP2] ||
|
|
|
!ip_set_attr_netorder(tb, IPSET_ATTR_PORT) ||
|
|
|
!ip_set_optattr_netorder(tb, IPSET_ATTR_PORT_TO) ||
|
|
|
- !ip_set_optattr_netorder(tb, IPSET_ATTR_CADT_FLAGS) ||
|
|
|
- tb[IPSET_ATTR_IP_TO] ||
|
|
|
- tb[IPSET_ATTR_CIDR]))
|
|
|
+ !ip_set_optattr_netorder(tb, IPSET_ATTR_CADT_FLAGS)))
|
|
|
return -IPSET_ERR_PROTOCOL;
|
|
|
if (unlikely(tb[IPSET_ATTR_IP_TO]))
|
|
|
return -IPSET_ERR_HASH_RANGE_UNSUPPORTED;
|
|
|
+ if (unlikely(tb[IPSET_ATTR_CIDR])) {
|
|
|
+ u8 cidr = nla_get_u8(tb[IPSET_ATTR_CIDR]);
|
|
|
+
|
|
|
+ if (cidr != HOST_MASK)
|
|
|
+ return -IPSET_ERR_INVALID_CIDR;
|
|
|
+ }
|
|
|
|
|
|
if (tb[IPSET_ATTR_LINENO])
|
|
|
*lineno = nla_get_u32(tb[IPSET_ATTR_LINENO]);
|