]> CyberLeo.Net >> Repos - FreeBSD/stable/10.git/commit
MFC of r278472
authorrrs <rrs@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Sun, 15 Feb 2015 13:57:44 +0000 (13:57 +0000)
committerrrs <rrs@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Sun, 15 Feb 2015 13:57:44 +0000 (13:57 +0000)
commit7b5e0ee21f62d6b17404a2f3bf581f3bad567c55
treebd7dfda1515631e8e1f2de4b3f4b52a79075d78a
parent036ebf4f15985331e6a41e7f4108bfe0ff8eaa2d
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.

git-svn-id: svn://svn.freebsd.org/base/stable/10@278801 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
sys/netinet/if_ether.c
sys/netinet/in.c
sys/netinet6/in6.c
sys/netinet6/nd6.c