update to 4.0

This commit is contained in:
Miroslav Lichvar 2023-06-12 11:09:19 +02:00
parent 09461321b7
commit 94f3c5c0ee
5 changed files with 10 additions and 75 deletions

6
.gitignore vendored
View File

@ -1,3 +1,3 @@
/linuxptp-3.1.1.tgz /linuxptp-4.0.tgz
/linuxptp-testsuite-ff37e2.tar.gz /linuxptp-testsuite-04397a.tar.gz
/clknetsim-9ed48d.tar.gz /clknetsim-ef2a7a.tar.gz

View File

@ -1,22 +0,0 @@
commit 2c62b9a3d8aa61bbb45a522c47be1ff2261e9b0e
Author: Miroslav Lichvar <mlichvar@redhat.com>
Date: Mon Mar 14 11:40:50 2022 +0100
bash: remove default options for phc2sys
Don't set any options by default for phc2sys to avoid conflict between
-O and -a.
diff --git a/clknetsim.bash b/clknetsim.bash
index becc94d..eed622c 100644
--- a/clknetsim.bash
+++ b/clknetsim.bash
@@ -82,7 +82,7 @@ start_client() {
args+=($opts)
;;
phc2sys)
- args=(-s /dev/ptp0 -O 0 $opts $config)
+ args=($opts $config)
;;
nsm)
args=($opts)

View File

@ -1,37 +0,0 @@
commit 9633ab52460f58c92c6daa35e9d24e4ce9c5ab1c
Author: Miroslav Lichvar <mlichvar@redhat.com>
Date: Tue Feb 23 11:01:43 2021 +0100
sk: Don't return error for zero-length messages.
The recvmsg() call can return zero for a zero-length UDP message, which
should be handled as a bad message and not a fault of the port. This was
addressed in commit 6b61ba29c78e ("Avoid fault when receiving zero
length packets"), but later regressed in commit a6e0b83bd503
("sk: Convey transmit path errors to the caller.").
Signed-off-by: Miroslav Lichvar <mlichvar@redhat.com>
Fixes: a6e0b83bd503 ("sk: Convey transmit path errors to the caller.")
diff --git a/sk.c b/sk.c
index c9ef4d2..8be0708 100644
--- a/sk.c
+++ b/sk.c
@@ -391,7 +391,7 @@ int sk_receive(int fd, void *buf, int buflen,
if (!ts) {
memset(&hwts->ts, 0, sizeof(hwts->ts));
- return cnt < 1 ? -errno : cnt;
+ return cnt < 0 ? -errno : cnt;
}
switch (hwts->type) {
@@ -407,7 +407,7 @@ int sk_receive(int fd, void *buf, int buflen,
hwts->ts = timespec_to_tmv(ts[1]);
break;
}
- return cnt < 1 ? -errno : cnt;
+ return cnt < 0 ? -errno : cnt;
}
int sk_set_priority(int fd, int family, uint8_t dscp)

View File

@ -1,11 +1,11 @@
%global _hardened_build 1 %global _hardened_build 1
%global testsuite_ver ff37e2 %global testsuite_ver 04397a
%global clknetsim_ver 9ed48d %global clknetsim_ver ef2a7a
%global selinuxtype targeted %global selinuxtype targeted
%bcond_without selinux %bcond_without selinux
Name: linuxptp Name: linuxptp
Version: 3.1.1 Version: 4.0
Release: 7%{?dist} Release: 7%{?dist}
Summary: PTP implementation for Linux Summary: PTP implementation for Linux
@ -27,11 +27,6 @@ Source20: linuxptp.fc
Source21: linuxptp.if Source21: linuxptp.if
Source22: linuxptp.te Source22: linuxptp.te
# fix handling of zero-length messages
Patch1: linuxptp-zerolength.patch
# revert phc2sys options needed by the older version of test suite
Patch2: clknetsim-phc2sys.patch
BuildRequires: gcc gcc-c++ make systemd BuildRequires: gcc gcc-c++ make systemd
%{?systemd_requires} %{?systemd_requires}
@ -63,12 +58,10 @@ linuxptp SELinux policy module
%prep %prep
%setup -q -a 10 -a 11 -n %{name}-%{!?gitfullver:%{version}}%{?gitfullver} %setup -q -a 10 -a 11 -n %{name}-%{!?gitfullver:%{version}}%{?gitfullver}
%patch1 -p1 -b .zerolength
mv linuxptp-testsuite-%{testsuite_ver}* testsuite mv linuxptp-testsuite-%{testsuite_ver}* testsuite
mv clknetsim-%{clknetsim_ver}* testsuite/clknetsim mv clknetsim-%{clknetsim_ver}* testsuite/clknetsim
pushd testsuite/clknetsim pushd testsuite/clknetsim
%patch2 -p1 -R -b .phc2sys
popd popd
mkdir selinux mkdir selinux
@ -159,6 +152,7 @@ fi
%{_sbindir}/ptp4l %{_sbindir}/ptp4l
%{_sbindir}/timemaster %{_sbindir}/timemaster
%{_sbindir}/ts2phc %{_sbindir}/ts2phc
%{_sbindir}/tz2alt
%{_mandir}/man5/*.5* %{_mandir}/man5/*.5*
%{_mandir}/man8/*.8* %{_mandir}/man8/*.8*

View File

@ -1,3 +1,3 @@
SHA512 (linuxptp-3.1.1.tgz) = c3c40987fe68480a8473097ebc3c506fb4f8f3b6456bbe637b2b3cb0b3e0182f1513b511fdc04b3607d5f7d8bd1bd22502bb86eb13f9fa4fa63a3331846b33ec SHA512 (linuxptp-4.0.tgz) = 763de5654f0426f2f489223e02fb3dd39a3a830751b366406657efe33bb923b5b38edada7b62de3efed6d257d5d386ece0d42a5eb92da5e5d443eac9b32e105d
SHA512 (linuxptp-testsuite-ff37e2.tar.gz) = 5d5c4ec2a8ff7955b3c5eb75d5cc03fb1d4ef0e973fbf4f988cd3487d3723bfdaf8908c3c6063f9b7ad12fad8b5c117d2fd88df496d31d3e44d8f6a8fdb53d27 SHA512 (linuxptp-testsuite-04397a.tar.gz) = 2a07c24543ce4717a830c9b78934e6de45502dec7cbb01ab24050a0ad856ff417afe23ca2c0fa6392ecee2f223ce48e0a4a184a67633a8701e57c63d2a740c18
SHA512 (clknetsim-9ed48d.tar.gz) = ec35c7ca5ea3d19e8ae7c75854b0954dd6887cc5b93f35a3ee57964ec1bb1d5c9ea429357d634bccf34aafc4999ad0a9ef56e5c1c109c383ff2b3b99042012cc SHA512 (clknetsim-ef2a7a.tar.gz) = 55196099d975d635fcba7dce9e1bc42efe0aee25777c9ff0bc996e300922e70542ea784a78814dc888c2f7f281e9d7db68c893e2d3138e92fbc3fb1e64e7e2b6