Re: [Linuxptp-devel] [PATCH v2 1/2] UDS: added option to set file mode for the created socket.
On Tue, Apr 12, 2022 at 01:38:17PM +0200, Martin Pecka wrote: > Signed-off-by: Martin Pecka > --- > config.c | 4 > uds.c| 5 ++--- > 2 files changed, 6 insertions(+), 3 deletions(-) > > diff --git a/config.c b/config.c > index 4f3ceb8..b4c16d8 100644 > --- a/config.c > +++ b/config.c > @@ -23,6 +23,7 @@ > #include > #include > #include > +#include > > #include "as_capable.h" > #include "bmc.h" > @@ -33,6 +34,8 @@ > #include "print.h" > #include "util.h" > > +#define UDS_FILEMODE (S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP) /*0660*/ > + > struct interface { > STAILQ_ENTRY(interface) list; > }; > @@ -331,6 +334,7 @@ struct config_item config_tab[] = { > PORT_ITEM_INT("udp6_scope", 0x0E, 0x00, 0x0F), > GLOB_ITEM_STR("uds_address", "/var/run/ptp4l"), > GLOB_ITEM_STR("uds_ro_address", "/var/run/ptp4lro"), > + PORT_ITEM_INT("uds_file_mode", UDS_FILEMODE, 0, 04777), Alphabetical order by label, please. > PORT_ITEM_INT("unicast_listen", 0, 0, 1), > PORT_ITEM_INT("unicast_master_table", 0, 0, INT_MAX), > PORT_ITEM_INT("unicast_req_duration", 3600, 10, INT_MAX), > diff --git a/uds.c b/uds.c > index 641a672..30a0f1e 100644 > --- a/uds.c > +++ b/uds.c > @@ -31,8 +31,6 @@ > #include "transport_private.h" > #include "uds.h" > > -#define UDS_FILEMODE (S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP) /*0660*/ > - > struct uds { > struct transport t; > struct address address; > @@ -58,6 +56,7 @@ static int uds_open(struct transport *t, struct interface > *iface, struct fdarray > char *uds_path = config_get_string(t->cfg, NULL, "uds_address"); > struct uds *uds = container_of(t, struct uds, t); > const char *name = interface_name(iface); > + mode_t file_mode = (mode_t)config_get_int(t->cfg, name, > "uds_file_mode"); Reverse Christmas tree please (IOW place this line as first line of function) > struct sockaddr_un sa; > int fd, err; > Thanks, Richard ___ Linuxptp-devel mailing list Linuxptp-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linuxptp-devel
Re: [Linuxptp-devel] [PATCH] ts2phc: Fix miss typo
On Fri, Mar 18, 2022 at 07:21:26PM +0900, 이강민 wrote: > Fix miss typo of man page. > > Signed-off-by: Kangmin Lee This patch does not apply because of HTML. Please resend using plain text only. Thanks, Richard ___ Linuxptp-devel mailing list Linuxptp-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linuxptp-devel
Re: [Linuxptp-devel] [PATCH v2 2/2] UDS: allow specifying different file mode for the read-only socket.
On Tue, Apr 12, 2022 at 01:38:18PM +0200, Martin Pecka wrote: > diff --git a/ptp4l.8 b/ptp4l.8 > index 71a414c..021dcad 100644 > --- a/ptp4l.8 > +++ b/ptp4l.8 > @@ -648,6 +648,16 @@ management messages, which is restricted to GET actions > and does not forward > messages to other ports. Access to this socket can be given to untrusted > applications for monitoring purposes. The default is /var/run/ptp4lro. > .TP > +.B uds_file_mode > +File mode of the UNIX domain socket used for receiving local management > +messages. The mode should be specified as an octal number, i.e. it > +should start with a 0 literal. The default mode is 0660. This doc should go in patch #1 > +.TP > +.B uds_ro_file_mode > +File mode of the second (read-only) UNIX domain socket used for receiving > +local management messages. The mode should be specified as an octal number, > +i.e. it should start with a 0 literal. The default mode is 0664. > +.TP > .B dscp_event > Defines the Differentiated Services Codepoint (DSCP) to be used for PTP > event messages. Must be a value between 0 and 63. There are several media > diff --git a/transport.c b/transport.c > index 9366fbf..fe4a7c8 100644 > --- a/transport.c > +++ b/transport.c Thanks, Richard ___ Linuxptp-devel mailing list Linuxptp-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linuxptp-devel
Re: [Linuxptp-devel] [PATCH 1/1] TLV management messages need to be aligned to 16 bits.
On Tue, Mar 08, 2022 at 10:55:14PM +0100, Erez Geva wrote: > Add reserved octet to the new port hardware clock structure. > > Signed-off-by: Erez Geva Applied. Thanks, Richard ___ Linuxptp-devel mailing list Linuxptp-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linuxptp-devel
Re: [Linuxptp-devel] [PATCH v3 0/4] port: Cancel unicast service when closing port.
On Sat, Mar 19, 2022 at 10:11:43PM -0400, vincent.cheng...@renesas.com wrote: > From: Vincent Cheng > > ptp4l currently does not cancel unicast service on program exit. > This causes problems for subsequent ptp4l session that is using different > masters. Series applied. Thanks, Richard ___ Linuxptp-devel mailing list Linuxptp-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linuxptp-devel
Re: [Linuxptp-devel] [PATCH] Fix the descriptions of "G.8275.portDS.localPriority" and "G.8275.defaultDS.localPriority" in ptp4l man page.
On Tue, Mar 22, 2022 at 03:01:59AM +, yoshida.t...@fujitsu.com wrote: > The descriptions of "G.8275.portDS.localPriority" and > "G.8275.defaultDS.localPriority" in ptp4l man page says that these options > are only used when "dataset_comparison" is set to "telecom". But the possible > values for "dataset_comparison" are "ieee1588" and "G.8275.x". The valid > value is "G.8275.x" not "telecom". > > Signed-off-by: Tomofumi Yoshida Applied. Thanks, Richard ___ Linuxptp-devel mailing list Linuxptp-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linuxptp-devel
Re: [Linuxptp-devel] [PATCH v2 2/2] UDS: allow specifying different file mode for the read-only socket.
On Tue, Apr 12, 2022 at 01:43:35PM +0200, Martin Pecka wrote: > As discussed on linuxptp-users ("Config section for /var/log/ptp4lro creates > an additional port"), configuring different file modes via port sections in > config file does not work as intended. So I instead chose the way of passing > the required information all the way down to uds_transport_create(), which > is not easy as the differentiation between RW and RO ports lives only in > clock.c, and uds_transport_create() does not have access to either the port > instance or its config. I don't say this solution is nice, but it works. Any > ideas how to make it nicer are welcome. See clock_create() : uds_ifname = config_get_string(config, NULL, "uds_ro_address"); c->uds_ro_if = interface_create(uds_ifname); So all you have to do is look up "uds_ro_address" in uds_open, and if there is a match, then look up the file mode and apply it. Thanks, Richard ___ Linuxptp-devel mailing list Linuxptp-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linuxptp-devel