Deleted Added
full compact
in6.c (108033) in6.c (108172)
1/* $FreeBSD: head/sys/netinet6/in6.c 108033 2002-12-18 11:46:59Z hsu $ */
1/* $FreeBSD: head/sys/netinet6/in6.c 108172 2002-12-22 05:35:03Z hsu $ */
2/* $KAME: in6.c,v 1.259 2002/01/21 11:37:50 keiichi Exp $ */
3
4/*
5 * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
6 * All rights reserved.
7 *
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions

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

1968 return(NULL);
1969 }
1970
1971 /*
1972 * We search for all addresses on all interfaces from the beginning.
1973 * Comparing an interface with the outgoing interface will be done
1974 * only at the final stage of tiebreaking.
1975 */
2/* $KAME: in6.c,v 1.259 2002/01/21 11:37:50 keiichi Exp $ */
3
4/*
5 * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
6 * All rights reserved.
7 *
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions

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

1968 return(NULL);
1969 }
1970
1971 /*
1972 * We search for all addresses on all interfaces from the beginning.
1973 * Comparing an interface with the outgoing interface will be done
1974 * only at the final stage of tiebreaking.
1975 */
1976 IFNET_RLOCK();
1976 for (ifp = TAILQ_FIRST(&ifnet); ifp; ifp = TAILQ_NEXT(ifp, if_list))
1977 {
1978 /*
1979 * We can never take an address that breaks the scope zone
1980 * of the destination.
1981 */
1982 if (in6_addr2scopeid(ifp, dst) != in6_addr2scopeid(oifp, dst))
1983 continue;

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

2199
2200 replace:
2201 ifa_best = (struct in6_ifaddr *)ifa;
2202 blen = tlen >= 0 ? tlen :
2203 in6_matchlen(IFA_IN6(ifa), dst);
2204 best_scope = in6_addrscope(&ifa_best->ia_addr.sin6_addr);
2205 }
2206 }
1977 for (ifp = TAILQ_FIRST(&ifnet); ifp; ifp = TAILQ_NEXT(ifp, if_list))
1978 {
1979 /*
1980 * We can never take an address that breaks the scope zone
1981 * of the destination.
1982 */
1983 if (in6_addr2scopeid(ifp, dst) != in6_addr2scopeid(oifp, dst))
1984 continue;

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

2200
2201 replace:
2202 ifa_best = (struct in6_ifaddr *)ifa;
2203 blen = tlen >= 0 ? tlen :
2204 in6_matchlen(IFA_IN6(ifa), dst);
2205 best_scope = in6_addrscope(&ifa_best->ia_addr.sin6_addr);
2206 }
2207 }
2208 IFNET_RUNLOCK();
2207
2208 /* count statistics for future improvements */
2209 if (ifa_best == NULL)
2210 ip6stat.ip6s_sources_none++;
2211 else {
2212 if (oifp == ifa_best->ia_ifp)
2213 ip6stat.ip6s_sources_sameif[best_scope]++;
2214 else

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

2380 * to in6_maxmtu.
2381 */
2382void
2383in6_setmaxmtu()
2384{
2385 unsigned long maxmtu = 0;
2386 struct ifnet *ifp;
2387
2209
2210 /* count statistics for future improvements */
2211 if (ifa_best == NULL)
2212 ip6stat.ip6s_sources_none++;
2213 else {
2214 if (oifp == ifa_best->ia_ifp)
2215 ip6stat.ip6s_sources_sameif[best_scope]++;
2216 else

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

2382 * to in6_maxmtu.
2383 */
2384void
2385in6_setmaxmtu()
2386{
2387 unsigned long maxmtu = 0;
2388 struct ifnet *ifp;
2389
2390 IFNET_RLOCK();
2388 for (ifp = TAILQ_FIRST(&ifnet); ifp; ifp = TAILQ_NEXT(ifp, if_list))
2389 {
2390 if ((ifp->if_flags & IFF_LOOPBACK) == 0 &&
2391 nd_ifinfo[ifp->if_index].linkmtu > maxmtu)
2392 maxmtu = nd_ifinfo[ifp->if_index].linkmtu;
2393 }
2391 for (ifp = TAILQ_FIRST(&ifnet); ifp; ifp = TAILQ_NEXT(ifp, if_list))
2392 {
2393 if ((ifp->if_flags & IFF_LOOPBACK) == 0 &&
2394 nd_ifinfo[ifp->if_index].linkmtu > maxmtu)
2395 maxmtu = nd_ifinfo[ifp->if_index].linkmtu;
2396 }
2397 IFNET_RUNLOCK();
2394 if (maxmtu) /* update only when maxmtu is positive */
2395 in6_maxmtu = maxmtu;
2396}
2397
2398/*
2399 * Convert sockaddr_in6 to sockaddr_in. Original sockaddr_in6 must be
2400 * v4 mapped addr or v4 compat addr
2401 */

--- 54 unchanged lines hidden ---
2398 if (maxmtu) /* update only when maxmtu is positive */
2399 in6_maxmtu = maxmtu;
2400}
2401
2402/*
2403 * Convert sockaddr_in6 to sockaddr_in. Original sockaddr_in6 must be
2404 * v4 mapped addr or v4 compat addr
2405 */

--- 54 unchanged lines hidden ---