View | Details | Raw Unified | Return to bug 233283
Collapse All | Expand All

(-)b/sys/netinet6/nd6.c (-1 / +18 lines)
Lines 71-76 __FBSDID("$FreeBSD$"); Link Here
71
#include <netinet/ip6.h>
71
#include <netinet/ip6.h>
72
#include <netinet6/ip6_var.h>
72
#include <netinet6/ip6_var.h>
73
#include <netinet6/scope6_var.h>
73
#include <netinet6/scope6_var.h>
74
#include <netinet6/in6_fib.h>
74
#include <netinet6/nd6.h>
75
#include <netinet6/nd6.h>
75
#include <netinet6/in6_ifattach.h>
76
#include <netinet6/in6_ifattach.h>
76
#include <netinet/icmp6.h>
77
#include <netinet/icmp6.h>
Lines 1377-1384 nd6_is_new_addr_neighbor(const struct sockaddr_in6 *addr, struct ifnet *ifp) Link Here
1377
int
1378
int
1378
nd6_is_addr_neighbor(const struct sockaddr_in6 *addr, struct ifnet *ifp)
1379
nd6_is_addr_neighbor(const struct sockaddr_in6 *addr, struct ifnet *ifp)
1379
{
1380
{
1381
	struct nhop6_basic nh6;
1380
	struct llentry *lle;
1382
	struct llentry *lle;
1381
	int rc = 0;
1383
	int fibnum, rc = 0;
1382
1384
1383
	IF_AFDATA_UNLOCK_ASSERT(ifp);
1385
	IF_AFDATA_UNLOCK_ASSERT(ifp);
1384
	if (nd6_is_new_addr_neighbor(addr, ifp))
1386
	if (nd6_is_new_addr_neighbor(addr, ifp))
Lines 1394-1399 nd6_is_addr_neighbor(const struct sockaddr_in6 *addr, struct ifnet *ifp) Link Here
1394
		rc = 1;
1396
		rc = 1;
1395
	}
1397
	}
1396
	IF_AFDATA_RUNLOCK(ifp);
1398
	IF_AFDATA_RUNLOCK(ifp);
1399
1400
	/*
1401
	 * Check that address is in the routing table.
1402
	 * This covers non-prefix on-link INET6 routes.
1403
	 */
1404
	if (rc == 0) {
1405
		fibnum = V_rt_add_addr_allfibs ? RT_DEFAULT_FIB: ifp->if_fib;
1406
		rc = fib6_lookup_nh_basic(fibnum,
1407
		    &addr->sin6_addr, 0, 0, 0, &nh6);
1408
		if (rc || (nh6.nh_flags & NHF_GATEWAY) || ifp != nh6.nh_ifp)
1409
			rc = 0;
1410
		else
1411
			rc = 1;
1412
	}
1413
1397
	return (rc);
1414
	return (rc);
1398
}
1415
}
1399
1416

Return to bug 233283