aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv6/addrconf.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/ipv6/addrconf.c')
-rw-r--r--net/ipv6/addrconf.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c
index c2c26fa0943d..4da664538f52 100644
--- a/net/ipv6/addrconf.c
+++ b/net/ipv6/addrconf.c
@@ -862,6 +862,8 @@ static int inline ipv6_saddr_label(const struct in6_addr *addr, int type)
862 * 2002::/16 2 862 * 2002::/16 2
863 * ::/96 3 863 * ::/96 3
864 * ::ffff:0:0/96 4 864 * ::ffff:0:0/96 4
865 * fc00::/7 5
866 * 2001::/32 6
865 */ 867 */
866 if (type & IPV6_ADDR_LOOPBACK) 868 if (type & IPV6_ADDR_LOOPBACK)
867 return 0; 869 return 0;
@@ -869,8 +871,12 @@ static int inline ipv6_saddr_label(const struct in6_addr *addr, int type)
869 return 3; 871 return 3;
870 else if (type & IPV6_ADDR_MAPPED) 872 else if (type & IPV6_ADDR_MAPPED)
871 return 4; 873 return 4;
874 else if (addr->s6_addr32[0] == htonl(0x20010000))
875 return 6;
872 else if (addr->s6_addr16[0] == htons(0x2002)) 876 else if (addr->s6_addr16[0] == htons(0x2002))
873 return 2; 877 return 2;
878 else if ((addr->s6_addr[0] & 0xfe) == 0xfc)
879 return 5;
874 return 1; 880 return 1;
875} 881}
876 882
@@ -1069,6 +1075,9 @@ int ipv6_dev_get_saddr(struct net_device *daddr_dev,
1069 if (hiscore.attrs & IPV6_SADDR_SCORE_PRIVACY) 1075 if (hiscore.attrs & IPV6_SADDR_SCORE_PRIVACY)
1070 continue; 1076 continue;
1071 } 1077 }
1078#else
1079 if (hiscore.rule < 7)
1080 hiscore.rule++;
1072#endif 1081#endif
1073 /* Rule 8: Use longest matching prefix */ 1082 /* Rule 8: Use longest matching prefix */
1074 if (hiscore.rule < 8) { 1083 if (hiscore.rule < 8) {