]> git.proxmox.com Git - mirror_ubuntu-eoan-kernel.git/blobdiff - net/netlink/af_netlink.c
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
[mirror_ubuntu-eoan-kernel.git] / net / netlink / af_netlink.c
index c8416792cce0bed9bedcd18f15aa7c2278afa3de..aeefe127691a8f14f132a5c6db8ad3e8a68d546a 100644 (file)
@@ -688,7 +688,7 @@ static int netlink_release(struct socket *sock)
 
        skb_queue_purge(&sk->sk_write_queue);
 
-       if (nlk->portid) {
+       if (nlk->portid && nlk->bound) {
                struct netlink_notify n = {
                                                .net = sock_net(sk),
                                                .protocol = sk->sk_protocol,
@@ -1033,6 +1033,14 @@ static int netlink_getname(struct socket *sock, struct sockaddr *addr,
        return 0;
 }
 
+static int netlink_ioctl(struct socket *sock, unsigned int cmd,
+                        unsigned long arg)
+{
+       /* try to hand this ioctl down to the NIC drivers.
+        */
+       return -ENOIOCTLCMD;
+}
+
 static struct sock *netlink_getsockbyportid(struct sock *ssk, u32 portid)
 {
        struct sock *sock;
@@ -2335,7 +2343,8 @@ static int netlink_walk_start(struct nl_seq_iter *iter)
 {
        int err;
 
-       err = rhashtable_walk_init(&nl_table[iter->link].hash, &iter->hti);
+       err = rhashtable_walk_init(&nl_table[iter->link].hash, &iter->hti,
+                                  GFP_KERNEL);
        if (err) {
                iter->link = MAX_LINKS;
                return err;
@@ -2494,7 +2503,7 @@ static const struct proto_ops netlink_ops = {
        .accept =       sock_no_accept,
        .getname =      netlink_getname,
        .poll =         datagram_poll,
-       .ioctl =        sock_no_ioctl,
+       .ioctl =        netlink_ioctl,
        .listen =       sock_no_listen,
        .shutdown =     sock_no_shutdown,
        .setsockopt =   netlink_setsockopt,