Commit 241d1af4 authored by Pablo Neira Ayuso's avatar Pablo Neira Ayuso

netfilter: nft_compat: use nfnetlink_unicast()

Use nfnetlink_unicast() which already translates EAGAIN to ENOBUFS,
since EAGAIN is reserved to report missing module dependencies to the
nfnetlink core.

e0241ae6 ("netfilter: use nfnetlink_unicast() forgot to update
this spot.
Reported-by: default avatarYajun Deng <yajun.deng@linux.dev>
Signed-off-by: default avatarPablo Neira Ayuso <pablo@netfilter.org>
parent aae950b1
...@@ -683,14 +683,12 @@ static int nfnl_compat_get_rcu(struct sk_buff *skb, ...@@ -683,14 +683,12 @@ static int nfnl_compat_get_rcu(struct sk_buff *skb,
goto out_put; goto out_put;
} }
ret = netlink_unicast(info->sk, skb2, NETLINK_CB(skb).portid, ret = nfnetlink_unicast(skb2, info->net, NETLINK_CB(skb).portid);
MSG_DONTWAIT);
if (ret > 0)
ret = 0;
out_put: out_put:
rcu_read_lock(); rcu_read_lock();
module_put(THIS_MODULE); module_put(THIS_MODULE);
return ret == -EAGAIN ? -ENOBUFS : ret;
return ret;
} }
static const struct nla_policy nfnl_compat_policy_get[NFTA_COMPAT_MAX+1] = { static const struct nla_policy nfnl_compat_policy_get[NFTA_COMPAT_MAX+1] = {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment