cvs commit: src/sys/netinet6 in6_src.c

Hajimu UMEMOTO ume at
Wed Aug 17 17:47:08 GMT 2005


>>>>> On Wed, 17 Aug 2005 13:18:25 -0400
>>>>> John Baldwin <jhb at> said:

jhb> Thanks.  I see that you still kept the mutex and and properly lock both the sx 
jhb> and mutex when making updates, so it seems it is on purpose.  The one place 
jhb> that doesn't use the sx lock is lookup_addrsel_policy() which is called from 
jhb> in6_selectsrc().  I guess it is not ok to sleep in that function and that is 
jhb> why you don't use the sx lock in that one place?

Because, lookup_addrsel_policy() is protected by mutex lock.
add_addrsel_policyent() and delete_addrsel_policyent() do update the
tailq.  Both of the two functions are also protected by mutex.  So, I
tought that lookup_addrsel_policy() doesn't need sx lock.
I tried to stop using of mutex locks and used only sx locks, as learn
by mistake.  It ended up with exclusive lock error between INP_LOCK.
So, I avoided to use sx lock in lookup_addrsel_policy().
Am I something wrong?


Hajimu UMEMOTO @ Internet Mutual Aid Society Yokohama, Japan
ume at  ume@{,jp.}

More information about the cvs-src mailing list