Browse Source

Merge pull request #5867 from wodu/linuxptp_maint

linuxptp: Upgrade to v1.9
lilik-openwrt-22.03
Hannu Nyman 7 years ago
committed by GitHub
parent
commit
d6ac302d08
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 39 additions and 100 deletions
  1. +2
    -2
      net/linuxptp/Makefile
  2. +0
    -21
      net/linuxptp/patches/001-musl-fix.patch
  3. +0
    -77
      net/linuxptp/patches/002-netdb_fix.patch
  4. +37
    -0
      net/linuxptp/patches/030-upstream.patch

+ 2
- 2
net/linuxptp/Makefile View File

@ -8,13 +8,13 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=linuxptp
PKG_VERSION:=1.8
PKG_VERSION:=1.9
PKG_RELEASE:=4
PKG_MAINTAINER:=Wojciech Dubowik <Wojciech.Dubowik@neratec.com>
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tgz
PKG_SOURCE_URL:=@SF/$(PKG_NAME)/v$(PKG_VERSION)
PKG_HASH:=fa8e00f6ec73cefa7bb313dce7f60dfe5eb9e2bde3353594e9ac18edc93e5165
PKG_MD5SUM:=335d60c00cd5b2d5aaaa8b2d5cd921bf
PKG_LICENSE:=GPL-2.0
PKG_LICENSE_FILES:=COPYING


+ 0
- 21
net/linuxptp/patches/001-musl-fix.patch View File

@ -1,21 +0,0 @@
--- a/raw.c
+++ b/raw.c
@@ -20,7 +20,6 @@
#include <fcntl.h>
#include <linux/filter.h>
#include <linux/if_ether.h>
-#include <net/ethernet.h>
#include <net/if.h>
#include <netinet/in.h>
#include <netpacket/packet.h>
--- a/util.h
+++ b/util.h
@@ -20,6 +20,8 @@
#ifndef HAVE_UTIL_H
#define HAVE_UTIL_H
+#include <time.h>
+
#include "ddt.h"
#include "ether.h"

+ 0
- 77
net/linuxptp/patches/002-netdb_fix.patch View File

@ -1,77 +0,0 @@
From 60db5d0b0fd8be9afede7e8a14e708f5429f2023 Mon Sep 17 00:00:00 2001
From: Florian Fainelli <f.fainelli@gmail.com>
Date: Sun, 7 May 2017 11:16:06 -0700
Subject: [PATCH] udp: Avoid including netdb.h
netdb.h pulls in a large chain of include files:
rpc/netdb.h
rpc/types.h
rpc/types.h re-defines TRUE/FALSE and does it in this way:
#ifndef FALSE
# define FALSE (0)
#endif
#ifndef TRUE
# define TRUE (1)
#endif
And this later causes build problems that appear in this way:
mipsel-linux-gnu-gcc -Wall -DVER=1.8 -D_GNU_SOURCE -DHAVE_CLOCK_ADJTIME
-DHAVE_POSIX_SPAWN -DHAVE_ONESTEP_SYNC -Os -pipe -mno-branch-likely
-mips32r2 -mtune=24kc -fno-caller-saves -Wno-unused-result
-D_FORTIFY_SOURCE=1 -Wl,-z,now -Wl,-z,relro
-I/home/florian/dev/openwrt/trunk/staging_dir/target-mipsel-unknown-linux-gnu_glibc/usr/include
-I/home/florian/dev/openwrt/trunk/staging_dir/target-mipsel-unknown-linux-gnu_glibc/include
-I/home/florian/dev/toolchains/stbgcc-4.8-1.5/usr/include
-I/home/florian/dev/toolchains/stbgcc-4.8-1.5/include
-DHAVE_CLOCK_ADJTIME -DHAVE_POSIX_SPAWN -DHAVE_ONESTEP_SYNC -c -o
udp.o udp.c
In file included from
/home/florian/dev/openwrt/trunk/staging_dir/target-mipsel-unknown-linux-gnu_glibc/usr/include/rpc/netdb.h:45:0,
from
/home/florian/dev/toolchains/stbgcc-4.8-1.5/mipsel-linux-gnu/sys-root/usr/include/netdb.h:32,
from udp.c:23:
pdt.h:25:7: error: expected identifier before '(' token
enum {FALSE, TRUE};
^
<builtin>: recipe for target 'udp.o' failed
Upon inspection, it does not appear that netdb.h is providing any useful
definition or declaration, so let's just remove its inclusion.
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
---
udp.c | 1 -
udp6.c | 1 -
2 files changed, 2 deletions(-)
diff --git a/udp.c b/udp.c
index 6dabc31836fe..530a2ee3748d 100644
--- a/udp.c
+++ b/udp.c
@@ -20,7 +20,6 @@
#include <errno.h>
#include <fcntl.h>
#include <net/if.h>
-#include <netdb.h>
#include <netinet/in.h>
#include <stdio.h>
#include <stdlib.h>
diff --git a/udp6.c b/udp6.c
index c229cac0c41c..89e27bf9e863 100644
--- a/udp6.c
+++ b/udp6.c
@@ -20,7 +20,6 @@
#include <errno.h>
#include <fcntl.h>
#include <net/if.h>
-#include <netdb.h>
#include <netinet/in.h>
#include <stdio.h>
#include <stdlib.h>
--
2.11.0

+ 37
- 0
net/linuxptp/patches/030-upstream.patch View File

@ -0,0 +1,37 @@
From d14f11fd329a7da94c0d0190a169f743eb91031b Mon Sep 17 00:00:00 2001
From: Richard Cochran <richardcochran@gmail.com>
Date: Mon, 2 Apr 2018 20:19:51 -0700
Subject: [PATCH] msg: Append multiple TLVs correctly.
The logic that adds TLVs to the end of a message mixes up the 'L'
length in "TLV" with the total TLV length. As a result, the second
and subsequent TLVs will corrupt the previous TLV in the buffer. This
patch corrects the code to find the correct offset for the second and
following appended TLVs.
Note that the stack does not currently trigger this latent bug because
only single TLVs are appended.
Fixes: 4a8877f90462 ("msg: Introduce method for appending multiple TLVs on transmit.")
Signed-off-by: Richard Cochran <richardcochran@gmail.com>
---
msg.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/msg.c b/msg.c
index b7e1053..c004568 100644
--- a/msg.c
+++ b/msg.c
@@ -151,6 +151,8 @@ static struct tlv_extra *msg_tlv_prepare(struct ptp_message *msg, int length)
tmp = TAILQ_LAST(&msg->tlv_list, tlv_list);
if (tmp) {
ptr = (uint8_t *) tmp->tlv;
+ ptr += sizeof(tmp->tlv->type);
+ ptr += sizeof(tmp->tlv->length);
ptr += tmp->tlv->length;
}
--
2.7.4

Loading…
Cancel
Save