&netlink_compare, &arg);
}
-static bool __netlink_insert(struct netlink_table *table, struct sock *sk,
- struct net *net)
+static bool __netlink_insert(struct netlink_table *table, struct sock *sk)
{
struct netlink_compare_arg arg = {
- .net = net,
+ .net = sock_net(sk),
.portid = nlk_sk(sk)->portid,
};
* makes sure updates are visible before bind or setsockopt return. */
}
-static int netlink_insert(struct sock *sk, struct net *net, u32 portid)
+static int netlink_insert(struct sock *sk, u32 portid)
{
struct netlink_table *table = &nl_table[sk->sk_protocol];
int err;
sock_hold(sk);
err = 0;
- if (!__netlink_insert(table, sk, net)) {
+ if (!__netlink_insert(table, sk)) {
err = -EADDRINUSE;
sock_put(sk);
}
}
rcu_read_unlock();
- err = netlink_insert(sk, net, portid);
+ err = netlink_insert(sk, portid);
if (err == -EADDRINUSE)
goto retry;
if (!nlk->portid) {
err = nladdr->nl_pid ?
- netlink_insert(sk, net, nladdr->nl_pid) :
+ netlink_insert(sk, nladdr->nl_pid) :
netlink_autobind(sock);
if (err) {
netlink_undo_bind(nlk->ngroups, groups, sk);
if (cfg && cfg->input)
nlk_sk(sk)->netlink_rcv = cfg->input;
- if (netlink_insert(sk, net, 0))
+ if (netlink_insert(sk, 0))
goto out_sock_release;
nlk = nlk_sk(sk);