addrconf.c (a4ec80082c82f3fda775d13b2a72aac38248ced6) addrconf.c (5241c2d7c52757e6df79877ba282762df0caea9f)
1/*
2 * IPv6 Address [auto]configuration
3 * Linux INET6 implementation
4 *
5 * Authors:
6 * Pedro Roque <roque@di.fc.ul.pt>
7 * Alexey Kuznetsov <kuznet@ms2.inr.ac.ru>
8 *

--- 56 unchanged lines hidden (view full) ---

65#include <linux/notifier.h>
66#include <linux/string.h>
67#include <linux/hash.h>
68
69#include <net/net_namespace.h>
70#include <net/sock.h>
71#include <net/snmp.h>
72
1/*
2 * IPv6 Address [auto]configuration
3 * Linux INET6 implementation
4 *
5 * Authors:
6 * Pedro Roque <roque@di.fc.ul.pt>
7 * Alexey Kuznetsov <kuznet@ms2.inr.ac.ru>
8 *

--- 56 unchanged lines hidden (view full) ---

65#include <linux/notifier.h>
66#include <linux/string.h>
67#include <linux/hash.h>
68
69#include <net/net_namespace.h>
70#include <net/sock.h>
71#include <net/snmp.h>
72
73#include <net/af_ieee802154.h>
73#include <net/6lowpan.h>
74#include <net/firewire.h>
75#include <net/ipv6.h>
76#include <net/protocol.h>
77#include <net/ndisc.h>
78#include <net/ip6_route.h>
79#include <net/addrconf.h>
80#include <net/tcp.h>
81#include <net/ip.h>

--- 1860 unchanged lines hidden (view full) ---

1942 ipv6_addr_prefix(&addr, &ifp->addr, ifp->prefix_len);
1943 if (ipv6_addr_any(&addr))
1944 return;
1945 __ipv6_dev_ac_dec(ifp->idev, &addr);
1946}
1947
1948static int addrconf_ifid_eui64(u8 *eui, struct net_device *dev)
1949{
74#include <net/firewire.h>
75#include <net/ipv6.h>
76#include <net/protocol.h>
77#include <net/ndisc.h>
78#include <net/ip6_route.h>
79#include <net/addrconf.h>
80#include <net/tcp.h>
81#include <net/ip.h>

--- 1860 unchanged lines hidden (view full) ---

1942 ipv6_addr_prefix(&addr, &ifp->addr, ifp->prefix_len);
1943 if (ipv6_addr_any(&addr))
1944 return;
1945 __ipv6_dev_ac_dec(ifp->idev, &addr);
1946}
1947
1948static int addrconf_ifid_eui64(u8 *eui, struct net_device *dev)
1949{
1950 if (dev->addr_len != IEEE802154_ADDR_LEN)
1950 if (dev->addr_len != EUI64_ADDR_LEN)
1951 return -1;
1951 return -1;
1952 memcpy(eui, dev->dev_addr, 8);
1952 memcpy(eui, dev->dev_addr, EUI64_ADDR_LEN);
1953 eui[0] ^= 2;
1954 return 0;
1955}
1956
1957static int addrconf_ifid_ieee1394(u8 *eui, struct net_device *dev)
1958{
1959 union fwnet_hwaddr *ha;
1960

--- 75 unchanged lines hidden (view full) ---

2036 return addrconf_ifid_arcnet(eui, dev);
2037 case ARPHRD_INFINIBAND:
2038 return addrconf_ifid_infiniband(eui, dev);
2039 case ARPHRD_SIT:
2040 return addrconf_ifid_sit(eui, dev);
2041 case ARPHRD_IPGRE:
2042 return addrconf_ifid_gre(eui, dev);
2043 case ARPHRD_6LOWPAN:
1953 eui[0] ^= 2;
1954 return 0;
1955}
1956
1957static int addrconf_ifid_ieee1394(u8 *eui, struct net_device *dev)
1958{
1959 union fwnet_hwaddr *ha;
1960

--- 75 unchanged lines hidden (view full) ---

2036 return addrconf_ifid_arcnet(eui, dev);
2037 case ARPHRD_INFINIBAND:
2038 return addrconf_ifid_infiniband(eui, dev);
2039 case ARPHRD_SIT:
2040 return addrconf_ifid_sit(eui, dev);
2041 case ARPHRD_IPGRE:
2042 return addrconf_ifid_gre(eui, dev);
2043 case ARPHRD_6LOWPAN:
2044 case ARPHRD_IEEE802154:
2045 return addrconf_ifid_eui64(eui, dev);
2046 case ARPHRD_IEEE1394:
2047 return addrconf_ifid_ieee1394(eui, dev);
2048 case ARPHRD_TUNNEL6:
2049 return addrconf_ifid_ip6tnl(eui, dev);
2050 }
2051 return -1;
2052}

--- 1008 unchanged lines hidden (view full) ---

3061 struct inet6_dev *idev;
3062
3063 ASSERT_RTNL();
3064
3065 if ((dev->type != ARPHRD_ETHER) &&
3066 (dev->type != ARPHRD_FDDI) &&
3067 (dev->type != ARPHRD_ARCNET) &&
3068 (dev->type != ARPHRD_INFINIBAND) &&
2044 return addrconf_ifid_eui64(eui, dev);
2045 case ARPHRD_IEEE1394:
2046 return addrconf_ifid_ieee1394(eui, dev);
2047 case ARPHRD_TUNNEL6:
2048 return addrconf_ifid_ip6tnl(eui, dev);
2049 }
2050 return -1;
2051}

--- 1008 unchanged lines hidden (view full) ---

3060 struct inet6_dev *idev;
3061
3062 ASSERT_RTNL();
3063
3064 if ((dev->type != ARPHRD_ETHER) &&
3065 (dev->type != ARPHRD_FDDI) &&
3066 (dev->type != ARPHRD_ARCNET) &&
3067 (dev->type != ARPHRD_INFINIBAND) &&
3069 (dev->type != ARPHRD_IEEE802154) &&
3070 (dev->type != ARPHRD_IEEE1394) &&
3071 (dev->type != ARPHRD_TUNNEL6) &&
3072 (dev->type != ARPHRD_6LOWPAN)) {
3073 /* Alas, we support only Ethernet autoconfiguration. */
3074 return;
3075 }
3076
3077 idev = addrconf_add_dev(dev);

--- 2949 unchanged lines hidden ---
3068 (dev->type != ARPHRD_IEEE1394) &&
3069 (dev->type != ARPHRD_TUNNEL6) &&
3070 (dev->type != ARPHRD_6LOWPAN)) {
3071 /* Alas, we support only Ethernet autoconfiguration. */
3072 return;
3073 }
3074
3075 idev = addrconf_add_dev(dev);

--- 2949 unchanged lines hidden ---