On Fri, May 12, 2017 at 12:46:45PM +0200, Morten Flå wrote:
> In port.c:2259 we receive a packet, and the packet is rightly tagged
> as a management msg type in the common message header, and we're thus
> forwarded to the clock_manage function.

Ok, so the packet is a management message...

> In the clock_manage function there is no check on what the TLV type
> is. It's just assumed that the TLV type is 1, and thus the packet is
> incorrectly parsed.

and there is no need to check the TLV type after that.  According to
1588, management messages may have zero or one TLV (15.4.1.7), and
Table 38 makes it clear that only management TLVs are allowed.

For example:

GET action requires a single management TLV.

COMMAND action requires the "managementId field" to be set.
 
> Below is a snippet of the packet. PTP payload starts at 0x2A.
> 
> 0000   01 00 5e 00 01 81 ec 46 70 00 bf 9a 08 00 45 00  ..^....Fp.....E.
> 0010   00 80 2a 93 40 00 05 11 ba d9 ac 1b 02 64 e0 00  ..*.@........d..
> 0020   01 81 01 40 01 40 00 6c c6 e5 0d 02 00 64 00 00  ...@.@.l.....d..

Here we have ......................... ^^
   messageId: Management Message (0x0d)

> 0030   00 00 00 00 00 00 00 00 00 00 00 00 00 00 ec 46  ...............F
> 0040   70 ff fe 00 bf 9a 00 01 74 c8 04 7f ff ff ff ff  p.......t.......
> 0050   ff ff ff ff ff ff 01 01 03 00 00 03 00 30 68 97  .............0h.

and then ....................... ^^
   action: COMMAND (3)

followed by .......................... ^^ ^^
   tlvType: Organization extension (3)

That is just plain wrong.  The correct way to encode a vendor specific
management action is to use a managementId in range 0xC000-DFFF (Table 40).

For a correct example of the Organization extension, see sections

     10.5.4  Signaling message
   11.4.4.3  Follow_Up information TLV
  E.5.2.1.1  CSN TLV  (Follow_Up)

in IEEE 802.1AS-2011.  Notice how none of the those TLVs appear on
management messages.

Thanks,
Richard


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Linuxptp-users mailing list
Linuxptp-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxptp-users

Reply via email to