Re: [Linuxptp-devel] [PATCH 03/11] synce4l: add esmc_socket interface
PTP IEEE 1588 stack for Linux
Brought to you by:
rcochran
From: Michalik, M. <mic...@in...> - 2022-05-04 14:05:22
|
Hi Miroslav, Great catches - appreciate that. > > -----Original Message----- > From: Miroslav Lichvar <mli...@re...> > Sent: Tuesday, May 3, 2022 11:22 AM > To: Kubalewski, Arkadiusz <ark...@in...> > Cc: Kwapulinski, Piotr <pio...@in...>; Sawula, Andrzej <and...@in...>; lin...@li...; Gerasymenko, Anatolii <ana...@in...> > 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 |