net: compat_mmsghdr must be used in sys_recvmmsg
[safe/jmp/linux-2.6] / net / netrom / af_netrom.c
index cd91190..71604c6 100644 (file)
@@ -301,7 +301,7 @@ void nr_destroy_socket(struct sock *sk)
  */
 
 static int nr_setsockopt(struct socket *sock, int level, int optname,
-       char __user *optval, int optlen)
+       char __user *optval, unsigned int optlen)
 {
        struct sock *sk = sock->sk;
        struct nr_sock *nr = nr_sk(sk);
@@ -425,12 +425,13 @@ static struct proto nr_proto = {
        .obj_size = sizeof(struct nr_sock),
 };
 
-static int nr_create(struct net *net, struct socket *sock, int protocol)
+static int nr_create(struct net *net, struct socket *sock, int protocol,
+                    int kern)
 {
        struct sock *sk;
        struct nr_sock *nr;
 
-       if (net != &init_net)
+       if (!net_eq(net, &init_net))
                return -EAFNOSUPPORT;
 
        if (sock->type != SOCK_SEQPACKET || protocol != 0)
@@ -847,6 +848,7 @@ static int nr_getname(struct socket *sock, struct sockaddr *uaddr,
                sax->fsa_ax25.sax25_family = AF_NETROM;
                sax->fsa_ax25.sax25_ndigis = 1;
                sax->fsa_ax25.sax25_call   = nr->user_addr;
+               memset(sax->fsa_digipeater, 0, sizeof(sax->fsa_digipeater));
                sax->fsa_digipeater[0]     = nr->dest_addr;
                *uaddr_len = sizeof(struct full_sockaddr_ax25);
        } else {
@@ -1205,7 +1207,7 @@ static int nr_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
                long amount;
 
                lock_sock(sk);
-               amount = sk->sk_sndbuf - atomic_read(&sk->sk_wmem_alloc);
+               amount = sk->sk_sndbuf - sk_wmem_alloc_get(sk);
                if (amount < 0)
                        amount = 0;
                release_sock(sk);
@@ -1341,8 +1343,8 @@ static int nr_info_show(struct seq_file *seq, void *v)
                        nr->n2count,
                        nr->n2,
                        nr->window,
-                       atomic_read(&s->sk_wmem_alloc),
-                       atomic_read(&s->sk_rmem_alloc),
+                       sk_wmem_alloc_get(s),
+                       sk_rmem_alloc_get(s),
                        s->sk_socket ? SOCK_INODE(s->sk_socket)->i_ino : 0L);
 
                bh_unlock_sock(s);
@@ -1371,7 +1373,7 @@ static const struct file_operations nr_info_fops = {
 };
 #endif /* CONFIG_PROC_FS */
 
-static struct net_proto_family nr_family_ops = {
+static const struct net_proto_family nr_family_ops = {
        .family         =       PF_NETROM,
        .create         =       nr_create,
        .owner          =       THIS_MODULE,