History log of /freebsd-10-stable/sys/netinet6/nd6.c
Revision Date Author Comments
# 303458 28-Jul-2016 sbruno

MFC r296063 r297397 r299213

296063:
Lock the NDP default router list and count defrouter references.

This addresses a number of race conditions that can cause crashes as a
result of unsynchronized access to the list.

297397
Modify nd6_llinfo_timer() to acquire the nd6 lock before the LLE lock.

When expiring a neighbour cache entry we may need to look up the associated
default router, which requires the nd6 read lock. To avoid an LOR, the nd6
lock should be acquired first.

299213
Clean up callers of nd6_prelist_add().

nd6_prelist_add() sets *newp if and only if it is successful, so there's no
need for code that handles the case where the return value is 0 and
*newp == NULL. Fix some style bugs in nd6_prelist_add() while here.

Submitted by: Jason Wolfe <j@nitrology.com>


# 299145 05-May-2016 markj

MFC r295583, r295584, r295729, r295730:
NDP code cleanup changes.

MFC r295732:
Fix an IPv6 DAD reference count leak.


# 299014 03-May-2016 markj

MFC r295575, r295576, r295578, r295579, r295580:
Various NDP cleanups. No functional change intended.


# 292566 21-Dec-2015 kp

MFC r292219:

inet6: Do not assume every interface has ip6 enabled.

Certain interfaces (e.g. pfsync0) do not have ip6 addresses (in other words,
ifp->if_afdata[AF_INET6] is NULL). Ensure we don't panic when the MTU is
updated.

pfsync interfaces will never have ip6 support, because it's explicitly disabled
in in6_domifattach().

PR: 205194


# 290348 03-Nov-2015 hrs

MFC r288600:

- Schedule DAD for IN6_IFF_TENTATIVE addresses in nd6_timer(). This
catches cases that DAD probes cannot be sent because of
IFF_UP && !IFF_DRV_RUNNING.

- nd6_dad_starttimer() now calls nd6_dad_ns_output(), instead of
calling it before nd6_dad_starttimer().

- Do not release an entry in dadq when a duplicate entry is being
added.


# 287733 13-Sep-2015 hrs

MFC 287095, 287610, 287611, 287617:

Remove obsolete API (SIOCGDRLST_IN6 and SIOCGPRLST_IN6) support.


# 282622 08-May-2015 hiren

MFC r261708, r261847, r268525, r274316, r274347, r275593,
r276844, r276847, r279531, r279559, r279564, r279676

A bunch of IPv6 fixes by melifaro, hrs and ae

Major changes:
Simplify nd6_output_lle()
Add refcounting to DAD and fix races and other errors
Implement Enhanced DAD algorithm for IPv6

Suggested by: ae
Tested by: Jason Wolfe <j at nitrology.com>
Sponsored by: Limelight Networks


# 282445 05-May-2015 markj

MFC r281483:
Fix a possible refcount leak in regen_tmpaddr().


# 281868 22-Apr-2015 ae

MFC r274988 (with modification):
Skip L2 addresses lookups for tunneling interfaces.

PR: 197286


# 278801 15-Feb-2015 rrs

MFC of r278472
This fixes a bug in the way that the LLE timers for nd6
and arp were being used. They basically would pass in the
mutex to the callout_init. Because they used this method
to the callout system, it was possible to "stop" the callout.
When flushing the table and you stopped the running callout, the
callout_stop code would return 1 indicating that it was going
to stop the callout (that was about to run on the callout_wheel blocked
by the function calling the stop). Now when 1 was returned, it would
lower the reference count one extra time for the stopped timer, then
a few lines later delete the memory. Of course the callout_wheel was
stuck in the lock code and would then crash since it was accessing
freed memory. By using callout_init(c, 1) we always get a 0 back
and the reference counting bug does not rear its head. We do have
to make a few adjustments to the callouts themselves though to make
sure it does the proper thing if rescheduled as well as gets the lock.

Sponsored by: Netflix Inc.


# 268052 30-Jun-2014 ume

MFC r267801: Make nd6_gctimer tunable.


# 261716 10-Feb-2014 ae

MFC r261400:
Take exclusive lock only when lle isn't NULL. We don't need write access
to lle in most cases.

MFC r261583:
Unlock entry before retry.

Sponsored by: Yandex LLC


# 260504 10-Jan-2014 ae

MFC r260151 (by adrian):
Use an RLOCK here instead of an RWLOCK - matching all the other calls
to lla_lookup().

This drastically reduces the very high lock contention when doing parallel
TCP throughput tests (> 1024 sockets) with IPv6.

MFC r260187:
lla_lookup() does modification only when LLE_CREATE is specified.
Thus we can use IF_AFDATA_RLOCK() instead of IF_AFDATA_LOCK() when doing
lla_lookup() without LLE_CREATE flag.

MFC r260217:
Add IF_AFDATA_WLOCK_ASSERT() in case lla_lookup() is called with
LLE_CREATE flag.


# 287733 13-Sep-2015 hrs

MFC 287095, 287610, 287611, 287617:

Remove obsolete API (SIOCGDRLST_IN6 and SIOCGPRLST_IN6) support.


# 282622 08-May-2015 hiren

MFC r261708, r261847, r268525, r274316, r274347, r275593,
r276844, r276847, r279531, r279559, r279564, r279676

A bunch of IPv6 fixes by melifaro, hrs and ae

Major changes:
Simplify nd6_output_lle()
Add refcounting to DAD and fix races and other errors
Implement Enhanced DAD algorithm for IPv6

Suggested by: ae
Tested by: Jason Wolfe <j at nitrology.com>
Sponsored by: Limelight Networks


# 282445 05-May-2015 markj

MFC r281483:
Fix a possible refcount leak in regen_tmpaddr().


# 281868 22-Apr-2015 ae

MFC r274988 (with modification):
Skip L2 addresses lookups for tunneling interfaces.

PR: 197286


# 278801 15-Feb-2015 rrs

MFC of r278472
This fixes a bug in the way that the LLE timers for nd6
and arp were being used. They basically would pass in the
mutex to the callout_init. Because they used this method
to the callout system, it was possible to "stop" the callout.
When flushing the table and you stopped the running callout, the
callout_stop code would return 1 indicating that it was going
to stop the callout (that was about to run on the callout_wheel blocked
by the function calling the stop). Now when 1 was returned, it would
lower the reference count one extra time for the stopped timer, then
a few lines later delete the memory. Of course the callout_wheel was
stuck in the lock code and would then crash since it was accessing
freed memory. By using callout_init(c, 1) we always get a 0 back
and the reference counting bug does not rear its head. We do have
to make a few adjustments to the callouts themselves though to make
sure it does the proper thing if rescheduled as well as gets the lock.

Sponsored by: Netflix Inc.


# 268052 30-Jun-2014 ume

MFC r267801: Make nd6_gctimer tunable.


# 261716 10-Feb-2014 ae

MFC r261400:
Take exclusive lock only when lle isn't NULL. We don't need write access
to lle in most cases.

MFC r261583:
Unlock entry before retry.

Sponsored by: Yandex LLC


# 260504 10-Jan-2014 ae

MFC r260151 (by adrian):
Use an RLOCK here instead of an RWLOCK - matching all the other calls
to lla_lookup().

This drastically reduces the very high lock contention when doing parallel
TCP throughput tests (> 1024 sockets) with IPv6.

MFC r260187:
lla_lookup() does modification only when LLE_CREATE is specified.
Thus we can use IF_AFDATA_RLOCK() instead of IF_AFDATA_LOCK() when doing
lla_lookup() without LLE_CREATE flag.

MFC r260217:
Add IF_AFDATA_WLOCK_ASSERT() in case lla_lookup() is called with
LLE_CREATE flag.