On Wed, Aug 24, 2022 at 03:57:12PM +0530, SyncMonk Technologies wrote:

> @@ -1595,6 +1611,10 @@ int port_tx_announce(struct port *p, struct address 
> *dst, uint16_t sequence_id)
>  
>       msg->header.flagField[1] = tp.flags;
>  
> +     if (p->state != PS_MASTER && clock_telecom_profile(p->clock)) {
> +             msg->header.flagField[0] |= ALT_MASTER;
> +     }
> +

This is so wrong.

1. When (p->state != PS_MASTER), then the port has no business
   transmitting Announce messages.

2. The ALT_MASTER flag has nothing to do with "clock_telecom_profile()".
   Rather it is an optional part of 1588, independent of any profile.

> @@ -1674,6 +1694,10 @@ int port_tx_sync(struct port *p, struct address *dst, 
> uint16_t sequence_id)
>               msg->header.flagField[0] |= TWO_STEP;
>       }
>  
> +     if (p->state != PS_MASTER && clock_telecom_profile(p->clock)) {
> +             msg->header.flagField[0] |= ALT_MASTER;
> +     }

ditto

> @@ -2455,19 +2513,22 @@ void process_sync(struct port *p, struct ptp_message 
> *m)
>       case PS_DISABLED:
>       case PS_LISTENING:
>       case PS_PRE_MASTER:
> -     case PS_MASTER:
>       case PS_GRAND_MASTER:
>       case PS_PASSIVE:
>               return;
> +     case PS_MASTER:
> +             if (!p->altMaster) {
> +                     return;
> +             }
> +             break;

Seriously.  If port state is PS_MASTER, then it shouldn't process Sync messages!

Thanks,
Richard



_______________________________________________
Linuxptp-devel mailing list
Linuxptp-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxptp-devel

Reply via email to