linuxptp: Upgrade to v1.9 5867/head
authorWojciech Dubowik <klute99@gmail.com>
Tue, 24 Jan 2017 15:37:17 +0000 (16:37 +0100)
committerWojciech Dubowik <Wojciech.Dubowik@neratec.com>
Tue, 3 Apr 2018 07:13:01 +0000 (09:13 +0200)
Plus one upstream fix.

Signed-off-by: Wojciech Dubowik <klute99@gmail.com>
net/linuxptp/Makefile
net/linuxptp/patches/001-musl-fix.patch [deleted file]
net/linuxptp/patches/002-netdb_fix.patch [deleted file]
net/linuxptp/patches/030-upstream.patch [new file with mode: 0644]

index 1d84748feffccda0a59f9562bedba0736ce6af90..cdd91866aefd465bbc991cddd45056b775bcad80 100644 (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
diff --git a/net/linuxptp/patches/001-musl-fix.patch b/net/linuxptp/patches/001-musl-fix.patch
deleted file mode 100644 (file)
index b79a84b..0000000
+++ /dev/null
@@ -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"
diff --git a/net/linuxptp/patches/002-netdb_fix.patch b/net/linuxptp/patches/002-netdb_fix.patch
deleted file mode 100644 (file)
index 2535568..0000000
+++ /dev/null
@@ -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
-
diff --git a/net/linuxptp/patches/030-upstream.patch b/net/linuxptp/patches/030-upstream.patch
new file mode 100644 (file)
index 0000000..bdb8fb7
--- /dev/null
@@ -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
+