|
@@ -1788,6 +1788,23 @@ ip_set_sockfn_get(struct sock *sk, int optval, void __user *user, int *len)
|
|
|
nfnl_unlock(NFNL_SUBSYS_IPSET);
|
|
|
goto copy;
|
|
|
}
|
|
|
+ case IP_SET_OP_GET_FNAME: {
|
|
|
+ struct ip_set_req_get_set_family *req_get = data;
|
|
|
+ ip_set_id_t id;
|
|
|
+
|
|
|
+ if (*len != sizeof(struct ip_set_req_get_set_family)) {
|
|
|
+ ret = -EINVAL;
|
|
|
+ goto done;
|
|
|
+ }
|
|
|
+ req_get->set.name[IPSET_MAXNAMELEN - 1] = '\0';
|
|
|
+ nfnl_lock(NFNL_SUBSYS_IPSET);
|
|
|
+ find_set_and_id(req_get->set.name, &id);
|
|
|
+ req_get->set.index = id;
|
|
|
+ if (id != IPSET_INVALID_ID)
|
|
|
+ req_get->family = nfnl_set(id)->family;
|
|
|
+ nfnl_unlock(NFNL_SUBSYS_IPSET);
|
|
|
+ goto copy;
|
|
|
+ }
|
|
|
case IP_SET_OP_GET_BYINDEX: {
|
|
|
struct ip_set_req_get_set *req_get = data;
|
|
|
struct ip_set *set;
|