On Thu, Nov 17, 2022 at 07:38:02PM +0100, luigi.mantell...@gmail.com wrote:

> Suppose to have the PortNumber_a=0x1234 and PortNumber_b=4512. On a
> LittleEndian CPU, you will have the following memory streams:
> 
> a) 0x34 0x12
> b) 0x12 0x45
> 
> Using a raw memory compare the a) will be erroneously evaluated great
> than b). 
> 
> Comparing, instead the PortNumber considering the HOST endianness you
> will have the expected result.
> 
> The Network order is not meaningful because the struct has been already
> translated to HOST's network order.

This explanation is good.  It belongs in the commit message.

> I'm sorry but I still think that we have bug here.

Yes, please update the commit message in your patch.

A good commit message has three parts:

1. Background and Context (In this case, explain how endianness is
   handles in the existing code base)

2. Problem

3. Solution

That means your commit message must have at least three complete
sentences.

Thanks,
Richard


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

Reply via email to