jamal wrote:
On Tue, 2005-22-11 at 03:56 +0100, Patrick McHardy wrote:
Yes. promote can only be non-NULL if it was set at the time the first
check was performed. If you check twice and it is changed in between
the secondaries will get neither removed nor promoted. In fact,
the first check inside the loop should also happen outside of the
loop so if it changes from 0 to 1 while the loop is running not
half the addresses are removed and then the next one promoted.
Of course, the underlying assumption is that in fact it could happen.
Could it actually happen? Because if that was the case, a lot of code in
the net area would need to be audited and fixed.
I don't see anything preventing it - which would be taking the RTNL
in this case. But I think most code is probably still OK because
in most cases sysctls aren't checked multiple times.
I think i should remove the second check because it is redundant
actually regardless - but if serves the purpose of avoiding a race even
better.
The first one also needs to be moved out of the loop to be complete.
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at http://vger.kernel.org/majordomo-info.html