netlink: Remove nonblock parameter from netlink_attachskb
[safe/jmp/linux-2.6] / net / netlink / af_netlink.c
index 1d16d95..6507c02 100644 (file)
@@ -54,7 +54,6 @@
 #include <linux/mm.h>
 #include <linux/types.h>
 #include <linux/audit.h>
-#include <linux/selinux.h>
 #include <linux/mutex.h>
 
 #include <net/net_namespace.h>
@@ -228,7 +227,7 @@ static inline struct sock *netlink_lookup(struct net *net, int protocol,
        read_lock(&nl_table_lock);
        head = nl_pid_hashfn(hash, pid);
        sk_for_each(sk, node, head) {
-               if (sock_net(sk) == net && (nlk_sk(sk)->pid == pid)) {
+               if (net_eq(sock_net(sk), net) && (nlk_sk(sk)->pid == pid)) {
                        sock_hold(sk);
                        goto found;
                }
@@ -348,7 +347,7 @@ static int netlink_insert(struct sock *sk, struct net *net, u32 pid)
        head = nl_pid_hashfn(hash, pid);
        len = 0;
        sk_for_each(osk, node, head) {
-               if (sock_net(osk) == net && (nlk_sk(osk)->pid == pid))
+               if (net_eq(sock_net(osk), net) && (nlk_sk(osk)->pid == pid))
                        break;
                len++;
        }
@@ -532,7 +531,7 @@ retry:
        netlink_table_grab();
        head = nl_pid_hashfn(hash, pid);
        sk_for_each(osk, node, head) {
-               if (sock_net(osk) != net)
+               if (!net_eq(sock_net(osk), net))
                        continue;
                if (nlk_sk(osk)->pid == pid) {
                        /* Bind collision, search negative pid values. */
@@ -760,7 +759,7 @@ struct sock *netlink_getsockbyfilp(struct file *filp)
  * 0: continue
  * 1: repeat lookup - reference dropped while waiting for socket memory.
  */
-int netlink_attachskb(struct sock *sk, struct sk_buff *skb, int nonblock,
+int netlink_attachskb(struct sock *sk, struct sk_buff *skb,
                      long *timeo, struct sock *ssk)
 {
        struct netlink_sock *nlk;
@@ -893,7 +892,7 @@ retry:
                return err;
        }
 
-       err = netlink_attachskb(sk, skb, nonblock, &timeo, ssk);
+       err = netlink_attachskb(sk, skb, &timeo, ssk);
        if (err == 1)
                goto retry;
        if (err)
@@ -962,7 +961,7 @@ static inline int do_one_broadcast(struct sock *sk,
            !test_bit(p->group - 1, nlk->groups))
                goto out;
 
-       if (sock_net(sk) != p->net)
+       if (!net_eq(sock_net(sk), p->net))
                goto out;
 
        if (p->failure) {
@@ -1249,7 +1248,8 @@ static int netlink_sendmsg(struct kiocb *kiocb, struct socket *sock,
        NETLINK_CB(skb).pid     = nlk->pid;
        NETLINK_CB(skb).dst_group = dst_group;
        NETLINK_CB(skb).loginuid = audit_get_loginuid(current);
-       selinux_get_task_sid(current, &(NETLINK_CB(skb).sid));
+       NETLINK_CB(skb).sessionid = audit_get_sessionid(current);
+       security_task_getsecid(current, &(NETLINK_CB(skb).sid));
        memcpy(NETLINK_CREDS(skb), &siocb->scm->creds, sizeof(struct ucred));
 
        /* What can I do? Netlink is asynchronous, so that