diff options
Diffstat (limited to 'poky/meta/recipes-extended')
29 files changed, 408 insertions, 1836 deletions
diff --git a/poky/meta/recipes-extended/ethtool/ethtool/avoid_parallel_tests.patch b/poky/meta/recipes-extended/ethtool/ethtool/avoid_parallel_tests.patch index 8ecfde141..75a3841f2 100644 --- a/poky/meta/recipes-extended/ethtool/ethtool/avoid_parallel_tests.patch +++ b/poky/meta/recipes-extended/ethtool/ethtool/avoid_parallel_tests.patch @@ -1,4 +1,4 @@ -From 1c6c017e56ec536f5cceacdb02092777d390debb Mon Sep 17 00:00:00 2001 +From afecc8791f904dc1893858d68a642b491356c74b Mon Sep 17 00:00:00 2001 From: Tudor Florea <tudor.florea@enea.com> Date: Wed, 28 May 2014 18:59:54 +0200 Subject: [PATCH] ethtool: use serial-tests config needed by ptest. @@ -15,11 +15,11 @@ Upstream-Status: Inappropriate 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac -index 1169b7f..ed82524 100644 +index 19223f7..8a58d15 100644 --- a/configure.ac +++ b/configure.ac @@ -2,7 +2,7 @@ dnl Process this file with autoconf to produce a configure script. - AC_INIT(ethtool, 5.7, netdev@vger.kernel.org) + AC_INIT(ethtool, 5.8, netdev@vger.kernel.org) AC_PREREQ(2.52) AC_CONFIG_SRCDIR([ethtool.c]) -AM_INIT_AUTOMAKE([gnu subdir-objects]) diff --git a/poky/meta/recipes-extended/ethtool/ethtool_5.7.bb b/poky/meta/recipes-extended/ethtool/ethtool_5.8.bb index d9fc30cb5..0403f0e3a 100644 --- a/poky/meta/recipes-extended/ethtool/ethtool_5.7.bb +++ b/poky/meta/recipes-extended/ethtool/ethtool_5.8.bb @@ -11,7 +11,7 @@ SRC_URI = "${KERNELORG_MIRROR}/software/network/ethtool/ethtool-${PV}.tar.gz \ file://avoid_parallel_tests.patch \ " -SRC_URI[sha256sum] = "c2e16f8bf510c5822f8e25061c2533972308a421767c54abcacb1038b08bb782" +SRC_URI[sha256sum] = "91e8bbda48a7fd5d374efacca542364ceb3a6c1f286f024b64ec40ccc799e125" UPSTREAM_CHECK_URI = "https://www.kernel.org/pub/software/network/ethtool/" @@ -29,7 +29,9 @@ do_compile_ptest() { do_install_ptest () { cp ${B}/Makefile ${D}${PTEST_PATH} install ${B}/test-cmdline ${D}${PTEST_PATH} - install ${B}/test-features ${D}${PTEST_PATH} + if ${@bb.utils.contains('PACKAGECONFIG', 'netlink', 'false', 'true', d)}; then + install ${B}/test-features ${D}${PTEST_PATH} + fi install ${B}/ethtool ${D}${PTEST_PATH}/ethtool sed -i 's/^Makefile/_Makefile/' ${D}${PTEST_PATH}/Makefile } diff --git a/poky/meta/recipes-extended/ghostscript/ghostscript/CVE-2020-15900.patch b/poky/meta/recipes-extended/ghostscript/ghostscript/CVE-2020-15900.patch new file mode 100644 index 000000000..d7c5f034e --- /dev/null +++ b/poky/meta/recipes-extended/ghostscript/ghostscript/CVE-2020-15900.patch @@ -0,0 +1,54 @@ +From 5d499272b95a6b890a1397e11d20937de000d31b Mon Sep 17 00:00:00 2001 +From: Ray Johnston <ray.johnston@artifex.com> +Date: Wed, 22 Jul 2020 09:57:54 -0700 +Subject: [PATCH] Bug 702582, CVE 2020-15900 Memory Corruption in Ghostscript + 9.52 + +Fix the 'rsearch' calculation for the 'post' size to give the correct +size. Previous calculation would result in a size that was too large, +and could underflow to max uint32_t. Also fix 'rsearch' to return the +correct 'pre' string with empty string match. + +A future change may 'undefine' this undocumented, non-standard operator +during initialization as we do with the many other non-standard internal +PostScript operators and procedures. + +Upstream-Status: Backport [https://git.ghostscript.com/?p=ghostpdl.git;a=commitdiff;h=5d499272b95a6b890a1397e11d20937de000d31b] +CVE: CVE-2020-15900 +Signed-off-by: Chee Yang Lee <chee.yang.lee@intel.com> +--- + psi/zstring.c | 17 +++++++++++------ + 1 file changed, 11 insertions(+), 6 deletions(-) + +diff --git a/psi/zstring.c b/psi/zstring.c +index 33662dafa..58e1af2b3 100644 +--- a/psi/zstring.c ++++ b/psi/zstring.c +@@ -142,13 +142,18 @@ search_impl(i_ctx_t *i_ctx_p, bool forward) + return 0; + found: + op->tas.type_attrs = op1->tas.type_attrs; +- op->value.bytes = ptr; +- r_set_size(op, size); ++ op->value.bytes = ptr; /* match */ ++ op->tas.rsize = size; /* match */ + push(2); +- op[-1] = *op1; +- r_set_size(op - 1, ptr - op[-1].value.bytes); +- op1->value.bytes = ptr + size; +- r_set_size(op1, count + (!forward ? (size - 1) : 0)); ++ op[-1] = *op1; /* pre */ ++ op[-3].value.bytes = ptr + size; /* post */ ++ if (forward) { ++ op[-1].tas.rsize = ptr - op[-1].value.bytes; /* pre */ ++ op[-3].tas.rsize = count; /* post */ ++ } else { ++ op[-1].tas.rsize = count; /* pre */ ++ op[-3].tas.rsize -= count + size; /* post */ ++ } + make_true(op); + return 0; + } +-- +2.17.1 + diff --git a/poky/meta/recipes-extended/ghostscript/ghostscript_9.52.bb b/poky/meta/recipes-extended/ghostscript/ghostscript_9.52.bb index 4cdb6e00d..65135f582 100644 --- a/poky/meta/recipes-extended/ghostscript/ghostscript_9.52.bb +++ b/poky/meta/recipes-extended/ghostscript/ghostscript_9.52.bb @@ -34,6 +34,7 @@ SRC_URI_BASE = "https://github.com/ArtifexSoftware/ghostpdl-downloads/releases/d SRC_URI = "${SRC_URI_BASE} \ file://ghostscript-9.21-prevent_recompiling.patch \ file://cups-no-gcrypt.patch \ + file://CVE-2020-15900.patch \ " SRC_URI_class-native = "${SRC_URI_BASE} \ diff --git a/poky/meta/recipes-extended/logrotate/logrotate/act-as-mv-when-rotate.patch b/poky/meta/recipes-extended/logrotate/logrotate/act-as-mv-when-rotate.patch index acef5ccbe..671fce4ac 100644 --- a/poky/meta/recipes-extended/logrotate/logrotate/act-as-mv-when-rotate.patch +++ b/poky/meta/recipes-extended/logrotate/logrotate/act-as-mv-when-rotate.patch @@ -1,4 +1,4 @@ -From ef1ea905831c5bcd63e04149571c10d75ff8f028 Mon Sep 17 00:00:00 2001 +From 17d57a2a923a4af53c8910a9999aebeab3f5d83a Mon Sep 17 00:00:00 2001 From: Robert Yang <liezhi.yang@windriver.com> Date: Tue, 17 Feb 2015 21:08:07 -0800 Subject: [PATCH] Act as the "mv" command when rotate log @@ -15,10 +15,10 @@ Signed-off-by: Robert Yang <liezhi.yang@windriver.com> 1 file changed, 59 insertions(+), 12 deletions(-) diff --git a/logrotate.c b/logrotate.c -index 25902bc..afa1a90 100644 +index 45b3eb6..231371a 100644 --- a/logrotate.c +++ b/logrotate.c -@@ -1434,6 +1434,53 @@ static int findNeedRotating(struct logInfo *log, int logNum, int force) +@@ -1463,6 +1463,53 @@ static int findNeedRotating(const struct logInfo *log, unsigned logNum, int forc return 0; } @@ -72,7 +72,7 @@ index 25902bc..afa1a90 100644 /* find the rotated file with the highest index */ static int findLastRotated(const struct logNames *rotNames, const char *fileext, const char *compext) -@@ -1911,15 +1958,15 @@ static int prerotateSingleLog(struct logInfo *log, int logNum, +@@ -1958,15 +2005,15 @@ static int prerotateSingleLog(const struct logInfo *log, unsigned logNum, } message(MESS_DEBUG, @@ -91,7 +91,7 @@ index 25902bc..afa1a90 100644 oldName, newName, strerror(errno)); hasErrors = 1; } -@@ -2002,10 +2049,10 @@ static int rotateSingleLog(struct logInfo *log, int logNum, +@@ -2051,10 +2098,10 @@ static int rotateSingleLog(const struct logInfo *log, unsigned logNum, return 1; } @@ -105,7 +105,7 @@ index 25902bc..afa1a90 100644 log->files[logNum], tmpFilename, strerror(errno)); hasErrors = 1; -@@ -2014,11 +2061,11 @@ static int rotateSingleLog(struct logInfo *log, int logNum, +@@ -2063,11 +2110,11 @@ static int rotateSingleLog(const struct logInfo *log, unsigned logNum, free(tmpFilename); } else { @@ -120,7 +120,7 @@ index 25902bc..afa1a90 100644 log->files[logNum], rotNames->finalName, strerror(errno)); hasErrors = 1; -@@ -2424,7 +2471,7 @@ static int rotateLogSet(struct logInfo *log, int force) +@@ -2480,7 +2527,7 @@ static int rotateLogSet(const struct logInfo *log, int force) return hasErrors; } @@ -129,16 +129,16 @@ index 25902bc..afa1a90 100644 { struct logState *p; FILE *f; -@@ -2629,7 +2676,7 @@ static int writeState(const char *stateFilename) +@@ -2659,7 +2706,7 @@ static int writeState(const char *stateFilename) fclose(f); if (error == 0) { - if (rename(tmpFilename, stateFilename)) { + if (mvFile(tmpFilename, stateFilename, log, prev_acl)) { + message(MESS_ERROR, "error renaming temp state file %s to %s: %s\n", + tmpFilename, stateFilename, strerror(errno)); unlink(tmpFilename); - error = 1; - message(MESS_ERROR, "error renaming temp state file %s to %s\n", -@@ -2987,7 +3034,7 @@ int main(int argc, const char **argv) +@@ -3073,7 +3120,7 @@ int main(int argc, const char **argv) rc |= rotateLogSet(log, force); if (!debug) diff --git a/poky/meta/recipes-extended/logrotate/logrotate/disable-check-different-filesystems.patch b/poky/meta/recipes-extended/logrotate/logrotate/disable-check-different-filesystems.patch index 9ba531f81..d7f9a02cc 100644 --- a/poky/meta/recipes-extended/logrotate/logrotate/disable-check-different-filesystems.patch +++ b/poky/meta/recipes-extended/logrotate/logrotate/disable-check-different-filesystems.patch @@ -1,4 +1,4 @@ -From a3fdf3dbdd6ecc0f2550a765dcb9bb274bce8ea8 Mon Sep 17 00:00:00 2001 +From 16c1833ade4c036b30b8761d2c4a5bd85cc65c44 Mon Sep 17 00:00:00 2001 From: Robert Yang <liezhi.yang@windriver.com> Date: Tue, 8 Jan 2019 06:27:06 +0000 Subject: [PATCH] Disable the check for different filesystems @@ -15,10 +15,10 @@ Signed-off-by: Robert Yang <liezhi.yang@windriver.com> 1 file changed, 9 deletions(-) diff --git a/config.c b/config.c -index f027c7e..026136c 100644 +index d2488f1..1de3745 100644 --- a/config.c +++ b/config.c -@@ -1873,15 +1873,6 @@ duperror: +@@ -1902,15 +1902,6 @@ duperror: } free(ld); @@ -28,7 +28,7 @@ index f027c7e..026136c 100644 - message(MESS_ERROR, - "%s:%d olddir %s and log file %s " - "are on different devices\n", configFile, -- lineNum, newlog->oldDir, newlog->files[i]); +- lineNum, newlog->oldDir, newlog->files[j]); - goto error; - } } diff --git a/poky/meta/recipes-extended/logrotate/logrotate_3.16.0.bb b/poky/meta/recipes-extended/logrotate/logrotate_3.17.0.bb index 1c9df5a3c..08001f38e 100644 --- a/poky/meta/recipes-extended/logrotate/logrotate_3.16.0.bb +++ b/poky/meta/recipes-extended/logrotate/logrotate_3.17.0.bb @@ -18,8 +18,7 @@ SRC_URI = "https://github.com/${BPN}/${BPN}/releases/download/${PV}/${BP}.tar.xz file://disable-check-different-filesystems.patch \ " -SRC_URI[md5sum] = "faf729e0e24bfaafaa677bc6deb46ed8" -SRC_URI[sha256sum] = "442f6fdf61c349eeae5f76799878b88fe45a11c8863a38b618bac6988f4a7ce5" +SRC_URI[sha256sum] = "58cc2178ff57faa3c0490181cce041345aeca6cff18dba1c5cd1398bf1c19294" PACKAGECONFIG ?= "${@bb.utils.filter('DISTRO_FEATURES', 'acl selinux', d)}" diff --git a/poky/meta/recipes-extended/ltp/ltp/0001-Remove-OOM-tests-from-runtest-mm.patch b/poky/meta/recipes-extended/ltp/ltp/0001-Remove-OOM-tests-from-runtest-mm.patch new file mode 100644 index 000000000..6b665030c --- /dev/null +++ b/poky/meta/recipes-extended/ltp/ltp/0001-Remove-OOM-tests-from-runtest-mm.patch @@ -0,0 +1,34 @@ +From 13ef88cdccfe3f58c53d57806866b91e310eb272 Mon Sep 17 00:00:00 2001 +From: "Mingde (Matthew) Zeng" <matthewzmd@gmail.com> +Date: Wed, 29 Jul 2020 08:47:09 -0400 +Subject: [PATCH] Remove OOM tests from runtest/mm + +Disable OOM tests, as they might cause oeqa ssh connection lost + +Upstream-Status: Inappropriate [oe-core specific] +Signed-off-by: Mingde (Matthew) Zeng <matthew.zeng@windriver.com> + +--- + runtest/mm | 6 ------ + 1 file changed, 6 deletions(-) + +diff --git a/runtest/mm b/runtest/mm +index a09f39c1e..76fa82754 100644 +--- a/runtest/mm ++++ b/runtest/mm +@@ -73,12 +73,6 @@ ksm06 ksm06 + ksm06_1 ksm06 -n 10 + ksm06_2 ksm06 -n 10000 + +-oom01 oom01 +-oom02 oom02 +-oom03 oom03 +-oom04 oom04 +-oom05 oom05 +- + swapping01 swapping01 -i 5 + + thp01 thp01 -I 120 +-- +2.27.0 + diff --git a/poky/meta/recipes-extended/ltp/ltp_20200515.bb b/poky/meta/recipes-extended/ltp/ltp_20200515.bb index b283add12..0c7044d04 100644 --- a/poky/meta/recipes-extended/ltp/ltp_20200515.bb +++ b/poky/meta/recipes-extended/ltp/ltp_20200515.bb @@ -37,6 +37,7 @@ SRC_URI = "git://github.com/linux-test-project/ltp.git \ file://0001-ptrace01-Fix-missing-format-string.patch \ file://0001-sigwaitinfo-Do-not-run-invalid-undefined-test-cases.patch \ file://0001-syscalls-copy_file_range02-Expect-EFBIG-in-subcase-m.patch \ + file://0001-Remove-OOM-tests-from-runtest-mm.patch \ " S = "${WORKDIR}/git" @@ -50,7 +51,7 @@ export exec_prefix = "/opt/${PN}" PACKAGECONFIG[numa] = "--with-numa, --without-numa, numactl," EXTRA_AUTORECONF += "-I ${S}/testcases/realtime/m4" -EXTRA_OECONF = " --with-power-management-testsuite --with-realtime-testsuite --with-open-posix-testsuite " +EXTRA_OECONF = " --with-realtime-testsuite --with-open-posix-testsuite " # ltp network/rpc test cases ftbfs when libtirpc is found EXTRA_OECONF += " --without-tirpc " diff --git a/poky/meta/recipes-extended/minicom/minicom/0001-Drop-superfluous-global-variable-definitions.patch b/poky/meta/recipes-extended/minicom/minicom/0001-Drop-superfluous-global-variable-definitions.patch new file mode 100644 index 000000000..4c6e24931 --- /dev/null +++ b/poky/meta/recipes-extended/minicom/minicom/0001-Drop-superfluous-global-variable-definitions.patch @@ -0,0 +1,35 @@ +From b65152ebc03832972115e6d98e50cb6190d01793 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Ond=C5=99ej=20Lyson=C4=9Bk?= <olysonek@redhat.com> +Date: Mon, 3 Feb 2020 13:18:13 +0100 +Subject: [PATCH 1/3] Drop superfluous global variable definitions + +The file minicom.c, by including the minicom.h header, already defines +the global variables 'dial_user' and 'dial_pass'. The object file +minicom.o is always linked to dial.o. Thus the definitions in dial.c +can be dropped. + +This fixes linking with gcc 10 which uses -fno-common by default, +disallowing multiple global variable definitions. + +Upstream-Status: Pending +Signed-off-by: Khem Raj <raj.khem@gmail.com> +--- + src/dial.c | 2 -- + 1 file changed, 2 deletions(-) + +diff --git a/src/dial.c b/src/dial.c +index eada5ee..d9d481f 100644 +--- a/src/dial.c ++++ b/src/dial.c +@@ -146,8 +146,6 @@ static int newtype; + /* Access to ".dialdir" denied? */ + static int dendd = 0; + static char *tagged; +-char *dial_user; +-char *dial_pass; + + /* Change the baud rate. Treat all characters in the given array as if + * they were key presses within the comm parameters dialog (C-A P) and +-- +2.24.1 + diff --git a/poky/meta/recipes-extended/minicom/minicom/0002-Drop-superfluous-global-variable-definitions.patch b/poky/meta/recipes-extended/minicom/minicom/0002-Drop-superfluous-global-variable-definitions.patch new file mode 100644 index 000000000..1740051e0 --- /dev/null +++ b/poky/meta/recipes-extended/minicom/minicom/0002-Drop-superfluous-global-variable-definitions.patch @@ -0,0 +1,37 @@ +From 924bd2da3a00e030e29d82b74ef82900bd50b475 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Ond=C5=99ej=20Lyson=C4=9Bk?= <olysonek@redhat.com> +Date: Mon, 3 Feb 2020 13:18:33 +0100 +Subject: [PATCH 2/3] Drop superfluous global variable definitions + +The only place where the EXTERN macro mechanism is used to define the +global variables 'vt_outmap' and 'vt_inmap' is minicom.c (by defining +an empty EXTERN macro and including the minicom.h header). The file +vt100.c already defines these variables. The vt100.o object file is +always linked to minicom.o. Thus it is safe not to define the +variables in minicom.c and only declare them in the minicom.h header. + +This fixes linking with gcc 10 which uses -fno-common by default, +disallowing multiple global variable definitions. + +Upstream-Status: Pending +Signed-off-by: Khem Raj <raj.khem@gmail.com> +--- + src/minicom.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/minicom.h b/src/minicom.h +index 061c013..0f9693b 100644 +--- a/src/minicom.h ++++ b/src/minicom.h +@@ -141,7 +141,7 @@ EXTERN int sbcolor; /* Status Bar Background Color */ + EXTERN int st_attr; /* Status Bar attributes. */ + + /* jl 04.09.97 conversion tables */ +-EXTERN unsigned char vt_outmap[256], vt_inmap[256]; ++extern unsigned char vt_outmap[256], vt_inmap[256]; + + /* MARK updated 02/17/95 - history buffer */ + EXTERN int num_hist_lines; /* History buffer size */ +-- +2.24.1 + diff --git a/poky/meta/recipes-extended/minicom/minicom/0003-Drop-superfluous-global-variable-definitions.patch b/poky/meta/recipes-extended/minicom/minicom/0003-Drop-superfluous-global-variable-definitions.patch new file mode 100644 index 000000000..58cd58eda --- /dev/null +++ b/poky/meta/recipes-extended/minicom/minicom/0003-Drop-superfluous-global-variable-definitions.patch @@ -0,0 +1,42 @@ +From a4fc603b3641d2efe31479116eb7ba66932901c7 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Ond=C5=99ej=20Lyson=C4=9Bk?= <olysonek@redhat.com> +Date: Mon, 3 Feb 2020 13:21:41 +0100 +Subject: [PATCH 3/3] Drop superfluous global variable definitions + +The only place where the EXTERN macro mechanism is used to define the +global variables 'portfd_is_socket', 'portfd_is_connected' and +'portfd_sock_addr' is minicom.c (by defining an empty EXTERN macro and +including the minicom.h header). The source file sysdep1_s.c already +defines these variables. The sysdep1_s.o object file is always linked +to minicom.o. Thus it is safe to drop the definitions from minicom.c +and only declare the variables in the minicom.h header. + +This fixes linking with gcc 10 which uses -fno-common by default, +disallowing multiple global variable definitions. + +Upstream-Status: Pending +Signed-off-by: Khem Raj <raj.khem@gmail.com> +--- + src/minicom.h | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/src/minicom.h b/src/minicom.h +index 0f9693b..1e7cb8c 100644 +--- a/src/minicom.h ++++ b/src/minicom.h +@@ -113,9 +113,9 @@ EXTERN char *dial_user; /* Our username there */ + EXTERN char *dial_pass; /* Our password */ + + #ifdef USE_SOCKET +-EXTERN int portfd_is_socket; /* File descriptor is a unix socket */ +-EXTERN int portfd_is_connected; /* 1 if the socket is connected */ +-EXTERN struct sockaddr_un portfd_sock_addr; /* the unix socket address */ ++extern int portfd_is_socket; /* File descriptor is a unix socket */ ++extern int portfd_is_connected; /* 1 if the socket is connected */ ++extern struct sockaddr_un portfd_sock_addr; /* the unix socket address */ + #define portfd_connected ((portfd_is_socket && !portfd_is_connected) \ + ? -1 : portfd) + #else +-- +2.24.1 + diff --git a/poky/meta/recipes-extended/minicom/minicom_2.7.1.bb b/poky/meta/recipes-extended/minicom/minicom_2.7.1.bb index 1e6f1317e..03034864c 100644 --- a/poky/meta/recipes-extended/minicom/minicom_2.7.1.bb +++ b/poky/meta/recipes-extended/minicom/minicom_2.7.1.bb @@ -11,6 +11,9 @@ SRC_URI = "${DEBIAN_MIRROR}/main/m/${BPN}/${BPN}_${PV}.orig.tar.gz \ file://allow.to.disable.lockdev.patch \ file://0001-fix-minicom-h-v-return-value-is-not-0.patch \ file://0001-Fix-build-issus-surfaced-due-to-musl.patch \ + file://0001-Drop-superfluous-global-variable-definitions.patch \ + file://0002-Drop-superfluous-global-variable-definitions.patch \ + file://0003-Drop-superfluous-global-variable-definitions.patch \ " SRC_URI[md5sum] = "9021cb8c5445f6e6e74b2acc39962d62" diff --git a/poky/meta/recipes-extended/net-tools/net-tools/0001-added-ull-prefix-to-unsigned-long-long-constants-to-.patch b/poky/meta/recipes-extended/net-tools/net-tools/0001-added-ull-prefix-to-unsigned-long-long-constants-to-.patch deleted file mode 100644 index 523d434b7..000000000 --- a/poky/meta/recipes-extended/net-tools/net-tools/0001-added-ull-prefix-to-unsigned-long-long-constants-to-.patch +++ /dev/null @@ -1,381 +0,0 @@ -From eb04ef31571f6c707eacaba6846feeebfab518e6 Mon Sep 17 00:00:00 2001 -From: Bernd Eckenfels <net-tools@lina.inka.de> -Date: Thu, 29 May 2003 02:09:14 +0000 -Subject: [PATCH] added 'ull' prefix to unsigned long long constants to make - gcc 3.3 happy - -Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> -Upstream-Status: Backport [https://sourceforge.net/p/net-tools/code/ci/eb04ef31571f6c707eacaba6846feeebfab518e6] ---- - lib/interface.c | 299 ++++++++++++++++++++++++++---------------------- - 1 file changed, 161 insertions(+), 138 deletions(-) - -diff -uNr net-tools-1.60.orig/lib/interface.c net-tools-1.60/lib/interface.c ---- net-tools-1.60.orig/lib/interface.c 2020-06-16 10:04:16.308411879 +0000 -+++ net-tools-1.60/lib/interface.c 2020-06-16 10:05:15.697264291 +0000 -@@ -23,7 +23,6 @@ - #include <string.h> - #include <unistd.h> - #include <ctype.h> --#include <string.h> - - #if HAVE_AFIPX - #if (__GLIBC__ > 2) || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1) -@@ -654,6 +653,8 @@ - const char *Rext = "B"; - const char *Text = "B"; - -+ static char flags[200]; -+ - #if HAVE_AFIPX - static struct aftype *ipxtype = NULL; - #endif -@@ -685,32 +686,68 @@ - if (hw == NULL) - hw = get_hwntype(-1); - -- printf(_("%-9s Link encap:%s "), ptr->name, hw->title); -- /* For some hardware types (eg Ash, ATM) we don't print the -- hardware address if it's null. */ -- if (hw->print != NULL && (! (hw_null_address(hw, ptr->hwaddr) && -- hw->suppress_null_addr))) -- printf(_("HWaddr %s "), hw->print(ptr->hwaddr)); --#ifdef IFF_PORTSEL -- if (ptr->flags & IFF_PORTSEL) { -- printf(_("Media:%s"), if_port_text[ptr->map.port][0]); -- if (ptr->flags & IFF_AUTOMEDIA) -- printf(_("(auto)")); -- } -+ sprintf(flags, "flags=%d<", ptr->flags); -+ /* DONT FORGET TO ADD THE FLAGS IN ife_print_short, too */ -+ if (ptr->flags == 0) -+ strcat(flags,">"); -+ if (ptr->flags & IFF_UP) -+ strcat(flags,_("UP,")); -+ if (ptr->flags & IFF_BROADCAST) -+ strcat(flags,_("BROADCAST,")); -+ if (ptr->flags & IFF_DEBUG) -+ strcat(flags,_("DEBUG,")); -+ if (ptr->flags & IFF_LOOPBACK) -+ strcat(flags,_("LOOPBACK,")); -+ if (ptr->flags & IFF_POINTOPOINT) -+ strcat(flags,_("POINTOPOINT,")); -+ if (ptr->flags & IFF_NOTRAILERS) -+ strcat(flags,_("NOTRAILERS,")); -+ if (ptr->flags & IFF_RUNNING) -+ strcat(flags,_("RUNNING,")); -+ if (ptr->flags & IFF_NOARP) -+ strcat(flags,_("NOARP,")); -+ if (ptr->flags & IFF_PROMISC) -+ strcat(flags,_("PROMISC,")); -+ if (ptr->flags & IFF_ALLMULTI) -+ strcat(flags,_("ALLMULTI,")); -+ if (ptr->flags & IFF_SLAVE) -+ strcat(flags,_("SLAVE,")); -+ if (ptr->flags & IFF_MASTER) -+ strcat(flags,_("MASTER,")); -+ if (ptr->flags & IFF_MULTICAST) -+ strcat(flags,_("MULTICAST,")); -+#ifdef HAVE_DYNAMIC -+ if (ptr->flags & IFF_DYNAMIC) -+ strcat(flags,_("DYNAMIC,")); -+#endif -+ /* DONT FORGET TO ADD THE FLAGS IN ife_print_short */ -+ if (flags[strlen(flags)-1] == ',') -+ flags[strlen(flags)-1] = '>'; -+ else -+ flags[strlen(flags)-1] = 0; -+ -+ -+ printf(_("%s: %s mtu %d metric %d"), -+ ptr->name, flags, ptr->mtu, ptr->metric ? ptr->metric : 1); -+#ifdef SIOCSKEEPALIVE -+ if (ptr->outfill || ptr->keepalive) -+ printf(_(" outfill %d keepalive %d"), -+ ptr->outfill, ptr->keepalive); - #endif - printf("\n"); - - #if HAVE_AFINET - if (ptr->has_ip) { -- printf(_(" %s addr:%s "), ap->name, -+ printf(_(" %s %s"), ap->name, - ap->sprint(&ptr->addr, 1)); -- if (ptr->flags & IFF_POINTOPOINT) { -- printf(_(" P-t-P:%s "), ap->sprint(&ptr->dstaddr, 1)); -- } -+ printf(_(" netmask %s"), ap->sprint(&ptr->netmask, 1)); - if (ptr->flags & IFF_BROADCAST) { -- printf(_(" Bcast:%s "), ap->sprint(&ptr->broadaddr, 1)); -+ printf(_(" broadcast %s"), ap->sprint(&ptr->broadaddr, 1)); - } -- printf(_(" Mask:%s\n"), ap->sprint(&ptr->netmask, 1)); -+ if (ptr->flags & IFF_POINTOPOINT) { -+ printf(_(" destination %s"), ap->sprint(&ptr->dstaddr, 1)); -+ } -+ printf("\n"); - } - #endif - -@@ -727,29 +764,30 @@ - addr6p[0], addr6p[1], addr6p[2], addr6p[3], - addr6p[4], addr6p[5], addr6p[6], addr6p[7]); - inet6_aftype.input(1, addr6, (struct sockaddr *) &sap); -- printf(_(" inet6 addr: %s/%d"), -- inet6_aftype.sprint((struct sockaddr *) &sap, 1), plen); -- printf(_(" Scope:")); -- switch (scope) { -- case 0: -- printf(_("Global")); -- break; -- case IPV6_ADDR_LINKLOCAL: -- printf(_("Link")); -- break; -- case IPV6_ADDR_SITELOCAL: -- printf(_("Site")); -- break; -- case IPV6_ADDR_COMPATv4: -- printf(_("Compat")); -- break; -- case IPV6_ADDR_LOOPBACK: -- printf(_("Host")); -- break; -- default: -- printf(_("Unknown")); -+ printf(_(" %s %s prefixlen %d"), -+ inet6_aftype.name, -+ inet6_aftype.sprint((struct sockaddr *) &sap, 1), -+ plen); -+ printf(_(" scopeid 0x%x"), scope); -+ -+ flags[0] = '<'; flags[1] = 0; -+ if (scope & IPV6_ADDR_COMPATv4) { -+ strcat(flags, _("compat,")); -+ scope -= IPV6_ADDR_COMPATv4; - } -- printf("\n"); -+ if (scope == 0) -+ strcat(flags, _("global,")); -+ if (scope & IPV6_ADDR_LINKLOCAL) -+ strcat(flags, _("link,")); -+ if (scope & IPV6_ADDR_SITELOCAL) -+ strcat(flags, _("site,")); -+ if (scope & IPV6_ADDR_LOOPBACK) -+ strcat(flags, _("host,")); -+ if (flags[strlen(flags)-1] == ',') -+ flags[strlen(flags)-1] = '>'; -+ else -+ flags[strlen(flags)-1] = 0; -+ printf("%s\n", flags); - } - } - fclose(f); -@@ -762,17 +800,17 @@ - - if (ipxtype != NULL) { - if (ptr->has_ipx_bb) -- printf(_(" IPX/Ethernet II addr:%s\n"), -- ipxtype->sprint(&ptr->ipxaddr_bb, 1)); -+ printf(_(" %s Ethernet-II %s\n"), -+ ipxtype->name, ipxtype->sprint(&ptr->ipxaddr_bb, 1)); - if (ptr->has_ipx_sn) -- printf(_(" IPX/Ethernet SNAP addr:%s\n"), -- ipxtype->sprint(&ptr->ipxaddr_sn, 1)); -+ printf(_(" %s Ethernet-SNAP %s\n"), -+ ipxtype->name, ipxtype->sprint(&ptr->ipxaddr_sn, 1)); - if (ptr->has_ipx_e2) -- printf(_(" IPX/Ethernet 802.2 addr:%s\n"), -- ipxtype->sprint(&ptr->ipxaddr_e2, 1)); -+ printf(_(" %s Ethernet802.2 %s\n"), -+ ipxtype->name, ipxtype->sprint(&ptr->ipxaddr_e2, 1)); - if (ptr->has_ipx_e3) -- printf(_(" IPX/Ethernet 802.3 addr:%s\n"), -- ipxtype->sprint(&ptr->ipxaddr_e3, 1)); -+ printf(_(" %s Ethernet802.3 %s\n"), -+ ipxtype->name, ipxtype->sprint(&ptr->ipxaddr_e3, 1)); - } - #endif - -@@ -781,7 +819,7 @@ - ddptype = get_afntype(AF_APPLETALK); - if (ddptype != NULL) { - if (ptr->has_ddp) -- printf(_(" EtherTalk Phase 2 addr:%s\n"), ddptype->sprint(&ptr->ddpaddr, 1)); -+ printf(_(" %s %s\n"), ddptype->name, ddptype->sprint(&ptr->ddpaddr, 1)); - } - #endif - -@@ -790,53 +828,30 @@ - ectype = get_afntype(AF_ECONET); - if (ectype != NULL) { - if (ptr->has_econet) -- printf(_(" econet addr:%s\n"), ectype->sprint(&ptr->ecaddr, 1)); -+ printf(_(" %s %s\n"), ectype->name, ectype->sprint(&ptr->ecaddr, 1)); - } - #endif - -- printf(" "); -- /* DONT FORGET TO ADD THE FLAGS IN ife_print_short, too */ -- if (ptr->flags == 0) -- printf(_("[NO FLAGS] ")); -- if (ptr->flags & IFF_UP) -- printf(_("UP ")); -- if (ptr->flags & IFF_BROADCAST) -- printf(_("BROADCAST ")); -- if (ptr->flags & IFF_DEBUG) -- printf(_("DEBUG ")); -- if (ptr->flags & IFF_LOOPBACK) -- printf(_("LOOPBACK ")); -- if (ptr->flags & IFF_POINTOPOINT) -- printf(_("POINTOPOINT ")); -- if (ptr->flags & IFF_NOTRAILERS) -- printf(_("NOTRAILERS ")); -- if (ptr->flags & IFF_RUNNING) -- printf(_("RUNNING ")); -- if (ptr->flags & IFF_NOARP) -- printf(_("NOARP ")); -- if (ptr->flags & IFF_PROMISC) -- printf(_("PROMISC ")); -- if (ptr->flags & IFF_ALLMULTI) -- printf(_("ALLMULTI ")); -- if (ptr->flags & IFF_SLAVE) -- printf(_("SLAVE ")); -- if (ptr->flags & IFF_MASTER) -- printf(_("MASTER ")); -- if (ptr->flags & IFF_MULTICAST) -- printf(_("MULTICAST ")); --#ifdef HAVE_DYNAMIC -- if (ptr->flags & IFF_DYNAMIC) -- printf(_("DYNAMIC ")); --#endif -- /* DONT FORGET TO ADD THE FLAGS IN ife_print_short */ -- printf(_(" MTU:%d Metric:%d"), -- ptr->mtu, ptr->metric ? ptr->metric : 1); --#ifdef SIOCSKEEPALIVE -- if (ptr->outfill || ptr->keepalive) -- printf(_(" Outfill:%d Keepalive:%d"), -- ptr->outfill, ptr->keepalive); -+ /* For some hardware types (eg Ash, ATM) we don't print the -+ hardware address if it's null. */ -+ if (hw->print != NULL && (! (hw_null_address(hw, ptr->hwaddr) && -+ hw->suppress_null_addr))) -+ printf(_(" %s %s"), hw->name, hw->print(ptr->hwaddr)); -+ else -+ printf(_(" %s"), hw->name); -+ if (ptr->tx_queue_len != -1) -+ printf(_(" txqueuelen %d"), ptr->tx_queue_len); -+ printf(" (%s)\n", hw->title); -+ -+#ifdef IFF_PORTSEL -+ if (ptr->flags & IFF_PORTSEL) { -+ printf(_(" media %s"), if_port_text[ptr->map.port][0]); -+ if (ptr->flags & IFF_AUTOMEDIA) -+ printf(_("autoselect")); -+ printf("\n"); -+ } - #endif -- printf("\n"); -+ - - /* If needed, display the interface statistics. */ - -@@ -845,19 +860,9 @@ - * not for the aliases, although strictly speaking they're shared - * by all addresses. - */ -- printf(" "); -- -- printf(_("RX packets:%llu errors:%lu dropped:%lu overruns:%lu frame:%lu\n"), -- ptr->stats.rx_packets, ptr->stats.rx_errors, -- ptr->stats.rx_dropped, ptr->stats.rx_fifo_errors, -- ptr->stats.rx_frame_errors); -- if (can_compress) -- printf(_(" compressed:%lu\n"), ptr->stats.rx_compressed); - - rx = ptr->stats.rx_bytes; -- tx = ptr->stats.tx_bytes; - short_rx = rx * 10; -- short_tx = tx * 10; - if (rx > 1125899906842624ull) { - short_rx /= 1125899906842624ull; - Rext = "PiB"; -@@ -874,6 +879,8 @@ - short_rx /= 1024; - Rext = "KiB"; - } -+ tx = ptr->stats.tx_bytes; -+ short_tx = tx * 10; - if (tx > 1125899906842624ull) { - short_tx /= 1125899906842624ull; - Text = "PiB"; -@@ -891,37 +898,50 @@ - Text = "KiB"; - } - -- printf(" "); -- printf(_("TX packets:%llu errors:%lu dropped:%lu overruns:%lu carrier:%lu\n"), -- ptr->stats.tx_packets, ptr->stats.tx_errors, -- ptr->stats.tx_dropped, ptr->stats.tx_fifo_errors, -- ptr->stats.tx_carrier_errors); -- printf(_(" collisions:%lu "), ptr->stats.collisions); -- if (can_compress) -- printf(_("compressed:%lu "), ptr->stats.tx_compressed); -- if (ptr->tx_queue_len != -1) -- printf(_("txqueuelen:%d "), ptr->tx_queue_len); -- printf("\n "); -- printf(_("RX bytes:%llu (%lu.%lu %s) TX bytes:%llu (%lu.%lu %s)\n"), -+ printf(" "); -+ printf(_("RX packets %llu bytes %llu (%lu.%lu %s)\n"), -+ ptr->stats.rx_packets, - rx, (unsigned long)(short_rx / 10), -- (unsigned long)(short_rx % 10), Rext, -- tx, (unsigned long)(short_tx / 10), -- (unsigned long)(short_tx % 10), Text); -+ (unsigned long)(short_rx % 10), Rext); -+ if (can_compress) { -+ printf(" "); -+ printf(_("RX compressed:%lu\n"), ptr->stats.rx_compressed); -+ } -+ printf(" "); -+ printf(_("RX errors %lu dropped %lu overruns %lu frame %lu\n"), -+ ptr->stats.rx_errors, ptr->stats.rx_dropped, -+ ptr->stats.rx_fifo_errors, ptr->stats.rx_frame_errors); -+ -+ -+ printf(" "); -+ printf(_("TX packets %llu bytes %llu (%lu.%lu %s)\n"), -+ ptr->stats.tx_packets, -+ tx, (unsigned long)(short_tx / 10), -+ (unsigned long)(short_tx % 10), Text); -+ if (can_compress) { -+ printf(" "); -+ printf(_("TX compressed %lu\n"), ptr->stats.tx_compressed); -+ } -+ printf(" "); -+ printf(_("TX errors %lu dropped %lu overruns %lu carrier %lu collisions %lu\n"), -+ ptr->stats.tx_errors, -+ ptr->stats.tx_dropped, ptr->stats.tx_fifo_errors, -+ ptr->stats.tx_carrier_errors, ptr->stats.collisions); - } - - if ((ptr->map.irq || ptr->map.mem_start || ptr->map.dma || - ptr->map.base_addr >= 0x100)) { -- printf(" "); -+ printf(" device "); - if (ptr->map.irq) -- printf(_("Interrupt:%d "), ptr->map.irq); -+ printf(_("interrupt %d "), ptr->map.irq); - if (ptr->map.base_addr >= 0x100) /* Only print devices using it for - I/O maps */ -- printf(_("Base address:0x%x "), ptr->map.base_addr); -+ printf(_("base 0x%x "), ptr->map.base_addr); - if (ptr->map.mem_start) { -- printf(_("Memory:%lx-%lx "), ptr->map.mem_start, ptr->map.mem_end); -+ printf(_("memory 0x%lx-%lx "), ptr->map.mem_start, ptr->map.mem_end); - } - if (ptr->map.dma) -- printf(_("DMA chan:%x "), ptr->map.dma); -+ printf(_(" dma 0x%x"), ptr->map.dma); - printf("\n"); - } - printf("\n"); diff --git a/poky/meta/recipes-extended/net-tools/net-tools/0001-lib-inet6.c-INET6_rresolve-various-fixes.patch b/poky/meta/recipes-extended/net-tools/net-tools/0001-lib-inet6.c-INET6_rresolve-various-fixes.patch deleted file mode 100644 index 8be45ccac..000000000 --- a/poky/meta/recipes-extended/net-tools/net-tools/0001-lib-inet6.c-INET6_rresolve-various-fixes.patch +++ /dev/null @@ -1,87 +0,0 @@ -From 08abfcd923e9f37d1902db26771b1dc6731eb265 Mon Sep 17 00:00:00 2001 -From: Jiri Popelka <jpopelka@redhat.com> -Date: Fri, 27 Sep 2013 18:40:06 +0200 -Subject: [PATCH 1/1] lib/inet6.c:INET6_rresolve() - various fixes - -1) Fall-back to numeric address if getnameinfo fails. - Reverse lookup is not mandatory, therefore its fail - is not an error. Just return numeric address in that case. - This makes netstat/route show IPv6 address instead of - [UNKNOWN] in case of DNS problems. - -2) Pass length of 'name' buffer into function. - 'name' is a pointer and therefore sizeof(name) - returns size of pointer and not size of the buffer. - see http://stackoverflow.com/questions/14298710/c-pointers-and-arrays-sizeof-operator - The sizeof() usage was added with commit 604785adc, - so I checked all the other changes in that commit - and they seem to be OK. - -3) remove unused 's' variable - -Upstream-Status: Pending - -Signed-off-by: Shan Hai <shan.hai@windriver.com> -Signed-off-by: Jianchuan Wang <jianchuan.wang@windriver.com> ---- - lib/inet6.c | 21 ++++++++++----------- - 1 file changed, 10 insertions(+), 11 deletions(-) - -diff --git a/lib/inet6.c b/lib/inet6.c -index 9a484a0..2a9c459 100644 ---- a/lib/inet6.c -+++ b/lib/inet6.c -@@ -84,10 +84,9 @@ static int INET6_resolve(char *name, struct sockaddr_in6 *sin6) - #endif - - --static int INET6_rresolve(char *name, struct sockaddr_in6 *sin6, int numeric) -+static int INET6_rresolve(char *name, size_t namelen, -+ struct sockaddr_in6 *sin6, int numeric) - { -- int s; -- - /* Grmpf. -FvK */ - if (sin6->sin6_family != AF_INET6) { - #ifdef DEBUG -@@ -98,21 +97,20 @@ static int INET6_rresolve(char *name, struct sockaddr_in6 *sin6, int numeric) - return (-1); - } - if (numeric & 0x7FFF) { -- inet_ntop( AF_INET6, &sin6->sin6_addr, name, 80); -+ inet_ntop( AF_INET6, &sin6->sin6_addr, name, namelen); - return (0); - } - if (IN6_IS_ADDR_UNSPECIFIED(&sin6->sin6_addr)) { - if (numeric & 0x8000) -- strcpy(name, "default"); -+ safe_strncpy(name, "default", namelen); - else -- strcpy(name, "[::]"); -+ safe_strncpy(name, "[::]", namelen); - return (0); - } - -- if ((s = getnameinfo((struct sockaddr *) sin6, sizeof(struct sockaddr_in6), -- name, 255 /* !! */ , NULL, 0, 0))) { -- fputs("getnameinfo failed\n", stderr); -- return -1; -+ if (getnameinfo((struct sockaddr *) sin6, sizeof(struct sockaddr_in6), -+ name, namelen , NULL, 0, 0)) { -+ inet_ntop( AF_INET6, &sin6->sin6_addr, name, namelen); - } - return (0); - } -@@ -143,7 +141,8 @@ static char *INET6_sprint(struct sockaddr *sap, int numeric) - - if (sap->sa_family == 0xFFFF || sap->sa_family == 0) - return safe_strncpy(buff, _("[NONE SET]"), sizeof(buff)); -- if (INET6_rresolve(buff, (struct sockaddr_in6 *) sap, numeric) != 0) -+ if (INET6_rresolve(buff, sizeof(buff), -+ (struct sockaddr_in6 *) sap, numeric) != 0) - return safe_strncpy(buff, _("[UNKNOWN]"), sizeof(buff)); - return (fix_v4_address(buff, &((struct sockaddr_in6 *)sap)->sin6_addr)); - } --- -1.8.5.2.233.g932f7e4 - diff --git a/poky/meta/recipes-extended/net-tools/net-tools/Add_missing_headers.patch b/poky/meta/recipes-extended/net-tools/net-tools/Add_missing_headers.patch new file mode 100644 index 000000000..f15d3654c --- /dev/null +++ b/poky/meta/recipes-extended/net-tools/net-tools/Add_missing_headers.patch @@ -0,0 +1,15 @@ +Description: Add missing headers + +Upstream-Status: Pending +Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> + +--- a/netstat.c ++++ b/netstat.c +@@ -88,6 +88,7 @@ + #include <sys/stat.h> + #include <net/if.h> + #include <dirent.h> ++#include <sys/types.h> + + #include "net-support.h" + #include "pathnames.h" diff --git a/poky/meta/recipes-extended/net-tools/net-tools/Bug_443075-ifconfig.c-pointtopoint_spelling.patch b/poky/meta/recipes-extended/net-tools/net-tools/Bug_443075-ifconfig.c-pointtopoint_spelling.patch new file mode 100644 index 000000000..74d74668c --- /dev/null +++ b/poky/meta/recipes-extended/net-tools/net-tools/Bug_443075-ifconfig.c-pointtopoint_spelling.patch @@ -0,0 +1,26 @@ +Description: Accept "pointtopoint" as a synonym for "pointopoint" +Bug-Debian: https://bugs.debian.org/443075 +Author: Justin Pryzby <pryzbyj@libra> + +Upstream-Status: Pending +Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> + +--- a/ifconfig.c ++++ b/ifconfig.c +@@ -644,14 +644,14 @@ + spp++; + continue; + } +- if (!strcmp(*spp, "-pointopoint")) { ++ if (!strcmp(*spp, "-pointopoint") || !strcmp(*spp, "-pointtopoint")) { + goterr |= clr_flag(ifr.ifr_name, IFF_POINTOPOINT); + spp++; + if (test_flag(ifr.ifr_name, IFF_POINTOPOINT) > 0) + fprintf(stderr, _("Warning: Interface %s still in POINTOPOINT mode.\n"), ifr.ifr_name); + continue; + } +- if (!strcmp(*spp, "pointopoint")) { ++ if (!strcmp(*spp, "pointopoint") || !strcmp(*spp, "pointtopoint")) { + if (*(spp + 1) != NULL) { + spp++; + safe_strncpy(host, *spp, (sizeof host)); diff --git a/poky/meta/recipes-extended/net-tools/net-tools/Bug_541172-netstat.c-exit-codes.patch b/poky/meta/recipes-extended/net-tools/net-tools/Bug_541172-netstat.c-exit-codes.patch new file mode 100644 index 000000000..782b94bc6 --- /dev/null +++ b/poky/meta/recipes-extended/net-tools/net-tools/Bug_541172-netstat.c-exit-codes.patch @@ -0,0 +1,22 @@ +Description: Bug#541172: netstat.c exit codes + +Upstream-Status: Pending +Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> + +--- a/netstat.c ++++ b/netstat.c +@@ -2237,12 +2237,14 @@ + parsesnmp(flag_raw, flag_tcp, flag_udp, flag_sctp); + #else + ENOSUPP("netstat", "AF INET"); ++ exit(1); + #endif + } else if(!strcmp(afname, "inet6")) { + #if HAVE_AFINET6 + parsesnmp6(flag_raw, flag_tcp, flag_udp); + #else + ENOSUPP("netstat", "AF INET6"); ++ exit(1); + #endif + } else { + printf(_("netstat: No statistics support for specified address family: %s\n"), afname); diff --git a/poky/meta/recipes-extended/net-tools/net-tools/ifconfig-interface-0-del-IP-will-remove-the-aliased-.patch b/poky/meta/recipes-extended/net-tools/net-tools/ifconfig-interface-0-del-IP-will-remove-the-aliased-.patch deleted file mode 100644 index 06f81420e..000000000 --- a/poky/meta/recipes-extended/net-tools/net-tools/ifconfig-interface-0-del-IP-will-remove-the-aliased-.patch +++ /dev/null @@ -1,32 +0,0 @@ -From 81814dc2b14843009193efd307d814c26baa61f0 Mon Sep 17 00:00:00 2001 -From: Jiri Popelka <jpopelka@redhat.com> -Date: Wed, 7 Dec 2011 19:14:09 +0100 -Subject: [PATCH] ifconfig interface:0 del <IP> will remove the aliased IP on IA64 - -Upstream-Status: Backport - -commit 81814dc2b14843009193efd307d814c26baa61f0 from -git://git.code.sf.net/p/net-tools/code - ---- - ifconfig.c | 4 +++- - 1 file changed, 3 insertions(+), 1 deletion(-) - -diff --git a/ifconfig.c b/ifconfig.c -index bc405c6..dae8922 100644 ---- a/ifconfig.c -+++ b/ifconfig.c -@@ -890,7 +890,9 @@ int main(int argc, char **argv) - continue; - } - -- memcpy(&ip, &sin.sin_addr.s_addr, sizeof(unsigned long)); -+ /* Clear "ip" in case sizeof(unsigned long) > sizeof(sin.sin_addr.s_addr) */ -+ ip = 0; -+ memcpy(&ip, &sin.sin_addr.s_addr, sizeof(sin.sin_addr.s_addr)); - - if (get_nmbc_parent(ifr.ifr_name, &nm, &bc) < 0) { - fprintf(stderr, _("Interface %s not initialized\n"), --- -1.7.9.5 - diff --git a/poky/meta/recipes-extended/net-tools/net-tools/musl-fixes.patch b/poky/meta/recipes-extended/net-tools/net-tools/musl-fixes.patch deleted file mode 100644 index f694d594b..000000000 --- a/poky/meta/recipes-extended/net-tools/net-tools/musl-fixes.patch +++ /dev/null @@ -1,100 +0,0 @@ -Adjust headers for non-glibc cases -especially exposed by musl - -Signed-off-by: Khem Raj <raj.khem@gmail.com> -Upstream-Status: Pending - -Index: net-tools-1.60/lib/inet6_gr.c -=================================================================== ---- net-tools-1.60.orig/lib/inet6_gr.c -+++ net-tools-1.60/lib/inet6_gr.c -@@ -23,7 +23,7 @@ - #include <string.h> - #include <stdio.h> - #include <unistd.h> --#ifndef __GLIBC__ -+#ifdef HAVE_IPV6_ROUTE_H - #include <netinet6/ipv6_route.h> /* glibc doesn't have this */ - #endif - #include "version.h" -Index: net-tools-1.60/lib/inet6_sr.c -=================================================================== ---- net-tools-1.60.orig/lib/inet6_sr.c -+++ net-tools-1.60/lib/inet6_sr.c -@@ -23,10 +23,10 @@ - #include <string.h> - #include <stdio.h> - #include <unistd.h> --#ifdef __GLIBC__ --#include <net/route.h> --#else -+#ifdef HAVE_IPV6_ROUTE_H - #include <netinet6/ipv6_route.h> /* glibc does not have this */ -+#else -+#include <net/route.h> - #endif - #include "version.h" - #include "net-support.h" -Index: net-tools-1.60/lib/inet_sr.c -=================================================================== ---- net-tools-1.60.orig/lib/inet_sr.c -+++ net-tools-1.60/lib/inet_sr.c -@@ -26,6 +26,7 @@ - #include <string.h> - #include <stdio.h> - #include <unistd.h> -+#include <asm-generic/param.h> - #include "version.h" - #include "net-support.h" - #include "pathnames.h" -Index: net-tools-1.60/lib/util-ank.c -=================================================================== ---- net-tools-1.60.orig/lib/util-ank.c -+++ net-tools-1.60/lib/util-ank.c -@@ -14,6 +14,7 @@ - * Rani Assaf <rani@magic.metawire.com> 980929: resolve addresses - */ - -+#include <limits.h> - #include <stdio.h> - #include <stdlib.h> - #include <unistd.h> -Index: net-tools-1.60/mii-tool.c -=================================================================== ---- net-tools-1.60.orig/mii-tool.c -+++ net-tools-1.60/mii-tool.c -@@ -47,10 +47,6 @@ static char Version[] = "$Id: mii-tool.c - #include <net/if.h> - #include <linux/sockios.h> - --#ifndef __GLIBC__ --#include <linux/if_arp.h> --#include <linux/if_ether.h> --#endif - #include "mii.h" - #include "version.h" - -Index: net-tools-1.60/netstat.c -=================================================================== ---- net-tools-1.60.orig/netstat.c -+++ net-tools-1.60/netstat.c -@@ -87,6 +87,7 @@ - #include <dirent.h> - #include <sys/stat.h> - #include <sys/types.h> -+#include <asm-generic/param.h> - - #include "net-support.h" - #include "pathnames.h" -Index: net-tools-1.60/slattach.c -=================================================================== ---- net-tools-1.60.orig/slattach.c -+++ net-tools-1.60/slattach.c -@@ -44,6 +44,7 @@ - #include <string.h> - #include <unistd.h> - #include <getopt.h> -+#include <termios.h> - #include <linux/if_slip.h> - - #if defined(__GLIBC__) diff --git a/poky/meta/recipes-extended/net-tools/net-tools/net-tools-1.60-sctp1.patch b/poky/meta/recipes-extended/net-tools/net-tools/net-tools-1.60-sctp1.patch deleted file mode 100644 index 78daf6c3e..000000000 --- a/poky/meta/recipes-extended/net-tools/net-tools/net-tools-1.60-sctp1.patch +++ /dev/null @@ -1,635 +0,0 @@ -From 23276afe270009420cfbc52bffafdd25ac0817fe Mon Sep 17 00:00:00 2001 -From: Li Zhou <li.zhou@windriver.com> -Date: Thu, 14 Jan 2016 17:01:29 +0800 -Subject: [PATCH 1/3] net-tools: add SCTP support for netstat - -Upstream-Status: pending - -Signed-off-by: Li Zhou <li.zhou@windriver.com> ---- - netstat.c | 411 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++-- - statistics.c | 68 +++++++++- - 2 files changed, 465 insertions(+), 14 deletions(-) - -Index: net-tools-1.60/netstat.c -=================================================================== ---- net-tools-1.60.orig/netstat.c -+++ net-tools-1.60/netstat.c -@@ -58,6 +58,7 @@ - * - *990420 {1.38} Tuan Hoang removed a useless assignment from igmp_do_one() - *20010404 {1.39} Arnaldo Carvalho de Melo - use setlocale -+ *20050516 {1.40} Ivan Skytte Joergensen:Added SCTP support - * - * This program is free software; you can redistribute it - * and/or modify it under the terms of the GNU General -@@ -106,7 +107,7 @@ - #endif - - /* prototypes for statistics.c */ --void parsesnmp(int, int, int); -+void parsesnmp(int, int, int, int); - void inittab(void); - void parsesnmp6(int, int, int); - void inittab6(void); -@@ -119,6 +120,28 @@ typedef enum { - SS_DISCONNECTING /* in process of disconnecting */ - } socket_state; - -+#define SCTP_NSTATES 9 /* The number of states in array*/ -+ -+static const char *sctp_state[] = { -+ N_("EMPTY"), -+ N_("CLOSED"), -+ N_("COOKIE_WAIT"), -+ N_("COOKIE_ECHOED"), -+ N_("ESTABLISHED"), -+ N_("SHUTDOWN_PENDING"), -+ N_("SHUTDOWN_SENT"), -+ N_("SHUTDOWN_RECEIVED"), -+ N_("SHUTDOWN_ACK_SENT") -+}; -+ -+#define SCTP_NTYPES 3 /* The number of types in array */ -+ -+static const char *sctp_type[] = { -+ N_("udp"), -+ N_("udp-high-bw"), -+ N_("tcp") -+}; -+ - #define SO_ACCEPTCON (1<<16) /* performed a listen */ - #define SO_WAITDATA (1<<17) /* wait data to read */ - #define SO_NOSPACE (1<<18) /* no space to write */ -@@ -149,6 +172,7 @@ int flag_opt = 0; - int flag_raw = 0; - int flag_tcp = 0; - int flag_udp = 0; -+int flag_sctp= 0; - int flag_igmp= 0; - int flag_rom = 0; - int flag_exp = 1; -@@ -995,6 +1019,365 @@ static int udp_info(void) - udp_do_one); - } - -+static const char *sctp_socket_type_str(int type) { -+ if(type>=0 && type<SCTP_NTYPES) -+ return sctp_type[type]; -+ else { -+ static char type_str_buf[64]; -+ sprintf(type_str_buf,"UNKNOWN(%d)",type); -+ return type_str_buf; -+ } -+} -+ -+static const char *sctp_state_str(int state) -+{ -+ if(state>=0 && state<SCTP_NSTATES) -+ return sctp_state[state]; -+ else { -+ static char state_str_buf[64]; -+ sprintf(state_str_buf,"UNKNOWN(%d)",state); -+ return state_str_buf; -+ } -+} -+ -+static const char *sctp_socket_state_str(int state) -+{ -+ if(state>=0 && state<=10) -+ return tcp_state[state]; -+ else { -+ static char state_str_buf[64]; -+ sprintf(state_str_buf,"UNKNOWN(%d)",state); -+ return state_str_buf; -+ } -+} -+ -+static struct aftype *process_sctp_addr_str(const char *addr_str, struct sockaddr *sa) -+{ -+ if (strchr(addr_str,':')) { -+#if HAVE_AFINET6 -+ extern struct aftype inet6_aftype; -+ /* Demangle what the kernel gives us */ -+ struct in6_addr in6; -+ char addr6_str[INET6_ADDRSTRLEN]; -+ unsigned u0,u1,u2,u3,u4,u5,u6,u7; -+ sscanf(addr_str, "%04X:%04X:%04X:%04X:%04X:%04X:%04X:%04X", -+ &u0, &u1, &u2, &u3, &u4, &u5, &u6, &u7); -+ in6.s6_addr16[0] = htons(u0); -+ in6.s6_addr16[1] = htons(u1); -+ in6.s6_addr16[2] = htons(u2); -+ in6.s6_addr16[3] = htons(u3); -+ in6.s6_addr16[4] = htons(u4); -+ in6.s6_addr16[5] = htons(u5); -+ in6.s6_addr16[6] = htons(u6); -+ in6.s6_addr16[7] = htons(u7); -+ -+ inet_ntop(AF_INET6, &in6, addr6_str, sizeof(addr6_str)); -+ inet6_aftype.input(1, addr6_str, sa); -+ sa->sa_family = AF_INET6; -+#endif -+ } else { -+ ((struct sockaddr_in*)sa)->sin_addr.s_addr = inet_addr(addr_str); -+ sa->sa_family = AF_INET; -+ } -+ return get_afntype(sa->sa_family); -+} -+ -+static void sctp_eps_do_one(int lnr, char *line) -+{ -+ char buffer[1024]; -+ int type, state, port; -+ int uid; -+ unsigned long inode; -+ -+ struct aftype *ap; -+#if HAVE_AFINET6 -+ struct sockaddr_in6 localaddr; -+#else -+ struct sockaddr_in localaddr; -+#endif -+ const char *sty_str; -+ const char *sst_str; -+ const char *lport_str; -+ const char *uid_str; -+ const char *inode_str; -+ const char *pladdr_str; -+ char *laddrs_str; -+ -+ if(lnr == 0) { -+ /* ENDPT SOCK STY SST HBKT LPORT uid inode pladdr LADDRS*/ -+ return; -+ } -+ -+ strtok(line," \t\n"); /*skip ptr*/ -+ strtok(0," \t\n"); /*skip ptr*/ -+ sty_str = strtok(0," \t\n"); -+ sst_str = strtok(0," \t\n"); -+ strtok(0," \t\n"); /*skip hash bucket*/ -+ lport_str=strtok(0," \t\n"); -+ uid_str = strtok(0," \t\n"); -+ inode_str = strtok(0," \t\n"); -+ pladdr_str = strtok(0," \t\n"); -+ laddrs_str=strtok(0,"\t\n"); -+ -+ type = atoi(sty_str); -+ state = atoi(sst_str); -+ port = atoi(lport_str); -+ uid = atoi(uid_str); -+ inode = strtoul(inode_str,0,0); -+ -+ if(flag_sctp<=1) { -+ /* only print the primary address */ -+ char local_addr[64]; -+ char local_port[16]; -+ -+ ap = process_sctp_addr_str(pladdr_str, (struct sockaddr*)&localaddr); -+ if(ap) -+ safe_strncpy(local_addr, -+ ap->sprint((struct sockaddr *) &localaddr, flag_not), -+ sizeof(local_addr)); -+ else -+ sprintf(local_addr,_("unsupported address family %d"), ((struct sockaddr*)&localaddr)->sa_family); -+ -+ snprintf(local_port, sizeof(local_port), "%s", -+ get_sname(htons(port), "sctp", -+ flag_not & FLAG_NUM_PORT)); -+ -+ printf("sctp "); -+ sprintf(buffer,"%s:%s", local_addr, local_port); -+ printf("%-47s", buffer); -+ printf(" %-12s", sctp_socket_state_str(state)); -+ } else { -+ /*print all addresses*/ -+ const char *this_local_addr; -+ int first=1; -+ char local_port[16]; -+ snprintf(local_port, sizeof(local_port), "%s", -+ get_sname(htons(port), "sctp", -+ flag_not & FLAG_NUM_PORT)); -+ for(this_local_addr=strtok(laddrs_str," \t\n"); -+ this_local_addr; -+ this_local_addr=strtok(0," \t\n")) -+ { -+ char local_addr[64]; -+ ap = process_sctp_addr_str(this_local_addr, (struct sockaddr*)&localaddr); -+ if(ap) -+ safe_strncpy(local_addr, -+ ap->sprint((struct sockaddr *) &localaddr, flag_not), -+ sizeof(local_addr)); -+ else -+ sprintf(local_addr,_("unsupported address family %d"), ((struct sockaddr*)&localaddr)->sa_family); -+ -+ if(!first) printf("\n"); -+ if(first) -+ printf("sctp "); -+ else -+ printf(" "); -+ sprintf(buffer,"%s:%s", local_addr, local_port); -+ printf("%-47s", buffer); -+ printf(" %-12s", first?sctp_socket_state_str(state):""); -+ first = 0; -+ } -+ } -+ -+ finish_this_one(uid,inode,""); -+} -+ -+static void sctp_assoc_do_one(int lnr, char *line) -+{ -+ char buffer[1024]; -+ int type, state, state2, lport,rport; -+ int uid; -+ unsigned rxqueue,txqueue; -+ unsigned long inode; -+ -+ struct aftype *ap; -+#if HAVE_AFINET6 -+ struct sockaddr_in6 localaddr,remoteaddr; -+#else -+ struct sockaddr_in localaddr,remoteaddr; -+#endif -+ const char *sty_str; -+ const char *sst_str; -+ const char *st_str; -+ const char *txqueue_str; -+ const char *rxqueue_str; -+ const char *lport_str,*rport_str; -+ const char *uid_str; -+ const char *inode_str; -+ const char *pladdr_str; -+ char *laddrs_str; -+ const char *praddr_str; -+ char *raddrs_str; -+ -+ if(lnr == 0) { -+ /* ASSOC SOCK STY SST ST HBKT tx_queue rx_queue uid inode LPORT RPORT pladdr praddr LADDRS <-> RADDRS*/ -+ return; -+ } -+ -+ strtok(line," \t\n"); /*skip ptr*/ -+ strtok(0," \t\n"); /*skip ptr*/ -+ sty_str = strtok(0," \t\n"); -+ sst_str = strtok(0," \t\n"); -+ st_str = strtok(0," \t\n"); -+ strtok(0," \t\n"); /*skip hash bucket*/ -+ txqueue_str = strtok(0," \t\n"); -+ rxqueue_str = strtok(0," \t\n"); -+ uid_str = strtok(0," \t\n"); -+ inode_str = strtok(0," \t\n"); -+ lport_str=strtok(0," \t\n"); -+ rport_str=strtok(0," \t\n"); -+ pladdr_str = strtok(0," \t\n"); -+ praddr_str = strtok(0," \t\n"); -+ laddrs_str=strtok(0,"<->\t\n"); -+ raddrs_str=strtok(0,"<->\t\n"); -+ -+ type = atoi(sty_str); -+ state = atoi(sst_str); -+ state2 = atoi(st_str); -+ txqueue = atoi(txqueue_str); -+ rxqueue = atoi(rxqueue_str); -+ uid = atoi(uid_str); -+ inode = strtoul(inode_str,0,0); -+ lport = atoi(lport_str); -+ rport = atoi(rport_str); -+ -+ if(flag_sctp<=1) { -+ /* only print the primary addresses */ -+ char local_addr[64]; -+ char local_port[16]; -+ char remote_addr[64]; -+ char remote_port[16]; -+ -+ ap = process_sctp_addr_str(pladdr_str, (struct sockaddr*)&localaddr); -+ if(ap) -+ safe_strncpy(local_addr, -+ ap->sprint((struct sockaddr *) &localaddr, flag_not), -+ sizeof(local_addr)); -+ else -+ sprintf(local_addr,_("unsupported address family %d"), ((struct sockaddr*)&localaddr)->sa_family); -+ -+ snprintf(local_port, sizeof(local_port), "%s", -+ get_sname(htons(lport), "sctp", -+ flag_not & FLAG_NUM_PORT)); -+ -+ ap = process_sctp_addr_str(praddr_str, (struct sockaddr*)&remoteaddr); -+ if(ap) -+ safe_strncpy(remote_addr, -+ ap->sprint((struct sockaddr *) &remoteaddr, flag_not), -+ sizeof(remote_addr)); -+ else -+ sprintf(remote_addr,_("unsupported address family %d"), ((struct sockaddr*)&remoteaddr)->sa_family); -+ -+ snprintf(remote_port, sizeof(remote_port), "%s", -+ get_sname(htons(rport), "sctp", -+ flag_not & FLAG_NUM_PORT)); -+ -+ printf("sctp"); -+ printf(" %6u %6u ", rxqueue, txqueue); -+ sprintf(buffer,"%s:%s", local_addr, local_port); -+ printf("%-23s", buffer); -+ printf(" "); -+ sprintf(buffer,"%s:%s", remote_addr, remote_port); -+ printf("%-23s", buffer); -+ printf(" %-12s", sctp_socket_state_str(state)); -+ } else { -+ /*print all addresses*/ -+ const char *this_local_addr; -+ const char *this_remote_addr; -+ char *ss1,*ss2; -+ int first=1; -+ char local_port[16]; -+ char remote_port[16]; -+ snprintf(local_port, sizeof(local_port), "%s", -+ get_sname(htons(lport), "sctp", -+ flag_not & FLAG_NUM_PORT)); -+ snprintf(remote_port, sizeof(remote_port), "%s", -+ get_sname(htons(rport), "sctp", -+ flag_not & FLAG_NUM_PORT)); -+ -+ this_local_addr=strtok_r(laddrs_str," \t\n",&ss1); -+ this_remote_addr=strtok_r(raddrs_str," \t\n",&ss2); -+ while(this_local_addr || this_remote_addr) { -+ char local_addr[64]; -+ char remote_addr[64]; -+ if(this_local_addr) { -+ ap = process_sctp_addr_str(this_local_addr, (struct sockaddr*)&localaddr); -+ if(ap) -+ safe_strncpy(local_addr, -+ ap->sprint((struct sockaddr *) &localaddr, flag_not), -+ sizeof(local_addr)); -+ else -+ sprintf(local_addr,_("unsupported address family %d"), ((struct sockaddr*)&localaddr)->sa_family); -+ } -+ if(this_remote_addr) { -+ ap = process_sctp_addr_str(this_remote_addr, (struct sockaddr*)&remoteaddr); -+ if(ap) -+ safe_strncpy(remote_addr, -+ ap->sprint((struct sockaddr *) &remoteaddr, flag_not), -+ sizeof(remote_addr)); -+ else -+ sprintf(remote_addr,_("unsupported address family %d"), ((struct sockaddr*)&remoteaddr)->sa_family); -+ } -+ -+ if(!first) printf("\n"); -+ if(first) -+ printf("sctp %6u %6u ", rxqueue, txqueue); -+ else -+ printf(" "); -+ if(this_local_addr) { -+ if(first) -+ sprintf(buffer,"%s:%s", local_addr, local_port); -+ else -+ sprintf(buffer,"%s", local_addr); -+ printf("%-23s", buffer); -+ } else -+ printf("%-23s", ""); -+ printf(" "); -+ if(this_remote_addr) { -+ if(first) -+ sprintf(buffer,"%s:%s", remote_addr, remote_port); -+ else -+ sprintf(buffer,"%s", remote_addr); -+ printf("%-23s", buffer); -+ } else -+ printf("%-23s", ""); -+ -+ printf(" %-12s", first?sctp_socket_state_str(state):""); -+ -+ first = 0; -+ this_local_addr=strtok_r(0," \t\n",&ss1); -+ this_remote_addr=strtok_r(0," \t\n",&ss2); -+ } -+ } -+ -+ finish_this_one(uid,inode,""); -+} -+ -+static int sctp_info_eps(void) -+{ -+#if !defined(_PATH_PROCNET_SCTP_EPS) -+#define _PATH_PROCNET_SCTP_EPS "/proc/net/sctp/eps" -+#endif -+ INFO_GUTS(_PATH_PROCNET_SCTP_EPS, "AF INET (sctp)", -+ sctp_eps_do_one); -+} -+ -+static int sctp_info_assocs(void) -+{ -+#if !defined(_PATH_PROCNET_SCTP_ASSOCS) -+#define _PATH_PROCNET_SCTP_ASSOCS "/proc/net/sctp/assocs" -+#endif -+ INFO_GUTS(_PATH_PROCNET_SCTP_ASSOCS, "AF INET (sctp)", -+ sctp_assoc_do_one); -+} -+ -+static int sctp_info(void) -+{ -+ if(flag_all) -+ sctp_info_eps(); -+ return sctp_info_assocs(); -+} -+ - static void raw_do_one(int lnr, const char *line) - { - char buffer[8192], local_addr[64], rem_addr[64]; -@@ -1558,7 +1941,7 @@ static void usage(void) - fprintf(stderr, _(" -F, --fib display Forwarding Information Base (default)\n")); - fprintf(stderr, _(" -C, --cache display routing cache instead of FIB\n\n")); - -- fprintf(stderr, _(" <Socket>={-t|--tcp} {-u|--udp} {-w|--raw} {-x|--unix} --ax25 --ipx --netrom\n")); -+ fprintf(stderr, _(" <Socket>={-t|--tcp} {-u|--udp} {-S|--sctp} {-w|--raw} {-x|--unix} --ax25 --ipx --netrom\n")); - fprintf(stderr, _(" <AF>=Use '-6|-4' or '-A <af>' or '--<af>'; default: %s\n"), DFLT_AF); - fprintf(stderr, _(" List of possible address families (which support routing):\n")); - print_aflist(1); /* 1 = routeable */ -@@ -1583,6 +1966,7 @@ int main - {"protocol", 1, 0, 'A'}, - {"tcp", 0, 0, 't'}, - {"udp", 0, 0, 'u'}, -+ {"sctp", 0, 0, 'S' }, - {"raw", 0, 0, 'w'}, - {"unix", 0, 0, 'x'}, - {"listening", 0, 0, 'l'}, -@@ -1613,7 +1997,7 @@ int main - getroute_init(); /* Set up AF routing support */ - - afname[0] = '\0'; -- while ((i = getopt_long(argc, argv, "MCFA:acdegphinNorstuWVv?wxl64", longopts, &lop)) != EOF) -+ while ((i = getopt_long(argc, argv, "MCFA:acdegphinNorstuSWVv?wxl64", longopts, &lop)) != EOF) - switch (i) { - case -1: - break; -@@ -1705,10 +2089,12 @@ int main - case 't': - flag_tcp++; - break; -- - case 'u': - flag_udp++; - break; -+ case 'S': -+ flag_sctp++; -+ break; - case 'w': - flag_raw++; - break; -@@ -1726,13 +2112,13 @@ int main - if (flag_int + flag_rou + flag_mas + flag_sta > 1) - usage(); - -- if ((flag_inet || flag_inet6 || flag_sta) && !(flag_tcp || flag_udp || flag_raw)) -- flag_tcp = flag_udp = flag_raw = 1; -+ if ((flag_inet || flag_inet6 || flag_sta) && !(flag_tcp || flag_udp || flag_sctp || flag_raw)) -+ flag_tcp = flag_udp = flag_sctp = flag_raw = 1; - -- if ((flag_tcp || flag_udp || flag_raw || flag_igmp) && !(flag_inet || flag_inet6)) -+ if ((flag_tcp || flag_udp || flag_sctp || flag_raw || flag_igmp) && !(flag_inet || flag_inet6)) - flag_inet = flag_inet6 = 1; - -- flag_arg = flag_tcp + flag_udp + flag_raw + flag_unx + flag_ipx -+ flag_arg = flag_tcp + flag_udp + flag_sctp + flag_raw + flag_unx + flag_ipx - + flag_ax25 + flag_netrom + flag_igmp + flag_x25; - - if (flag_mas) { -@@ -1760,7 +2146,7 @@ int main - char buf[256]; - if (!afname[0]) { - inittab(); -- parsesnmp(flag_raw, flag_tcp, flag_udp); -+ parsesnmp(flag_raw, flag_tcp, flag_udp, flag_sctp); - } else { - safe_strncpy(buf, afname, sizeof(buf)); - tmp1 = buf; -@@ -1815,7 +2201,7 @@ int main - return (i); - } - for (;;) { -- if (!flag_arg || flag_tcp || flag_udp || flag_raw) { -+ if (!flag_arg || flag_tcp || flag_udp || flag_sctp || flag_raw) { - #if HAVE_AFINET - prg_cache_load(); - printf(_("Active Internet connections ")); /* xxx */ -@@ -1854,6 +2240,11 @@ int main - if (i) - return (i); - } -+ if (!flag_arg || flag_sctp) { -+ i = sctp_info(); -+ if (i) -+ return (i); -+ } - if (!flag_arg || flag_raw) { - i = raw_info(); - if (i) -Index: net-tools-1.60/statistics.c -=================================================================== ---- net-tools-1.60.orig/statistics.c -+++ net-tools-1.60/statistics.c -@@ -21,7 +21,7 @@ - #define UFWARN(x) - #endif - --int print_static,f_raw,f_tcp,f_udp,f_unknown = 1; -+int print_static,f_raw,f_tcp,f_udp,f_sctp,f_unknown = 1; - - enum State { - number = 0, opt_number, i_forward, i_inp_icmp, i_outp_icmp, i_rto_alg, -@@ -297,6 +297,27 @@ struct entry Tcpexttab[] = - { "TCPRenoRecoveryFail", N_("%llu classic Reno fast retransmits failed"), opt_number }, - }; - -+struct entry Sctptab[] = -+{ -+ {"SctpCurrEstab", N_("%u Current Associations"), number}, -+ {"SctpActiveEstabs", N_("%u Active Associations"), number}, -+ {"SctpPassiveEstabs", N_("%u Passive Associations"), number}, -+ {"SctpAborteds", N_("%u Number of Aborteds "), number}, -+ {"SctpShutdowns", N_("%u Number of Graceful Terminations"), number}, -+ {"SctpOutOfBlues", N_("%u Number of Out of Blue packets"), number}, -+ {"SctpChecksumErrors", N_("%u Number of Packets with invalid Checksum"), number}, -+ {"SctpOutCtrlChunks", N_("%u Number of control chunks sent"), number}, -+ {"SctpOutOrderChunks", N_("%u Number of ordered chunks sent"), number}, -+ {"SctpOutUnorderChunks", N_("%u Number of Unordered chunks sent"), number}, -+ {"SctpInCtrlChunks", N_("%u Number of control chunks received"), number}, -+ {"SctpInOrderChunks", N_("%u Number of ordered chunks received"), number}, -+ {"SctpInUnorderChunks", N_("%u Number of Unordered chunks received"), number}, -+ {"SctpFragUsrMsgs", N_("%u Number of messages fragmented"), number}, -+ {"SctpReasmUsrMsgs", N_("%u Number of messages reassembled "), number}, -+ {"SctpOutSCTPPacks", N_("%u Number of SCTP packets sent"), number}, -+ {"SctpInSCTPPacks", N_("%u Number of SCTP packets received"), number}, -+}; -+ - struct tabtab { - char *title; - struct entry *tab; -@@ -310,6 +331,7 @@ struct tabtab snmptabs[] = - {"Icmp", Icmptab, sizeof(Icmptab), &f_raw}, - {"Tcp", Tcptab, sizeof(Tcptab), &f_tcp}, - {"Udp", Udptab, sizeof(Udptab), &f_udp}, -+ {"Sctp", Sctptab, sizeof(Sctptab), &f_sctp}, - {"TcpExt", Tcpexttab, sizeof(Tcpexttab), &f_tcp}, - {NULL} - }; -@@ -499,12 +521,40 @@ void process6_fd(FILE *f) - - } - --void parsesnmp(int flag_raw, int flag_tcp, int flag_udp) -+/* Process a file with name-value lines (like /proc/net/sctp/snmp) */ -+void process_fd2(FILE *f, const char *filename) -+{ -+ char buf1[1024]; -+ char *sp; -+ struct tabtab *tab; -+ -+ tab = newtable(snmptabs, "Sctp"); -+ -+ while (fgets(buf1, sizeof buf1, f)) { -+ sp = buf1 + strcspn(buf1, " \t\n"); -+ if (!sp) -+ goto formaterr; -+ *sp = '\0'; -+ sp++; -+ -+ sp += strspn(sp, " \t\n"); -+ -+ if (*sp != '\0' && *(tab->flag)) -+ printval(tab, buf1, strtoul(sp, 0, 10)); -+ } -+ return; -+ -+formaterr: -+ fprintf(stderr,_("error parsing %s\n"), filename); -+ return; -+} -+ -+void parsesnmp(int flag_raw, int flag_tcp, int flag_udp, int flag_sctp) - { - FILE *f; - -- f_raw = flag_raw; f_tcp = flag_tcp; f_udp = flag_udp; -- -+ f_raw = flag_raw; f_tcp = flag_tcp; f_udp = flag_udp; f_sctp = flag_sctp; -+ - f = proc_fopen("/proc/net/snmp"); - if (!f) { - perror(_("cannot open /proc/net/snmp")); -@@ -530,6 +580,16 @@ void parsesnmp(int flag_raw, int flag_tc - - fclose(f); - } -+ -+ f = fopen("/proc/net/sctp/snmp", "r"); -+ if (f) { -+ process_fd2(f,"/proc/net/sctp/snmp"); -+ if (ferror(f)) -+ perror("/proc/net/sctp/snmp"); -+ -+ fclose(f); -+ } -+ - return; - } - diff --git a/poky/meta/recipes-extended/net-tools/net-tools/net-tools-1.60-sctp2-quiet.patch b/poky/meta/recipes-extended/net-tools/net-tools/net-tools-1.60-sctp2-quiet.patch deleted file mode 100644 index d34e65132..000000000 --- a/poky/meta/recipes-extended/net-tools/net-tools/net-tools-1.60-sctp2-quiet.patch +++ /dev/null @@ -1,28 +0,0 @@ -From 14287b594e1f02b811f889fb515c1a51b72c08d4 Mon Sep 17 00:00:00 2001 -From: Li Zhou <li.zhou@windriver.com> -Date: Thu, 14 Jan 2016 17:07:48 +0800 -Subject: [PATCH 2/3] net-tools: add SCTP support for netstat - -Upstream-Status: pending - -Signed-off-by: Li Zhou <li.zhou@windriver.com> ---- - netstat.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/netstat.c b/netstat.c -index 5d1a4a1..56a15c2 100644 ---- a/netstat.c -+++ b/netstat.c -@@ -2104,7 +2104,7 @@ int main - usage(); - - if ((flag_inet || flag_inet6 || flag_sta) && !(flag_tcp || flag_udp || flag_sctp || flag_raw)) -- flag_tcp = flag_udp = flag_sctp = flag_raw = 1; -+ flag_tcp = flag_udp = flag_raw = 1; - - if ((flag_tcp || flag_udp || flag_sctp || flag_raw || flag_igmp) && !(flag_inet || flag_inet6)) - flag_inet = flag_inet6 = 1; --- -1.8.5.2.233.g932f7e4 - diff --git a/poky/meta/recipes-extended/net-tools/net-tools/net-tools-1.60-sctp3-addrs.patch b/poky/meta/recipes-extended/net-tools/net-tools/net-tools-1.60-sctp3-addrs.patch deleted file mode 100644 index 8b2ecab70..000000000 --- a/poky/meta/recipes-extended/net-tools/net-tools/net-tools-1.60-sctp3-addrs.patch +++ /dev/null @@ -1,363 +0,0 @@ -From 1d386279a449a1a6b96b88a71f35bf13b14b2c2c Mon Sep 17 00:00:00 2001 -From: Li Zhou <li.zhou@windriver.com> -Date: Thu, 14 Jan 2016 17:11:24 +0800 -Subject: [PATCH 3/3] net-tools: add SCTP support for netstat - -Upstream-Status: pending - -Signed-off-by: Li Zhou <li.zhou@windriver.com> ---- - netstat.c | 282 ++++++++++++++++++++++++-------------------------------------- - 1 file changed, 108 insertions(+), 174 deletions(-) - -diff --git a/netstat.c b/netstat.c -index 56a15c2..86adadb 100644 ---- a/netstat.c -+++ b/netstat.c -@@ -1095,23 +1095,21 @@ static void sctp_eps_do_one(int lnr, char *line) - const char *lport_str; - const char *uid_str; - const char *inode_str; -- const char *pladdr_str; - char *laddrs_str; - - if(lnr == 0) { -- /* ENDPT SOCK STY SST HBKT LPORT uid inode pladdr LADDRS*/ -+ /* ENDPT SOCK STY SST HBKT LPORT UID INODE LADDRS */ - return; - } - -- strtok(line," \t\n"); /*skip ptr*/ -- strtok(0," \t\n"); /*skip ptr*/ -+ strtok(line," \t\n"); /*skip endpt*/ -+ strtok(0," \t\n"); /*skip sock*/ - sty_str = strtok(0," \t\n"); - sst_str = strtok(0," \t\n"); - strtok(0," \t\n"); /*skip hash bucket*/ - lport_str=strtok(0," \t\n"); - uid_str = strtok(0," \t\n"); - inode_str = strtok(0," \t\n"); -- pladdr_str = strtok(0," \t\n"); - laddrs_str=strtok(0,"\t\n"); - - type = atoi(sty_str); -@@ -1119,61 +1117,35 @@ static void sctp_eps_do_one(int lnr, char *line) - port = atoi(lport_str); - uid = atoi(uid_str); - inode = strtoul(inode_str,0,0); -- -- if(flag_sctp<=1) { -- /* only print the primary address */ -- char local_addr[64]; -- char local_port[16]; -- -- ap = process_sctp_addr_str(pladdr_str, (struct sockaddr*)&localaddr); -- if(ap) -- safe_strncpy(local_addr, -- ap->sprint((struct sockaddr *) &localaddr, flag_not), -- sizeof(local_addr)); -- else -- sprintf(local_addr,_("unsupported address family %d"), ((struct sockaddr*)&localaddr)->sa_family); -- -- snprintf(local_port, sizeof(local_port), "%s", -- get_sname(htons(port), "sctp", -- flag_not & FLAG_NUM_PORT)); -- -- printf("sctp "); -- sprintf(buffer,"%s:%s", local_addr, local_port); -- printf("%-47s", buffer); -- printf(" %-12s", sctp_socket_state_str(state)); -- } else { -- /*print all addresses*/ -- const char *this_local_addr; -- int first=1; -- char local_port[16]; -- snprintf(local_port, sizeof(local_port), "%s", -- get_sname(htons(port), "sctp", -- flag_not & FLAG_NUM_PORT)); -- for(this_local_addr=strtok(laddrs_str," \t\n"); -- this_local_addr; -- this_local_addr=strtok(0," \t\n")) -- { -- char local_addr[64]; -- ap = process_sctp_addr_str(this_local_addr, (struct sockaddr*)&localaddr); -- if(ap) -- safe_strncpy(local_addr, -- ap->sprint((struct sockaddr *) &localaddr, flag_not), -- sizeof(local_addr)); -- else -- sprintf(local_addr,_("unsupported address family %d"), ((struct sockaddr*)&localaddr)->sa_family); - -- if(!first) printf("\n"); -- if(first) -- printf("sctp "); -- else -- printf(" "); -- sprintf(buffer,"%s:%s", local_addr, local_port); -- printf("%-47s", buffer); -- printf(" %-12s", first?sctp_socket_state_str(state):""); -- first = 0; -- } -+ const char *this_local_addr; -+ int first=1; -+ char local_port[16]; -+ snprintf(local_port, sizeof(local_port), "%s", -+ get_sname(htons(port), "sctp", flag_not & FLAG_NUM_PORT)); -+ for(this_local_addr=strtok(laddrs_str," \t\n"); -+ this_local_addr; -+ this_local_addr=strtok(0," \t\n")) -+ { -+ char local_addr[64]; -+ ap = process_sctp_addr_str(this_local_addr, (struct sockaddr*)&localaddr); -+ if(ap) -+ safe_strncpy(local_addr, -+ ap->sprint((struct sockaddr *) &localaddr, flag_not), -+ sizeof(local_addr)); -+ else -+ sprintf(local_addr,_("unsupported address family %d"), ((struct sockaddr*)&localaddr)->sa_family); -+ -+ if(!first) printf("\n"); -+ if(first) -+ printf("sctp "); -+ else -+ printf(" "); -+ sprintf(buffer,"%s:%s", local_addr, local_port); -+ printf("%-55s", buffer); -+ printf(" %-12s", first?sctp_socket_state_str(state):""); -+ first = 0; - } -- - finish_this_one(uid,inode,""); - } - -@@ -1199,32 +1171,29 @@ static void sctp_assoc_do_one(int lnr, char *line) - const char *lport_str,*rport_str; - const char *uid_str; - const char *inode_str; -- const char *pladdr_str; - char *laddrs_str; -- const char *praddr_str; - char *raddrs_str; -- -+ - if(lnr == 0) { -- /* ASSOC SOCK STY SST ST HBKT tx_queue rx_queue uid inode LPORT RPORT pladdr praddr LADDRS <-> RADDRS*/ -+ /* ASSOC SOCK STY SST ST HBKT ASSOC-ID TX_QUEUE RX_QUEUE UID INODE LPORT RPORT LADDRS <-> RADDRS */ - return; - } -- -- strtok(line," \t\n"); /*skip ptr*/ -- strtok(0," \t\n"); /*skip ptr*/ -+ -+ strtok(line," \t\n"); /*skip assoc*/ -+ strtok(0," \t\n"); /*skip sock*/ - sty_str = strtok(0," \t\n"); - sst_str = strtok(0," \t\n"); - st_str = strtok(0," \t\n"); - strtok(0," \t\n"); /*skip hash bucket*/ -+ strtok(0," \t\n"); /*skip hash assoc-id*/ - txqueue_str = strtok(0," \t\n"); - rxqueue_str = strtok(0," \t\n"); - uid_str = strtok(0," \t\n"); - inode_str = strtok(0," \t\n"); - lport_str=strtok(0," \t\n"); - rport_str=strtok(0," \t\n"); -- pladdr_str = strtok(0," \t\n"); -- praddr_str = strtok(0," \t\n"); -- laddrs_str=strtok(0,"<->\t\n"); -- raddrs_str=strtok(0,"<->\t\n"); -+ laddrs_str = strtok(0,"<->\t\n"); -+ raddrs_str = strtok(0,"<->\t\n"); - - type = atoi(sty_str); - state = atoi(sst_str); -@@ -1235,116 +1204,81 @@ static void sctp_assoc_do_one(int lnr, char *line) - inode = strtoul(inode_str,0,0); - lport = atoi(lport_str); - rport = atoi(rport_str); -- -- if(flag_sctp<=1) { -- /* only print the primary addresses */ -- char local_addr[64]; -- char local_port[16]; -- char remote_addr[64]; -- char remote_port[16]; -- -- ap = process_sctp_addr_str(pladdr_str, (struct sockaddr*)&localaddr); -- if(ap) -- safe_strncpy(local_addr, -- ap->sprint((struct sockaddr *) &localaddr, flag_not), -- sizeof(local_addr)); -- else -- sprintf(local_addr,_("unsupported address family %d"), ((struct sockaddr*)&localaddr)->sa_family); -- -- snprintf(local_port, sizeof(local_port), "%s", -- get_sname(htons(lport), "sctp", -- flag_not & FLAG_NUM_PORT)); -- -- ap = process_sctp_addr_str(praddr_str, (struct sockaddr*)&remoteaddr); -- if(ap) -- safe_strncpy(remote_addr, -- ap->sprint((struct sockaddr *) &remoteaddr, flag_not), -- sizeof(remote_addr)); -- else -- sprintf(remote_addr,_("unsupported address family %d"), ((struct sockaddr*)&remoteaddr)->sa_family); -- -- snprintf(remote_port, sizeof(remote_port), "%s", -- get_sname(htons(rport), "sctp", -- flag_not & FLAG_NUM_PORT)); -- -- printf("sctp"); -- printf(" %6u %6u ", rxqueue, txqueue); -- sprintf(buffer,"%s:%s", local_addr, local_port); -- printf("%-23s", buffer); -- printf(" "); -- sprintf(buffer,"%s:%s", remote_addr, remote_port); -- printf("%-23s", buffer); -- printf(" %-12s", sctp_socket_state_str(state)); -- } else { -- /*print all addresses*/ -- const char *this_local_addr; -- const char *this_remote_addr; -- char *ss1,*ss2; -- int first=1; -- char local_port[16]; -- char remote_port[16]; -- snprintf(local_port, sizeof(local_port), "%s", -- get_sname(htons(lport), "sctp", -- flag_not & FLAG_NUM_PORT)); -- snprintf(remote_port, sizeof(remote_port), "%s", -- get_sname(htons(rport), "sctp", -- flag_not & FLAG_NUM_PORT)); -- -- this_local_addr=strtok_r(laddrs_str," \t\n",&ss1); -- this_remote_addr=strtok_r(raddrs_str," \t\n",&ss2); -- while(this_local_addr || this_remote_addr) { -- char local_addr[64]; -- char remote_addr[64]; -- if(this_local_addr) { -- ap = process_sctp_addr_str(this_local_addr, (struct sockaddr*)&localaddr); -- if(ap) -- safe_strncpy(local_addr, -- ap->sprint((struct sockaddr *) &localaddr, flag_not), -- sizeof(local_addr)); -- else -- sprintf(local_addr,_("unsupported address family %d"), ((struct sockaddr*)&localaddr)->sa_family); -- } -- if(this_remote_addr) { -- ap = process_sctp_addr_str(this_remote_addr, (struct sockaddr*)&remoteaddr); -- if(ap) -- safe_strncpy(remote_addr, -- ap->sprint((struct sockaddr *) &remoteaddr, flag_not), -- sizeof(remote_addr)); -- else -- sprintf(remote_addr,_("unsupported address family %d"), ((struct sockaddr*)&remoteaddr)->sa_family); -- } - -- if(!first) printf("\n"); -- if(first) -- printf("sctp %6u %6u ", rxqueue, txqueue); -- else -- printf(" "); -- if(this_local_addr) { -- if(first) -- sprintf(buffer,"%s:%s", local_addr, local_port); -+ /*print all addresses*/ -+ const char *this_local_addr; -+ const char *this_remote_addr; -+ char *ss1,*ss2; -+ int first=1; -+ char local_port[16]; -+ char remote_port[16]; -+ snprintf(local_port, sizeof(local_port), "%s", -+ get_sname(htons(lport), "sctp", -+ flag_not & FLAG_NUM_PORT)); -+ snprintf(remote_port, sizeof(remote_port), "%s", -+ get_sname(htons(rport), "sctp", -+ flag_not & FLAG_NUM_PORT)); -+ -+ this_local_addr=strtok_r(laddrs_str," \t\n",&ss1); -+ this_remote_addr=strtok_r(raddrs_str," \t\n",&ss2); -+ while(this_local_addr || this_remote_addr) { -+ char local_addr[64]; -+ char remote_addr[64]; -+ -+ if(this_local_addr) { -+ if (this_local_addr[0] == '*') { -+ /* skip * */ -+ this_local_addr++; -+ } -+ ap = process_sctp_addr_str(this_local_addr, (struct sockaddr*)&localaddr); -+ if(ap) -+ safe_strncpy(local_addr, -+ ap->sprint((struct sockaddr *) &localaddr, flag_not), sizeof(local_addr)); - else -- sprintf(buffer,"%s", local_addr); -- printf("%-23s", buffer); -- } else -- printf("%-23s", ""); -- printf(" "); -- if(this_remote_addr) { -- if(first) -- sprintf(buffer,"%s:%s", remote_addr, remote_port); -+ sprintf(local_addr,_("unsupported address family %d"), ((struct sockaddr*)&localaddr)->sa_family); -+ } -+ if(this_remote_addr) { -+ if (this_remote_addr[0] == '*') { -+ /* skip * */ -+ this_remote_addr++; -+ } -+ ap = process_sctp_addr_str(this_remote_addr, (struct sockaddr*)&remoteaddr); -+ if(ap) -+ safe_strncpy(remote_addr, -+ ap->sprint((struct sockaddr *) &remoteaddr, flag_not), sizeof(remote_addr)); - else -- sprintf(buffer,"%s", remote_addr); -- printf("%-23s", buffer); -- } else -- printf("%-23s", ""); -- -- printf(" %-12s", first?sctp_socket_state_str(state):""); -+ sprintf(remote_addr,_("unsupported address family %d"), ((struct sockaddr*)&remoteaddr)->sa_family); -+ } - -- first = 0; -- this_local_addr=strtok_r(0," \t\n",&ss1); -- this_remote_addr=strtok_r(0," \t\n",&ss2); -- } -+ if(!first) printf("\n"); -+ if(first) -+ printf("sctp %6u %6u ", rxqueue, txqueue); -+ else -+ printf(" "); -+ if(this_local_addr) { -+ if(first) -+ sprintf(buffer,"%s:%s", local_addr, local_port); -+ else -+ sprintf(buffer,"%s", local_addr); -+ printf("%-27s", buffer); -+ } else -+ printf("%-27s", ""); -+ printf(" "); -+ if(this_remote_addr) { -+ if(first) -+ sprintf(buffer,"%s:%s", remote_addr, remote_port); -+ else -+ sprintf(buffer,"%s", remote_addr); -+ printf("%-27s", buffer); -+ } else -+ printf("%-27s", ""); -+ -+ printf(" %-12s", first?sctp_socket_state_str(state):""); -+ -+ first = 0; -+ this_local_addr=strtok_r(0," \t\n",&ss1); -+ this_remote_addr=strtok_r(0," \t\n",&ss2); - } -- - finish_this_one(uid,inode,""); - } - --- -1.8.5.2.233.g932f7e4 - diff --git a/poky/meta/recipes-extended/net-tools/net-tools/net-tools-fix-building-with-linux-4.8.patch b/poky/meta/recipes-extended/net-tools/net-tools/net-tools-fix-building-with-linux-4.8.patch deleted file mode 100644 index 505eeb048..000000000 --- a/poky/meta/recipes-extended/net-tools/net-tools/net-tools-fix-building-with-linux-4.8.patch +++ /dev/null @@ -1,52 +0,0 @@ -From 4d56645ea144a34f7cdd3e3ede6452d81fbae251 Mon Sep 17 00:00:00 2001 -From: Randy MacLeod <Randy.MacLeod@windriver.com> -Date: Sat, 8 Oct 2016 14:42:54 +0800 -Subject: [PATCH] iptunnel.c: include linux/ip.h to fix building with linux-4.8 - -Fix a build error when using the linux-4.8 headers that results in: - -In file included from -.../sysroots/qemuarm64/usr/include/linux/if_tunnel.h:6:0, - from iptunnel.c:39: -.../qemuarm64/usr/include/linux/ip.h:85:8: error: redefinition of -'struct iphdr' - struct iphdr { - ^~~~~ -In file included from iptunnel.c:29:0: -.../qemuarm64/usr/include/netinet/ip.h:44:8: note: originally defined here - struct iphdr - ^~~~~ - -Upstream-Status: Submitted [1] - -[1] https://sourceforge.net/p/net-tools/mailman/message/35413022/ - -Signed-off-by: Randy MacLeod <Randy.MacLeod@windriver.com> -Signed-off-by: Jackie Huang <jackie.huang@windriver.com> ---- - iptunnel.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/iptunnel.c b/iptunnel.c -index 4943d83..acfcbc7 100644 ---- a/iptunnel.c -+++ b/iptunnel.c -@@ -26,7 +26,6 @@ - #include <sys/socket.h> - #include <sys/ioctl.h> - #include <netinet/in.h> --#include <netinet/ip.h> - #include <arpa/inet.h> - #if defined(__GLIBC__) && (__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1)) - #include <net/if.h> -@@ -36,6 +35,7 @@ - #include <linux/if_arp.h> - #endif - #include <linux/types.h> -+#include <linux/ip.h> - #include <linux/if_tunnel.h> - - #include "config.h" --- -2.8.3 - diff --git a/poky/meta/recipes-extended/net-tools/net-tools_1.60-20181103.bb b/poky/meta/recipes-extended/net-tools/net-tools_1.60-20181103.bb new file mode 100644 index 000000000..e97731073 --- /dev/null +++ b/poky/meta/recipes-extended/net-tools/net-tools_1.60-20181103.bb @@ -0,0 +1,110 @@ +SUMMARY = "Basic networking tools" +DESCRIPTION = "A collection of programs that form the base set of the NET-3 networking distribution for the Linux operating system" +HOMEPAGE = "http://net-tools.berlios.de/" +BUGTRACKER = "http://bugs.debian.org/net-tools" +LICENSE = "GPLv2+" +LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263 \ + file://ifconfig.c;beginline=11;endline=15;md5=d1ca372080ad5401e23ca0afc35cf9ba" + +PV = "1.60-20181103+git${SRCPV}" +SRCREV = "0eebece8c964e3cfa8a018f42b2e7e751a7009a0" +SRC_URI = "git://git.code.sf.net/p/net-tools/code;protocol=https \ + file://net-tools-config.h \ + file://net-tools-config.make \ + file://Add_missing_headers.patch \ + file://Bug_443075-ifconfig.c-pointtopoint_spelling.patch \ + file://Bug_541172-netstat.c-exit-codes.patch \ +" + +UPSTREAM_VERSION_UNKNOWN = "1" + +S = "${WORKDIR}/git" + +inherit gettext + +# The Makefile is lame, no parallel build +PARALLEL_MAKE = "" + +PACKAGECONFIG ??= "hostname arp serial plip" +PACKAGECONFIG[hostname] = "" +PACKAGECONFIG[arp] = "" +PACKAGECONFIG[serial] = "" +PACKAGECONFIG[plip] = "" + +do_configure() { + # net-tools has its own config mechanism requiring "make config" + # we pre-generate desired options and copy to source directory instead + cp ${WORKDIR}/net-tools-config.h ${S}/config.h + cp ${WORKDIR}/net-tools-config.make ${S}/config.make + + if [ "${USE_NLS}" = "no" ]; then + sed -i -e 's/^I18N=1/# I18N=1/' ${S}/config.make + fi + + if ${@bb.utils.contains('PACKAGECONFIG', 'hostname', 'true', 'false', d)} ; then + echo "#define HAVE_HOSTNAME_TOOLS 1" >> ${S}/config.h + echo "#define HAVE_HOSTNAME_SYMLINKS 1" >> ${S}/config.h + echo "HAVE_HOSTNAME_TOOLS=1" >> ${S}/config.make + echo "HAVE_HOSTNAME_SYMLINKS=1" >> ${S}/config.make + fi + if ${@bb.utils.contains('PACKAGECONFIG', 'arp', 'true', 'false', d)} ; then + echo "#define HAVE_ARP_TOOLS 1" >> ${S}/config.h + echo "HAVE_ARP_TOOLS=1" >> ${S}/config.make + fi + if ${@bb.utils.contains('PACKAGECONFIG', 'serial', 'true', 'false', d)} ; then + echo "#define HAVE_SERIAL_TOOLS 1" >> ${S}/config.h + echo "HAVE_SERIAL_TOOLS=1" >> ${S}/config.make + fi + if ${@bb.utils.contains('PACKAGECONFIG', 'plip', 'true', 'false', d)} ; then + echo "#define HAVE_PLIP_TOOLS 1" >> ${S}/config.h + echo "HAVE_PLIP_TOOLS=1" >> ${S}/config.make + fi +} + +do_compile() { + # net-tools use COPTS/LOPTS to allow adding custom options + oe_runmake COPTS="$CFLAGS" LOPTS="$LDFLAGS" +} + +do_install() { + # We don't need COPTS or LOPTS, but let's be consistent. + oe_runmake COPTS="$CFLAGS" LOPTS="$LDFLAGS" BASEDIR=${D} INSTALLNLSDIR=${D}${datadir}/locale mandir=${mandir} install + + if [ "${base_bindir}" != "/bin" ]; then + mkdir -p ${D}/${base_bindir} + mv ${D}/bin/* ${D}/${base_bindir}/ + rmdir ${D}/bin + fi + if [ "${base_sbindir}" != "/sbin" ]; then + mkdir ${D}/${base_sbindir} + mv ${D}/sbin/* ${D}/${base_sbindir}/ + rmdir ${D}/sbin + fi +} + +inherit update-alternatives + +base_sbindir_progs = "ipmaddr iptunnel mii-tool nameif \ + ${@bb.utils.contains('PACKAGECONFIG', 'arp', 'arp rarp', '', d)} \ + ${@bb.utils.contains('PACKAGECONFIG', 'plip', 'plipconfig', '', d)} \ + ${@bb.utils.contains('PACKAGECONFIG', 'serial', 'slattach', '', d)} \ +" +base_bindir_progs = "ifconfig netstat route \ + ${@bb.utils.contains('PACKAGECONFIG', 'hostname', 'dnsdomainname domainname hostname nisdomainname ypdomainname', '', d)} \ +" + +ALTERNATIVE_${PN} = "${base_sbindir_progs} ${base_bindir_progs}" +ALTERNATIVE_${PN}-doc += "${@bb.utils.contains('PACKAGECONFIG', 'hostname', 'hostname.1 dnsdomainname.1', '', d)}" +ALTERNATIVE_LINK_NAME[hostname.1] = "${mandir}/man1/hostname.1" +ALTERNATIVE_LINK_NAME[dnsdomainname.1] = "${mandir}/man1/dnsdomainname.1" +ALTERNATIVE_PRIORITY[hostname.1] = "10" + +python __anonymous() { + for prog in d.getVar('base_sbindir_progs').split(): + d.setVarFlag('ALTERNATIVE_LINK_NAME', prog, '%s/%s' % (d.getVar('base_sbindir'), prog)) + for prog in d.getVar('base_bindir_progs').split(): + d.setVarFlag('ALTERNATIVE_LINK_NAME', prog, '%s/%s' % (d.getVar('base_bindir'), prog)) +} +ALTERNATIVE_PRIORITY = "100" + +BBCLASSEXTEND = "native nativesdk" diff --git a/poky/meta/recipes-extended/net-tools/net-tools_1.60-26.bb b/poky/meta/recipes-extended/net-tools/net-tools_1.60-26.bb deleted file mode 100644 index 8bd30fc6d..000000000 --- a/poky/meta/recipes-extended/net-tools/net-tools_1.60-26.bb +++ /dev/null @@ -1,132 +0,0 @@ -SUMMARY = "Basic networking tools" -DESCRIPTION = "A collection of programs that form the base set of the NET-3 networking distribution for the Linux operating system" -HOMEPAGE = "http://net-tools.berlios.de/" -BUGTRACKER = "http://bugs.debian.org/net-tools" -LICENSE = "GPLv2+" -LIC_FILES_CHKSUM = "file://COPYING;md5=8ca43cbc842c2336e835926c2166c28b \ - file://ifconfig.c;beginline=11;endline=15;md5=d1ca372080ad5401e23ca0afc35cf9ba" - -SRC_URI = "http://snapshot.debian.org/archive/debian/20050312T000000Z/pool/main/n/${BPN}/${BPN}_1.60.orig.tar.gz;name=tarball \ - http://snapshot.debian.org/archive/debian//20150831T093342Z/pool/main/n/${BPN}/${BPN}_${PV}.diff.gz;apply=no;name=patch \ - file://net-tools-config.h \ - file://net-tools-config.make \ - file://ifconfig-interface-0-del-IP-will-remove-the-aliased-.patch \ - file://musl-fixes.patch \ - file://net-tools-1.60-sctp1.patch \ - file://net-tools-1.60-sctp2-quiet.patch \ - file://net-tools-1.60-sctp3-addrs.patch \ - file://0001-lib-inet6.c-INET6_rresolve-various-fixes.patch \ - file://net-tools-fix-building-with-linux-4.8.patch \ - file://0001-added-ull-prefix-to-unsigned-long-long-constants-to-.patch \ - " - -# for this package we're mostly interested in tracking debian patches, -# and not in the upstream version where all development has effectively stopped -UPSTREAM_CHECK_REGEX = "(?P<pver>((\d+\.*)+)-((\d+\.*)+))\.(diff|debian\.tar)\.(gz|xz)" - -S = "${WORKDIR}/net-tools-1.60" - -SRC_URI[tarball.md5sum] = "ecaf37acb5b5daff4bdda77785fd916d" -SRC_URI[tarball.sha256sum] = "ec67967cf7b1a3a3828a84762fbc013ac50ee5dc9aa3095d5c591f302c2de0f5" - -SRC_URI[patch.md5sum] = "ea3592f49ac8380962bc4d9b66c7e7e9" -SRC_URI[patch.sha256sum] = "aeeeafaff68866a446f01bb639d4e0146a60af34dcd20e31a3e46585022fc76c" - -# the package is taken from snapshots.debian.org; that source is static and goes stale -# so we check the latest upstream from a directory that does get updated -UPSTREAM_CHECK_URI = "${DEBIAN_MIRROR}/main/n/net-tools/" - -inherit gettext - -do_patch[depends] += "quilt-native:do_populate_sysroot" - -# The Makefile is lame, no parallel build -PARALLEL_MAKE = "" - -# Unlike other Debian packages, net-tools *.diff.gz contains another series of -# patches maintained by quilt. So manually apply them before applying other local -# patches. Also remove all temp files before leaving, because do_patch() will pop -# up all previously applied patches in the start -nettools_do_patch() { - cd ${S} - # it's important that we only pop the existing patches when they've - # been applied, otherwise quilt will climb the directory tree - # and reverse out some completely different set of patches - if [ -d ${S}/patches ]; then - # whilst this is the default directory, doing it like this - # defeats the directory climbing that quilt will otherwise - # do; note the directory must exist to defeat this, hence - # the test inside which we operate - QUILT_PATCHES=${S}/patches quilt pop -a - fi - if [ -d ${S}/.pc-nettools ]; then - rm -rf ${S}/.pc - mv ${S}/.pc-nettools ${S}/.pc - QUILT_PATCHES=${S}/debian/patches quilt pop -a - rm -rf ${S}/.pc ${S}/debian - fi - patch -p1 < ${WORKDIR}/${BPN}_${PV}.diff - QUILT_PATCHES=${S}/debian/patches quilt push -a - mv ${S}/.pc ${S}/.pc-nettools -} - -do_unpack[cleandirs] += "${S}" - -# We invoke base do_patch at end, to incorporate any local patch -python do_patch() { - bb.build.exec_func('nettools_do_patch', d) - bb.build.exec_func('patch_do_patch', d) -} - -do_configure() { - # net-tools has its own config mechanism requiring "make config" - # we pre-generate desired options and copy to source directory instead - cp ${WORKDIR}/net-tools-config.h ${S}/config.h - cp ${WORKDIR}/net-tools-config.make ${S}/config.make - - if [ "${USE_NLS}" = "no" ]; then - sed -i -e 's/^I18N=1/# I18N=1/' ${S}/config.make - fi -} - -do_compile() { - # net-tools use COPTS/LOPTS to allow adding custom options - oe_runmake COPTS="$CFLAGS" LOPTS="$LDFLAGS" -} - -do_install() { - # We don't need COPTS or LOPTS, but let's be consistent. - oe_runmake COPTS="$CFLAGS" LOPTS="$LDFLAGS" BASEDIR=${D} INSTALLNLSDIR=${D}${datadir}/locale mandir=${mandir} install - - if [ "${base_bindir}" != "/bin" ]; then - mkdir -p ${D}/${base_bindir} - mv ${D}/bin/* ${D}/${base_bindir}/ - rmdir ${D}/bin - fi - if [ "${base_sbindir}" != "/sbin" ]; then - mkdir ${D}/${base_sbindir} - mv ${D}/sbin/* ${D}/${base_sbindir}/ - rmdir ${D}/sbin - fi -} - -inherit update-alternatives - -base_sbindir_progs = "arp ifconfig ipmaddr iptunnel mii-tool nameif plipconfig rarp route slattach" -base_bindir_progs = "dnsdomainname domainname hostname netstat nisdomainname ypdomainname" - -ALTERNATIVE_${PN} = "${base_sbindir_progs} ${base_bindir_progs}" -ALTERNATIVE_${PN}-doc += "hostname.1 dnsdomainname.1" -ALTERNATIVE_LINK_NAME[hostname.1] = "${mandir}/man1/hostname.1" -ALTERNATIVE_LINK_NAME[dnsdomainname.1] = "${mandir}/man1/dnsdomainname.1" -ALTERNATIVE_PRIORITY[hostname.1] = "10" - -python __anonymous() { - for prog in d.getVar('base_sbindir_progs').split(): - d.setVarFlag('ALTERNATIVE_LINK_NAME', prog, '%s/%s' % (d.getVar('base_sbindir'), prog)) - for prog in d.getVar('base_bindir_progs').split(): - d.setVarFlag('ALTERNATIVE_LINK_NAME', prog, '%s/%s' % (d.getVar('base_bindir'), prog)) -} -ALTERNATIVE_PRIORITY = "100" - -BBCLASSEXTEND = "native nativesdk" diff --git a/poky/meta/recipes-extended/pbzip2/pbzip2_1.1.13.bb b/poky/meta/recipes-extended/pbzip2/pbzip2_1.1.13.bb index e321cd2b2..d24035b67 100644 --- a/poky/meta/recipes-extended/pbzip2/pbzip2_1.1.13.bb +++ b/poky/meta/recipes-extended/pbzip2/pbzip2_1.1.13.bb @@ -28,4 +28,4 @@ do_install() { install -m 0755 pbzip2 ${D}${bindir}/ } -BBCLASSEXTEND = "native" +BBCLASSEXTEND = "native nativesdk" diff --git a/poky/meta/recipes-extended/stress-ng/stress-ng_0.11.15.bb b/poky/meta/recipes-extended/stress-ng/stress-ng_0.11.18.bb index 8ea0476db..c668d8cbd 100644 --- a/poky/meta/recipes-extended/stress-ng/stress-ng_0.11.15.bb +++ b/poky/meta/recipes-extended/stress-ng/stress-ng_0.11.18.bb @@ -9,7 +9,7 @@ SRC_URI = "https://kernel.ubuntu.com/~cking/tarballs/${BPN}/${BP}.tar.xz \ file://0001-Do-not-preserve-ownership-when-installing-example-jo.patch \ file://no_daddr_t.patch \ " -SRC_URI[sha256sum] = "6a333650fb5c85c5221f10d2cf890e9fc56530696e118d975fbbe96126c06963" +SRC_URI[sha256sum] = "07c82a5c89538b5b696a79192faa70d0232352004c9e532946f7f3613d0adf23" DEPENDS = "coreutils-native" @@ -22,5 +22,6 @@ inherit bash-completion do_install() { oe_runmake DESTDIR=${D} install + ln -s stress-ng ${D}${bindir}/stress } diff --git a/poky/meta/recipes-extended/sudo/sudo_1.9.1.bb b/poky/meta/recipes-extended/sudo/sudo_1.9.2.bb index d6bc1a9c3..5756b2e14 100644 --- a/poky/meta/recipes-extended/sudo/sudo_1.9.1.bb +++ b/poky/meta/recipes-extended/sudo/sudo_1.9.2.bb @@ -6,7 +6,7 @@ SRC_URI = "https://www.sudo.ws/dist/sudo-${PV}.tar.gz \ PAM_SRC_URI = "file://sudo.pam" -SRC_URI[sha256sum] = "294116cefe10a02773917fc7440d8384b925955bc96a6e0eaa1977c83b34adff" +SRC_URI[sha256sum] = "7c98d201f181c47152711b9f391e0f6b5545f3ef8926298a3e8bc6288e118314" DEPENDS += " virtual/crypt ${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'libpam', '', d)}" RDEPENDS_${PN} += " ${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'pam-plugin-limits pam-plugin-keyinit', '', d)}" |