On Tue, Mar 08, 2022 at 10:55:14PM +0100, Erez Geva wrote:
> Add reserved octet to the new port hardware clock structure.

> @@ -354,6 +354,7 @@ struct port_hwclock_np {
>       struct PortIdentity portIdentity;
>       Integer32 phc_index;
>       UInteger8 flags;
> +     uint8_t reserved;
>  } PACKED;

FWIW, there is a code in the {clock,port}_management_fill_response
functions that pads the TLVs to 16 bits:

        if (datalen % 2) {                                                      
                                                        
                tlv->data[datalen] = 0;                                         
                                                        
                datalen++;                                                      
                                                        
        }                                                                       
                                                        

If we require the TLV declarations to be correctly padded, it might be
a good idea to replace this code with an assertion or return error to
catch bugs when new TLVs are introduced.

-- 
Miroslav Lichvar



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

Reply via email to