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.c34
1 files changed, 0 insertions, 34 deletions
diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c
index 8499da9e76a2..a8218bc1806a 100644
--- a/net/ipv6/addrconf.c
+++ b/net/ipv6/addrconf.c
@@ -1370,40 +1370,6 @@ struct inet6_ifaddr *ipv6_get_ifaddr(struct net *net, const struct in6_addr *add
1370 return ifp; 1370 return ifp;
1371} 1371}
1372 1372
1373int ipv6_rcv_saddr_equal(const struct sock *sk, const struct sock *sk2)
1374{
1375 const struct in6_addr *sk_rcv_saddr6 = &inet6_sk(sk)->rcv_saddr;
1376 const struct in6_addr *sk2_rcv_saddr6 = inet6_rcv_saddr(sk2);
1377 __be32 sk_rcv_saddr = inet_sk(sk)->rcv_saddr;
1378 __be32 sk2_rcv_saddr = inet_rcv_saddr(sk2);
1379 int sk_ipv6only = ipv6_only_sock(sk);
1380 int sk2_ipv6only = inet_v6_ipv6only(sk2);
1381 int addr_type = ipv6_addr_type(sk_rcv_saddr6);
1382 int addr_type2 = sk2_rcv_saddr6 ? ipv6_addr_type(sk2_rcv_saddr6) : IPV6_ADDR_MAPPED;
1383
1384 if (!sk2_rcv_saddr && !sk_ipv6only)
1385 return 1;
1386
1387 if (addr_type2 == IPV6_ADDR_ANY &&
1388 !(sk2_ipv6only && addr_type == IPV6_ADDR_MAPPED))
1389 return 1;
1390
1391 if (addr_type == IPV6_ADDR_ANY &&
1392 !(sk_ipv6only && addr_type2 == IPV6_ADDR_MAPPED))
1393 return 1;
1394
1395 if (sk2_rcv_saddr6 &&
1396 ipv6_addr_equal(sk_rcv_saddr6, sk2_rcv_saddr6))
1397 return 1;
1398
1399 if (addr_type == IPV6_ADDR_MAPPED &&
1400 !sk2_ipv6only &&
1401 (!sk2_rcv_saddr || !sk_rcv_saddr || sk_rcv_saddr == sk2_rcv_saddr))
1402 return 1;
1403
1404 return 0;
1405}
1406
1407/* Gets referenced address, destroys ifaddr */ 1373/* Gets referenced address, destroys ifaddr */
1408 1374
1409static void addrconf_dad_stop(struct inet6_ifaddr *ifp) 1375static void addrconf_dad_stop(struct inet6_ifaddr *ifp)