addrconf.c (ce046c568cbfb4734583131086f88cfe993c01d0) addrconf.c (ff40217e73fd137daae0113ed71b218128913037)
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 *

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

2901 static DEFINE_SPINLOCK(lock);
2902 static __u32 digest[SHA_DIGEST_WORDS];
2903 static __u32 workspace[SHA_WORKSPACE_WORDS];
2904
2905 static union {
2906 char __data[SHA_MESSAGE_BYTES];
2907 struct {
2908 struct in6_addr secret;
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 *

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

2901 static DEFINE_SPINLOCK(lock);
2902 static __u32 digest[SHA_DIGEST_WORDS];
2903 static __u32 workspace[SHA_WORKSPACE_WORDS];
2904
2905 static union {
2906 char __data[SHA_MESSAGE_BYTES];
2907 struct {
2908 struct in6_addr secret;
2909 __be64 prefix;
2909 __be32 prefix[2];
2910 unsigned char hwaddr[MAX_ADDR_LEN];
2911 u8 dad_count;
2912 } __packed;
2913 } data;
2914
2915 struct in6_addr secret;
2916 struct in6_addr temp;
2917 struct net *net = dev_net(idev->dev);

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

2927
2928retry:
2929 spin_lock_bh(&lock);
2930
2931 sha_init(digest);
2932 memset(&data, 0, sizeof(data));
2933 memset(workspace, 0, sizeof(workspace));
2934 memcpy(data.hwaddr, idev->dev->perm_addr, idev->dev->addr_len);
2910 unsigned char hwaddr[MAX_ADDR_LEN];
2911 u8 dad_count;
2912 } __packed;
2913 } data;
2914
2915 struct in6_addr secret;
2916 struct in6_addr temp;
2917 struct net *net = dev_net(idev->dev);

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

2927
2928retry:
2929 spin_lock_bh(&lock);
2930
2931 sha_init(digest);
2932 memset(&data, 0, sizeof(data));
2933 memset(workspace, 0, sizeof(workspace));
2934 memcpy(data.hwaddr, idev->dev->perm_addr, idev->dev->addr_len);
2935 data.prefix = ((__be64)address->s6_addr32[0] << 32) |
2936 (__be64)address->s6_addr32[1];
2935 data.prefix[0] = address->s6_addr32[0];
2936 data.prefix[1] = address->s6_addr32[1];
2937 data.secret = secret;
2938 data.dad_count = dad_count;
2939
2940 sha_transform(digest, data.__data, workspace);
2941
2942 temp = *address;
2937 data.secret = secret;
2938 data.dad_count = dad_count;
2939
2940 sha_transform(digest, data.__data, workspace);
2941
2942 temp = *address;
2943 temp.s6_addr32[2] = digest[0];
2944 temp.s6_addr32[3] = digest[1];
2943 temp.s6_addr32[2] = (__force __be32)digest[0];
2944 temp.s6_addr32[3] = (__force __be32)digest[1];
2945
2946 spin_unlock_bh(&lock);
2947
2948 if (ipv6_reserved_interfaceid(temp)) {
2949 dad_count++;
2950 if (dad_count > dev_net(idev->dev)->ipv6.sysctl.idgen_retries)
2951 return -1;
2952 goto retry;

--- 2907 unchanged lines hidden ---
2945
2946 spin_unlock_bh(&lock);
2947
2948 if (ipv6_reserved_interfaceid(temp)) {
2949 dad_count++;
2950 if (dad_count > dev_net(idev->dev)->ipv6.sysctl.idgen_retries)
2951 return -1;
2952 goto retry;

--- 2907 unchanged lines hidden ---