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
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 v2 2/2] UDS: allow specifying different file mode for the read-only socket.
This is a followup to the previous attempt at allowing to specify file mode of the UDS sockets. The v1 patch did not allow to specify different file modes for the RW and RO sockets, which seems like an essential option for me. 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. Best regards, Martin smime.p7s Description: Elektronicky podpis S/MIME ___ Linuxptp-devel mailing list Linuxptp-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linuxptp-devel