]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - net/ipv6/addrconf.c
ipv6: addrconf: drop ieee802154 specific things
[karo-tx-linux.git] / net / ipv6 / addrconf.c
index d72fa90d6feb0122d15d68d6d862e5299d331008..7082fb79d876c4cbb08e3894df753be16399ea6b 100644 (file)
@@ -70,7 +70,7 @@
 #include <net/sock.h>
 #include <net/snmp.h>
 
-#include <net/af_ieee802154.h>
+#include <net/6lowpan.h>
 #include <net/firewire.h>
 #include <net/ipv6.h>
 #include <net/protocol.h>
@@ -418,6 +418,7 @@ static struct inet6_dev *ipv6_add_dev(struct net_device *dev)
        if (err) {
                ipv6_mc_destroy_dev(ndev);
                del_timer(&ndev->regen_timer);
+               snmp6_unregister_dev(ndev);
                goto err_release;
        }
        /* protected by rtnl_lock */
@@ -1946,9 +1947,9 @@ static void addrconf_leave_anycast(struct inet6_ifaddr *ifp)
 
 static int addrconf_ifid_eui64(u8 *eui, struct net_device *dev)
 {
-       if (dev->addr_len != IEEE802154_ADDR_LEN)
+       if (dev->addr_len != EUI64_ADDR_LEN)
                return -1;
-       memcpy(eui, dev->dev_addr, 8);
+       memcpy(eui, dev->dev_addr, EUI64_ADDR_LEN);
        eui[0] ^= 2;
        return 0;
 }
@@ -2040,7 +2041,6 @@ static int ipv6_generate_eui64(u8 *eui, struct net_device *dev)
        case ARPHRD_IPGRE:
                return addrconf_ifid_gre(eui, dev);
        case ARPHRD_6LOWPAN:
-       case ARPHRD_IEEE802154:
                return addrconf_ifid_eui64(eui, dev);
        case ARPHRD_IEEE1394:
                return addrconf_ifid_ieee1394(eui, dev);
@@ -3065,7 +3065,6 @@ static void addrconf_dev_config(struct net_device *dev)
            (dev->type != ARPHRD_FDDI) &&
            (dev->type != ARPHRD_ARCNET) &&
            (dev->type != ARPHRD_INFINIBAND) &&
-           (dev->type != ARPHRD_IEEE802154) &&
            (dev->type != ARPHRD_IEEE1394) &&
            (dev->type != ARPHRD_TUNNEL6) &&
            (dev->type != ARPHRD_6LOWPAN)) {
@@ -3286,7 +3285,8 @@ static int addrconf_notify(struct notifier_block *this, unsigned long event,
 
        case NETDEV_PRE_TYPE_CHANGE:
        case NETDEV_POST_TYPE_CHANGE:
-               addrconf_type_change(dev, event);
+               if (idev)
+                       addrconf_type_change(dev, event);
                break;
        }
 
@@ -3641,7 +3641,7 @@ static void addrconf_dad_work(struct work_struct *w)
 
        /* send a neighbour solicitation for our addr */
        addrconf_addr_solict_mult(&ifp->addr, &mcaddr);
-       ndisc_send_ns(ifp->idev->dev, &ifp->addr, &mcaddr, &in6addr_any, NULL);
+       ndisc_send_ns(ifp->idev->dev, &ifp->addr, &mcaddr, &in6addr_any);
 out:
        in6_ifa_put(ifp);
        rtnl_unlock();
@@ -5198,6 +5198,20 @@ int addrconf_sysctl_forward(struct ctl_table *ctl, int write,
        return ret;
 }
 
+static
+int addrconf_sysctl_hop_limit(struct ctl_table *ctl, int write,
+                              void __user *buffer, size_t *lenp, loff_t *ppos)
+{
+       struct ctl_table lctl;
+       int min_hl = 1, max_hl = 255;
+
+       lctl = *ctl;
+       lctl.extra1 = &min_hl;
+       lctl.extra2 = &max_hl;
+
+       return proc_dointvec_minmax(&lctl, write, buffer, lenp, ppos);
+}
+
 static
 int addrconf_sysctl_mtu(struct ctl_table *ctl, int write,
                        void __user *buffer, size_t *lenp, loff_t *ppos)
@@ -5453,7 +5467,7 @@ static struct addrconf_sysctl_table
                        .data           = &ipv6_devconf.hop_limit,
                        .maxlen         = sizeof(int),
                        .mode           = 0644,
-                       .proc_handler   = proc_dointvec,
+                       .proc_handler   = addrconf_sysctl_hop_limit,
                },
                {
                        .procname       = "mtu",