Hi, I recently discovered a couple of bugs with ptp4l's config reading code:
First, the default configuration specifies values for two of the power profile options which are out of INT_MAX range: power_profile.2011.grandmasterTimeInaccuracy and power_profile.2017.totalTimeInaccuracy On systems with 32-bit integers, the 0xFFFFFFFF value is out of range, and is not allowed. > 0xFFFFFFFF is an out of range value for option > power_profile.2011.grandmasterTimeInaccuracy at line 44 It seems like fixing this will require adding unsigned support to the config.c I started looking into this but I must have missed something as the initial code I wrote to support this didn't work and it still reported those values as out-of-range... Second, a user reported to me that they had typo'd sanity_freq_limit as: sanity_freq_limit 0200000000 Then the program interprets this as an octal number with the unexpected value of: ptp4l[6627255.634]: config item (null).sanity_freq_limit is 33554432 This appears to be caused by using a base of 0 to strtol which then interprets leading 0 numbers as octal. This is probably done in order to get handling of '0x' prefixed numbers as well, but the leading 0 -> octal interpretation is much less common. The manual page does use several '0x' prefixed values but does not seem to call out octal values or the implicit conversions. Thanks, Jake _______________________________________________ Linuxptp-devel mailing list Linuxptp-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linuxptp-devel