mfd: rk818: use rk808-regulator
[firefly-linux-kernel-4.4.55.git] / net / ipv4 / devinet.c
index 011e73357ba5467495a98aacba9e491654f34a30..0212591b00775f9210596369b2b5a9408f5ee205 100644 (file)
@@ -59,7 +59,6 @@
 
 #include <net/arp.h>
 #include <net/ip.h>
-#include <net/tcp.h>
 #include <net/route.h>
 #include <net/ip_fib.h>
 #include <net/rtnetlink.h>
@@ -335,6 +334,9 @@ static void __inet_del_ifa(struct in_device *in_dev, struct in_ifaddr **ifap,
 
        ASSERT_RTNL();
 
+       if (in_dev->dead)
+               goto no_promotions;
+
        /* 1. Deleting primary ifaddr forces deletion all secondaries
         * unless alias promotion is set
         **/
@@ -381,6 +383,7 @@ static void __inet_del_ifa(struct in_device *in_dev, struct in_ifaddr **ifap,
                        fib_del_ifaddr(ifa, ifa1);
        }
 
+no_promotions:
        /* 2. Unlink it */
 
        *ifap = ifa1->ifa_next;
@@ -965,7 +968,6 @@ int devinet_ioctl(struct net *net, unsigned int cmd, void __user *arg)
        case SIOCSIFBRDADDR:    /* Set the broadcast address */
        case SIOCSIFDSTADDR:    /* Set the destination address */
        case SIOCSIFNETMASK:    /* Set the netmask for the interface */
-       case SIOCKILLADDR:      /* Nuke all sockets on this address */
                ret = -EPERM;
                if (!ns_capable(net->user_ns, CAP_NET_ADMIN))
                        goto out;
@@ -1017,8 +1019,7 @@ int devinet_ioctl(struct net *net, unsigned int cmd, void __user *arg)
        }
 
        ret = -EADDRNOTAVAIL;
-       if (!ifa && cmd != SIOCSIFADDR && cmd != SIOCSIFFLAGS
-           && cmd != SIOCKILLADDR)
+       if (!ifa && cmd != SIOCSIFADDR && cmd != SIOCSIFFLAGS)
                goto done;
 
        switch (cmd) {
@@ -1145,9 +1146,6 @@ int devinet_ioctl(struct net *net, unsigned int cmd, void __user *arg)
                        inet_insert_ifa(ifa);
                }
                break;
-       case SIOCKILLADDR:      /* Nuke all connections on this address */
-               ret = tcp_nuke_addr(net, (struct sockaddr *) sin);
-               break;
        }
 done:
        rtnl_unlock();