Hi Miroslav,

Great catches - appreciate that.

> 
> -----Original Message-----
> From: Miroslav Lichvar <mlich...@redhat.com> 
> Sent: Tuesday, May 3, 2022 11:22 AM
> To: Kubalewski, Arkadiusz <arkadiusz.kubalew...@intel.com>
> Cc: Kwapulinski, Piotr <piotr.kwapulin...@intel.com>; Sawula, Andrzej 
> <andrzej.saw...@intel.com>; linuxptp-devel@lists.sourceforge.net; 
> Gerasymenko, Anatolii <anatolii.gerasyme...@intel.com>
> Subject: Re: [Linuxptp-devel] [PATCH 03/11] synce4l: add esmc_socket interface
> 
> On Mon, May 02, 2022 at 11:05:57AM +0200, Arkadiusz Kubalewski wrote:
> > Add interface for sending and receiving ESMC frames.
> > Ethernet Synchronization Messaging Channel (ESMC) requires
> > to operate on multicast raw L2 socket. This patch adds features
> > to open socket, send and receive ESMC frames.
> 
> > +++ b/esmc_socket.c
> > @@ -0,0 +1,111 @@
> > +/* SPDX-License-Identifier: GPL-2.0-only */
> 
> linuxptp is GPLv2+, so I think the new code should be submitted under
> the same or at least compatible license to not build binaries with
> different licenses.
> 

It makes sense - thanks. We will fix it.

> > +int recv_raw_esmc_frame(int socket, void *buff)
> > +{
> > +   return recv(socket, buff, ETH_DATA_LEN, 0);
> > +}
> 
> This looks dangerous to me. I'd suggest to add the length of the
> buffer as an argument, or maybe pass it as esmc_data and sizeof the
> data field.
> 

Thanks for noticing, we will work on that in the next version.

> -- 
> Miroslav Lichvar

Best regards,
MM


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

Reply via email to