From e484bad72adaacd8f128f58fa8806c9cd495f5aa Mon Sep 17 00:00:00 2001 From: Miroslav Lichvar Date: Wed, 20 Mar 2024 11:30:23 +0100 Subject: [PATCH] allow old syntax of SET SUBSCRIBE_EVENTS_NP command (RHEL-29738) Resolves: RHEL-29738 --- linuxptp-subscribe.patch | 26 ++++++++++++++++++++++++++ linuxptp.spec | 2 ++ 2 files changed, 28 insertions(+) create mode 100644 linuxptp-subscribe.patch diff --git a/linuxptp-subscribe.patch b/linuxptp-subscribe.patch new file mode 100644 index 0000000..2bdf033 --- /dev/null +++ b/linuxptp-subscribe.patch @@ -0,0 +1,26 @@ +commit b421a4c66ce636adff150dd1aa8eafa981c2693d +Author: Miroslav Lichvar +Date: Wed Jan 3 14:45:51 2024 +0100 + + pmc: Allow missing values in SUBSCRIBE_EVENTS_NP command. + + Don't require all supported notifications to be specified in the command + for compatibility with older scripts. + + Signed-off-by: Miroslav Lichvar + +diff --git a/pmc_common.c b/pmc_common.c +index 62e34a6..b88cfc2 100644 +--- a/pmc_common.c ++++ b/pmc_common.c +@@ -310,8 +310,8 @@ static void do_set_action(struct pmc *pmc, int action, int index, char *str) + onoff_port_state, + onoff_time_status, + onoff_parent_data_set); +- if (cnt != 4) { +- fprintf(stderr, "%s SET needs 4 values\n", ++ if (cnt < 2) { ++ fprintf(stderr, "%s SET needs at least 2 values\n", + idtab[index].name); + break; + } diff --git a/linuxptp.spec b/linuxptp.spec index 77cbc19..9fb5245 100644 --- a/linuxptp.spec +++ b/linuxptp.spec @@ -29,6 +29,8 @@ Source22: linuxptp.te # limit unicast message rate per address and grant duration Patch1: linuxptp-ucastrate.patch +# allow old syntax of SET SUBSCRIBE_EVENTS_NP command +Patch2: linuxptp-subscribe.patch BuildRequires: gcc gcc-c++ make systemd