added my Recipes

This commit is contained in:
2024-07-11 14:16:35 +02:00
parent 38bc4f53ac
commit 09b621d929
7118 changed files with 525762 additions and 3 deletions

View File

@@ -0,0 +1,34 @@
From 5f9e80acb0a1ac399839bf160e43f6120c4b5128 Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Tue, 18 Oct 2016 23:49:09 +0000
Subject: [PATCH] Fix build errors with clang
| ../../../../../../../workspace/sources/lowpan-tools/src/coordinator.c:313:50: error: format specifies type 'unsigned char' but the argument has type 'int' [-Werror,-Wformat]
| fprintf(stderr, "Opt: %c (%hhx)\n", (char)opt, opt);
| ~~~~ ^~~
| %x
| 1 error generated.
Upstream-Status: Pending
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
src/coordinator.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/coordinator.c b/src/coordinator.c
index c139aae..f0de6d2 100644
--- a/src/coordinator.c
+++ b/src/coordinator.c
@@ -310,7 +310,7 @@ int main(int argc, char **argv)
#else
opt = getopt(argc, argv, "l:f:d:m:n:i:s:p:c:hv");
#endif
- fprintf(stderr, "Opt: %c (%hhx)\n", opt, opt);
+ fprintf(stderr, "Opt: %c (%hhx)\n", opt, (unsigned char)opt);
if (opt == -1)
break;
--
1.9.1

View File

@@ -0,0 +1,139 @@
From 58b6d9a2efe101e5b80fd708e6f84c7ca779ce93 Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Thu, 31 May 2018 20:27:43 -0700
Subject: [PATCH] Fix potential string truncation in strncpy()
GCC 8 complains about the string truncation during copy
error: 'strncpy' specified bound 16 equals destination size
Upstream-Status: Inappropriate [depricated component]
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
tests/listen-packet.c | 3 ++-
tests/listen.c | 3 ++-
tests/test2.c | 4 ++--
tests/test3.c | 3 ++-
tests/test4.c | 3 ++-
tests/test5.c | 3 ++-
tests/test6.c | 3 ++-
tests/test7.c | 3 ++-
8 files changed, 16 insertions(+), 9 deletions(-)
diff --git a/tests/listen-packet.c b/tests/listen-packet.c
index e40af81..eae0c71 100644
--- a/tests/listen-packet.c
+++ b/tests/listen-packet.c
@@ -50,7 +50,8 @@ int main(int argc, char **argv) {
return 1;
}
- strncpy(req.ifr_name, iface, IF_NAMESIZE);
+ strncpy(req.ifr_name, iface, IF_NAMESIZE - 1);
+ req.ifr_name[IF_NAMESIZE - 1] = '\0';
ret = ioctl(sd, SIOCGIFINDEX, &req);
if (ret < 0)
perror("ioctl: SIOCGIFINDEX");
diff --git a/tests/listen.c b/tests/listen.c
index 75c320b..5ce1ed9 100644
--- a/tests/listen.c
+++ b/tests/listen.c
@@ -47,7 +47,8 @@ int main(int argc, char **argv) {
return 1;
}
- strncpy(req.ifr_name, iface, IFNAMSIZ);
+ strncpy(req.ifr_name, iface, IFNAMSIZ - 1);
+ req.ifr_name[IF_NAMESIZE - 1] = '\0';
ret = ioctl(sd, SIOCGIFHWADDR, &req);
if (ret < 0)
perror("ioctl: SIOCGIFHWADDR");
diff --git a/tests/test2.c b/tests/test2.c
index 58eb74b..5d02838 100644
--- a/tests/test2.c
+++ b/tests/test2.c
@@ -45,8 +45,8 @@ int main(int argc, char **argv) {
perror("socket");
return 1;
}
-
- strncpy(req.ifr_name, argv[1] ?: "wpan0", IF_NAMESIZE);
+ strncpy(req.ifr_name, argv[1] ?: "wpan0", IF_NAMESIZE - 1);
+ req.ifr_name[IF_NAMESIZE - 1] = '\0';
ret = ioctl(sd, SIOCGIFHWADDR, &req);
if (ret < 0)
perror("ioctl: SIOCGIFHWADDR");
diff --git a/tests/test3.c b/tests/test3.c
index fb36627..2f50a5a 100644
--- a/tests/test3.c
+++ b/tests/test3.c
@@ -46,7 +46,8 @@ int main(int argc, char **argv) {
return 1;
}
- strncpy(req.ifr_name, argv[1] ?: "wpan0", IF_NAMESIZE);
+ strncpy(req.ifr_name, argv[1] ?: "wpan0", IF_NAMESIZE - 1);
+ req.ifr_name[IF_NAMESIZE - 1] = '\0';
ret = ioctl(sd, SIOCGIFHWADDR, &req);
if (ret < 0)
perror("ioctl: SIOCGIFHWADDR");
diff --git a/tests/test4.c b/tests/test4.c
index 33c274c..8737149 100644
--- a/tests/test4.c
+++ b/tests/test4.c
@@ -46,7 +46,8 @@ int main(int argc, char **argv) {
return 1;
}
- strncpy(req.ifr_name, argv[1] ?: "wpan0", IF_NAMESIZE);
+ strncpy(req.ifr_name, argv[1] ?: "wpan0", IF_NAMESIZE - 1);
+ req.ifr_name[IF_NAMESIZE - 1] = '\0';
ret = ioctl(sd, SIOCGIFHWADDR, &req);
if (ret < 0)
perror("ioctl: SIOCGIFHWADDR");
diff --git a/tests/test5.c b/tests/test5.c
index 4439dfa..28db562 100644
--- a/tests/test5.c
+++ b/tests/test5.c
@@ -45,7 +45,8 @@ int main(int argc, char **argv) {
return 1;
}
- strncpy(req.ifr_name, argv[1] ?: "wpan0", IF_NAMESIZE);
+ strncpy(req.ifr_name, argv[1] ?: "wpan0", IF_NAMESIZE - 1);
+ req.ifr_name[IF_NAMESIZE - 1] = '\0';
ret = ioctl(sd, SIOCGIFADDR, &req);
if (ret < 0) {
perror("ioctl: SIOCGIFADDR");
diff --git a/tests/test6.c b/tests/test6.c
index e375bfb..ce7de59 100644
--- a/tests/test6.c
+++ b/tests/test6.c
@@ -45,7 +45,8 @@ int main(int argc, char **argv) {
return 1;
}
- strncpy(req.ifr_name, argv[1] ?: "wpan0", IF_NAMESIZE);
+ strncpy(req.ifr_name, argv[1] ?: "wpan0", IF_NAMESIZE - 1);
+ req.ifr_name[IF_NAMESIZE - 1] = '\0';
ret = ioctl(sd, SIOCGIFADDR, &req);
if (ret < 0) {
perror("ioctl: SIOCGIFADDR");
diff --git a/tests/test7.c b/tests/test7.c
index e9a5a55..37da22d 100644
--- a/tests/test7.c
+++ b/tests/test7.c
@@ -58,7 +58,8 @@ int main(int argc, char **argv) {
if (ret)
perror("setsockopt");
- strncpy(req.ifr_name, argv[1] ?: "wpan0", IF_NAMESIZE);
+ strncpy(req.ifr_name, argv[1] ?: "wpan0", IF_NAMESIZE - 1);
+ req.ifr_name[IF_NAMESIZE - 1] = '\0';
ret = ioctl(sd, SIOCGIFHWADDR, &req);
if (ret < 0)
perror("ioctl: SIOCGIFHWADDR");
--
2.17.1

View File

@@ -0,0 +1,32 @@
From a36afac485745cf980fba1809526f2025cb4d101 Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Sun, 23 Apr 2017 00:16:45 -0700
Subject: [PATCH] Remove newline from format line
Fixes
error: '__builtin___snprintf_chk' output truncated before the last format character [-Werror=format-truncation=]
"%02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x\n",
^
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
addrdb/addrdb.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/addrdb/addrdb.c b/addrdb/addrdb.c
index 4bb7f79..05d53f3 100644
--- a/addrdb/addrdb.c
+++ b/addrdb/addrdb.c
@@ -178,7 +178,7 @@ int addrdb_dump_leases(const char *lease_file)
continue;
}
snprintf(hwaddr_buf, sizeof(hwaddr_buf),
- "%02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x\n",
+ "%02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x",
lease->hwaddr[0], lease->hwaddr[1],
lease->hwaddr[2], lease->hwaddr[3],
lease->hwaddr[4], lease->hwaddr[5],
--
2.12.2

View File

@@ -0,0 +1,44 @@
From ab725a3faaeead90ae3c63cbcd370af087c413a5 Mon Sep 17 00:00:00 2001
From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Date: Mon, 27 Mar 2017 17:55:06 -0700
Subject: [PATCH] addrdb/coord-config-parse.y: add missing <time.h> include
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
The %union definition uses the time_t structure. In order to use this
structure, the <time.h> header has to be included. Otherwise, the build
breaks with some C libraries, such as musl:
In file included from coord-config-lex.l:23:0:
coord-config-parse.y:107:2: error: unknown type name time_t
time_t timestamp;
^
This patch includes <time.h> using the '%code requires' directive of
Yacc.
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
addrdb/coord-config-parse.y | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/addrdb/coord-config-parse.y b/addrdb/coord-config-parse.y
index 2e10a88..85ee058 100644
--- a/addrdb/coord-config-parse.y
+++ b/addrdb/coord-config-parse.y
@@ -102,6 +102,10 @@
%}
+%code requires {
+#include <time.h>
+}
+
%union {
unsigned long number;
time_t timestamp;
--
2.12.1

View File

@@ -0,0 +1,30 @@
From f017353b8f3170ce79e7addc127056c0142f087b Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Sun, 1 Apr 2018 14:31:05 -0700
Subject: [PATCH] coordinator: Fix strncpy range warning
Fixes
error: 'strncpy' specified bound 4096 equals destination size [-Werror=stringop-truncation]
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
src/coordinator.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/src/coordinator.c b/src/coordinator.c
index c139aae..ca49418 100644
--- a/src/coordinator.c
+++ b/src/coordinator.c
@@ -296,7 +296,8 @@ int main(int argc, char **argv)
if(!lease_file)
lease_file = LEASE_FILE;
- strncpy(pname, argv[0], PATH_MAX);
+ strncpy(pname, argv[0], PATH_MAX - 1);
+ pname[PATH_MAX - 1] = '\0';
pid_file = getenv("PID_FILE");
if (!pid_file)
--
2.16.3

View File

@@ -0,0 +1,27 @@
From ad088233608ba2205511da4f270f8ba29844b84c Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Sat, 8 Apr 2017 09:02:02 -0700
Subject: [PATCH] src/iz.c: Undef dprintf before redefining
Clang is picky and warns about macros redefinition
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
src/iz.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/iz.c b/src/iz.c
index 32be1a8..886f0a5 100644
--- a/src/iz.c
+++ b/src/iz.c
@@ -60,6 +60,7 @@ static int iz_seq = 0;
/* Parsed options */
static int iz_debug = 0;
+#undef dprintf
#define dprintf(lvl, fmt...) \
do { \
if (iz_debug >= lvl) \
--
2.12.2

View File

@@ -0,0 +1,41 @@
Disable building manpages so that make install doesn't fail due to lack of help2man
Upstream-Status: Inappropriate [config]
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
diff --git a/src/Makefile.am b/src/Makefile.am
index 46c4017..d6ed312 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -9,11 +9,6 @@ izcoordinator_DESC = "simple coordinator for IEEE 802.15.4 network"
iz_DESC = "configure an IEEE 802.15.4 interface"
izchat_DESC = "simple chat program using IEEE 802.15.4"
-if MANPAGES
-dist_man_MANS = $(manpages)
-endif
-EXTRA_DIST = $(manpages)
-
izattach_SOURCES = serial.c
iz_SOURCES = iz.c iz-common.c iz-mac.c iz-phy.c
@@ -27,18 +22,6 @@ izcoordinator_LDADD = ../addrdb/libaddrdb.la $(LDADD) $(NL_LIBS) $(LEXLIB)
iz_CFLAGS = $(AM_CFLAGS) $(NL_CFLAGS) -D_GNU_SOURCE
iz_LDADD = $(LDADD) $(NL_LIBS)
-izattach.8: $(izattach_SOURCES) $(top_srcdir)/configure.ac
- -$(HELP2MAN) -o $@ -s 8 -N -n $(izattach_DESC) $(builddir)/izattach
-
-izcoordinator.8: $(izcoordinator_SOURCES) $(top_srcdir)/configure.ac
- -$(HELP2MAN) -o $@ -s 8 -N -n $(izcoordinator_DESC) $(builddir)/izcoordinator
-
-iz.8: $(iz_SOURCES) $(top_srcdir)/configure.ac
- -$(HELP2MAN) -o $@ -s 8 -N -n $(iz_DESC) $(builddir)/iz
-
-izchat.1: $(izchat_SOURCES) $(top_srcdir)/configure.ac
- -$(HELP2MAN) -o $@ -s 1 -N -n $(izchat_DESC) $(builddir)/izchat
-
install-data-hook:
$(mkinstalldirs) $(DESTDIR)`dirname $(leasefile)`
$(mkinstalldirs) $(DESTDIR)`dirname $(pidfile)`

View File

@@ -0,0 +1,39 @@
SUMMARY = "Utilities for managing the Linux LoWPAN stack"
DESCRIPTION = "This is a set of utils to manage the Linux LoWPAN stack. \
The LoWPAN stack aims for IEEE 802.15.4-2003 (and for lesser extent IEEE 802.15.4-2006) compatibility."
SECTION = "net"
LICENSE = "GPL-2.0-only"
LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe"
DEPENDS = "flex-native bison-native libnl python"
PV = "0.3.1+git${SRCPV}"
SRC_URI = "git://github.com/linux-wpan/lowpan-tools;branch=master;protocol=https \
file://no-help2man.patch \
file://0001-Fix-build-errors-with-clang.patch \
file://0001-addrdb-coord-config-parse.y-add-missing-time.h-inclu.patch \
file://0001-src-iz.c-Undef-dprintf-before-redefining.patch \
file://0001-Remove-newline-from-format-line.patch \
file://0001-coordinator-Fix-strncpy-range-warning.patch \
file://0001-Fix-potential-string-truncation-in-strncpy.patch \
"
SRCREV = "1c2d8674cc6f4b1166a066e8822e295c105ae7a2"
S = "${WORKDIR}/git"
inherit autotools python3-dir pkgconfig
CACHED_CONFIGUREVARS += "am_cv_python_pythondir=${PYTHON_SITEPACKAGES_DIR}/lowpan-tools"
CFLAGS += "-Wno-initializer-overrides"
do_install:append() {
rmdir ${D}${localstatedir}/run
}
FILES:${PN}-dbg += "${libexecdir}/lowpan-tools/.debug/"
PACKAGES =+ "${PN}-python"
FILES:${PN}-python = "${libdir}/python*"
SKIP_RECIPE[lowpan-tools] ?= "WARNING these tools are deprecated! Use wpan-tools instead"