On Wed, Mar 20, 2019 at 02:44:13PM +0800, Hangbin Liu wrote:
> In logic, when we want to switch phc, we should check if the new phc
> index is valid instead of checking the previous one.
> 
> In reality, if we use linux team interface with activebackup mode. As
> teamd is a userspace tool, it sets the new slave as active port after
> receiving link change message. If we set current active port down and
> another slave up. There is a race that we receive the new slave's link
> up message while active port(ts_index) is still the old one. This means
> we may use a link down interface as ts_index and get phc_index with -1.
> 
> If we update the p->phc_index to -1, there will be no possibility to
> change it back to other value as we swith phc only when p->phc_index >= 0.
> 
> With this fix, we will not switch phc_index until receiving the real
> active port(p->iface->ts_info.phc_index >= 0) update message.
> 
> Reported-by: Miroslav Lichvar <[email protected]>
> Fixes: 536a71031d5c ("ptp4l: use ts label to get ts info")
> Signed-off-by: Hangbin Liu <[email protected]>

Applied.

Thanks,
Richard


_______________________________________________
Linuxptp-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linuxptp-devel

Reply via email to