Initial Commit
- initial default booting image
This commit is contained in:
35
package/liboping/0001-fix-utf8-support.patch
Normal file
35
package/liboping/0001-fix-utf8-support.patch
Normal file
@@ -0,0 +1,35 @@
|
||||
From dfbdd324769f542b6b89499c1b7f0f4322100bc6 Mon Sep 17 00:00:00 2001
|
||||
From: wfaulk <wfaulk@users.noreply.github.com>
|
||||
Date: Wed, 7 Aug 2019 18:57:43 -0400
|
||||
Subject: [PATCH] fix utf8 support
|
||||
|
||||
in oping.c:923 in has_utf8() the #if HAVE_NCURSESW_NCURSES_H is
|
||||
wrong. in consequence of this hist_symbols_utf8 is not used and the
|
||||
the graph type prettyping is not realy pretty. the name of the header
|
||||
file is curses.h see also oping.c:85 or the third changelog entry from
|
||||
1997/05/31
|
||||
|
||||
https://github.com/octo/liboping/issues/36
|
||||
|
||||
[Upstream: https://github.com/octo/liboping/pull/49/commits/a313923ec12d11daa8e70497c6b7b5d50965821b]
|
||||
Signed-off-by: Peter Seiderer <ps.report@gmx.net>
|
||||
---
|
||||
src/oping.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/oping.c b/src/oping.c
|
||||
index 87ca81a..62dbb67 100644
|
||||
--- a/src/oping.c
|
||||
+++ b/src/oping.c
|
||||
@@ -903,7 +903,7 @@ static void time_calc (struct timespec *ts_dest, /* {{{ */
|
||||
#if USE_NCURSES
|
||||
static _Bool has_utf8() /* {{{ */
|
||||
{
|
||||
-# if HAVE_NCURSESW_NCURSES_H
|
||||
+# if HAVE_NCURSESW_CURSES_H
|
||||
if (!opt_utf8)
|
||||
{
|
||||
/* Automatically determine */
|
||||
--
|
||||
2.25.1
|
||||
|
||||
@@ -0,0 +1,91 @@
|
||||
From ac878566eb935fd3ebfb804e6bd9e1690d4a65e3 Mon Sep 17 00:00:00 2001
|
||||
From: Tollef Fog Heen <tfheen@err.no>
|
||||
Date: Tue, 20 Mar 2018 22:40:32 +0100
|
||||
Subject: [PATCH] Open raw sockets when adding hosts, not when doing the
|
||||
pinging
|
||||
|
||||
This allows this to run as non-root again, without this, oping will
|
||||
have dropped privileges before trying to ping, which then fails to
|
||||
open the necessary raw sockets.
|
||||
|
||||
Fixes: #34
|
||||
|
||||
[Upstream: https://github.com/octo/liboping/pull/35/commits/a88c51f38dafa1fba9118045176754bec05d3c94]
|
||||
Signed-off-by: Peter Seiderer <ps.report@gmx.net>
|
||||
---
|
||||
src/liboping.c | 48 +++++++++++++++++-------------------------------
|
||||
1 file changed, 17 insertions(+), 31 deletions(-)
|
||||
|
||||
diff --git a/src/liboping.c b/src/liboping.c
|
||||
index 39b0041..f98e810 100644
|
||||
--- a/src/liboping.c
|
||||
+++ b/src/liboping.c
|
||||
@@ -1344,41 +1344,10 @@ int ping_send (pingobj_t *obj)
|
||||
struct timeval nowtime;
|
||||
struct timeval timeout;
|
||||
|
||||
- _Bool need_ipv4_socket = 0;
|
||||
- _Bool need_ipv6_socket = 0;
|
||||
-
|
||||
for (ptr = obj->head; ptr != NULL; ptr = ptr->next)
|
||||
{
|
||||
ptr->latency = -1.0;
|
||||
ptr->recv_ttl = -1;
|
||||
-
|
||||
- if (ptr->addrfamily == AF_INET)
|
||||
- need_ipv4_socket = 1;
|
||||
- else if (ptr->addrfamily == AF_INET6)
|
||||
- need_ipv6_socket = 1;
|
||||
- }
|
||||
-
|
||||
- if (!need_ipv4_socket && !need_ipv6_socket)
|
||||
- {
|
||||
- ping_set_error (obj, "ping_send", "No hosts to ping");
|
||||
- return (-1);
|
||||
- }
|
||||
-
|
||||
- if (need_ipv4_socket && obj->fd4 == -1)
|
||||
- {
|
||||
- obj->fd4 = ping_open_socket(obj, AF_INET);
|
||||
- if (obj->fd4 == -1)
|
||||
- return (-1);
|
||||
- ping_set_ttl (obj, obj->ttl);
|
||||
- ping_set_qos (obj, obj->qos);
|
||||
- }
|
||||
- if (need_ipv6_socket && obj->fd6 == -1)
|
||||
- {
|
||||
- obj->fd6 = ping_open_socket(obj, AF_INET6);
|
||||
- if (obj->fd6 == -1)
|
||||
- return (-1);
|
||||
- ping_set_ttl (obj, obj->ttl);
|
||||
- ping_set_qos (obj, obj->qos);
|
||||
}
|
||||
|
||||
if (gettimeofday (&nowtime, NULL) == -1)
|
||||
@@ -1698,6 +1667,23 @@ int ping_host_add (pingobj_t *obj, const char *host)
|
||||
ph->table_next = obj->table[ph->ident % PING_TABLE_LEN];
|
||||
obj->table[ph->ident % PING_TABLE_LEN] = ph;
|
||||
|
||||
+ if (ph->addrfamily == AF_INET && obj->fd4 == -1)
|
||||
+ {
|
||||
+ obj->fd4 = ping_open_socket(obj, AF_INET);
|
||||
+ if (obj->fd4 == -1)
|
||||
+ return (-1);
|
||||
+ ping_set_ttl (obj, obj->ttl);
|
||||
+ ping_set_qos (obj, obj->qos);
|
||||
+ }
|
||||
+ if (ph->addrfamily == AF_INET6 && obj->fd6 == -1)
|
||||
+ {
|
||||
+ obj->fd6 = ping_open_socket(obj, AF_INET6);
|
||||
+ if (obj->fd6 == -1)
|
||||
+ return (-1);
|
||||
+ ping_set_ttl (obj, obj->ttl);
|
||||
+ ping_set_qos (obj, obj->qos);
|
||||
+ }
|
||||
+
|
||||
return (0);
|
||||
} /* int ping_host_add */
|
||||
|
||||
--
|
||||
2.25.1
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
From 0ad9ee080a7cd8037c341067cc67a84e32e69fea Mon Sep 17 00:00:00 2001
|
||||
From: Maurice Smulders <Maurice.Smulders@windtalker.com>
|
||||
Date: Thu, 30 Dec 2021 10:45:42 -0700
|
||||
Subject: [PATCH] Fix compile break with GCC 7+ - buffer overflow with snprintf
|
||||
|
||||
[Retrieved from:
|
||||
https://github.com/octo/liboping/pull/64/commits/0ad9ee080a7cd8037c341067cc67a84e32e69fea]
|
||||
Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
|
||||
---
|
||||
src/liboping.c | 3 +++
|
||||
1 file changed, 3 insertions(+)
|
||||
|
||||
diff --git a/src/liboping.c b/src/liboping.c
|
||||
index bf9e059..9fd8f53 100644
|
||||
--- a/src/liboping.c
|
||||
+++ b/src/liboping.c
|
||||
@@ -203,8 +203,11 @@ static char *sstrerror (int errnum, char *buf, size_t buflen)
|
||||
static void ping_set_error (pingobj_t *obj, const char *function,
|
||||
const char *message)
|
||||
{
|
||||
+#pragma GCC diagnostic push
|
||||
+#pragma GCC diagnostic ignored "-Wformat-truncation"
|
||||
snprintf (obj->errmsg, sizeof (obj->errmsg),
|
||||
"%s: %s", function, message);
|
||||
+#pragma GCC diagnostic pop
|
||||
obj->errmsg[sizeof (obj->errmsg) - 1] = 0;
|
||||
}
|
||||
|
||||
32
package/liboping/0004-Fix-compile-error-on-GCC-7.patch
Normal file
32
package/liboping/0004-Fix-compile-error-on-GCC-7.patch
Normal file
@@ -0,0 +1,32 @@
|
||||
From 3d685bdb1a6c655bce6d36cfd96e084be07cd2b1 Mon Sep 17 00:00:00 2001
|
||||
From: Maurice Smulders <Maurice.Smulders@windtalker.com>
|
||||
Date: Tue, 4 Jan 2022 12:49:36 -0700
|
||||
Subject: [PATCH] Fix compile error on GCC < 7
|
||||
|
||||
[Retrieved from:
|
||||
https://github.com/octo/liboping/pull/64/commits/3d685bdb1a6c655bce6d36cfd96e084be07cd2b1]
|
||||
Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
|
||||
---
|
||||
src/liboping.c | 4 ++++
|
||||
1 file changed, 4 insertions(+)
|
||||
|
||||
diff --git a/src/liboping.c b/src/liboping.c
|
||||
index 9fd8f53..1ccf609 100644
|
||||
--- a/src/liboping.c
|
||||
+++ b/src/liboping.c
|
||||
@@ -203,11 +203,15 @@ static char *sstrerror (int errnum, char *buf, size_t buflen)
|
||||
static void ping_set_error (pingobj_t *obj, const char *function,
|
||||
const char *message)
|
||||
{
|
||||
+#if __GNUC__ >= 7
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wformat-truncation"
|
||||
+#endif
|
||||
snprintf (obj->errmsg, sizeof (obj->errmsg),
|
||||
"%s: %s", function, message);
|
||||
+#if __GNUC__ >= 7
|
||||
#pragma GCC diagnostic pop
|
||||
+#endif
|
||||
obj->errmsg[sizeof (obj->errmsg) - 1] = 0;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,59 @@
|
||||
From 670834fd8fbd2533ea25ca83065800e924116579 Mon Sep 17 00:00:00 2001
|
||||
From: Sergei Trofimovich <slyich@gmail.com>
|
||||
Date: Mon, 15 Nov 2021 08:05:43 +0000
|
||||
Subject: [PATCH] src/oping.c: always use "%s"-style format for
|
||||
printf()-style functions
|
||||
|
||||
`ncuses-6.3` added printf-style function attributes and now makes
|
||||
it easier to catch cases when user input is used in palce of format
|
||||
string when built with CFLAGS=-Werror=format-security:
|
||||
|
||||
oping.c:1265:41: error: format not a string literal and no format arguments [-Werror=format-security]
|
||||
1265 | hist_symbols_utf8[index]);
|
||||
| ^~~~~~~~~~~~~~~~~
|
||||
|
||||
Let's wrap all the missing places with "%s" format.
|
||||
|
||||
Downloaded from upstream PR https://github.com/octo/liboping/pull/61
|
||||
|
||||
Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de>
|
||||
[Bernd: rebased for liboping version 1.10.0]
|
||||
---
|
||||
src/oping.c | 7 +++----
|
||||
1 file changed, 3 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/src/oping.c b/src/oping.c
|
||||
index c087c80..af4a0cb 100644
|
||||
--- a/src/oping.c
|
||||
+++ b/src/oping.c
|
||||
@@ -1156,7 +1156,7 @@ static int update_graph_prettyping (ping_context_t *ctx, /* {{{ */
|
||||
wattron (ctx->window, COLOR_PAIR(color));
|
||||
|
||||
if (has_utf8())
|
||||
- mvwprintw (ctx->window, /* y = */ 3, /* x = */ x + 2, symbol);
|
||||
+ mvwprintw (ctx->window, /* y = */ 3, /* x = */ x + 2, "%s", symbol);
|
||||
else
|
||||
mvwaddch (ctx->window, /* y = */ 3, /* x = */ x + 2, symbolc);
|
||||
|
||||
@@ -1262,7 +1262,7 @@ static int update_graph_histogram (ping_context_t *ctx) /* {{{ */
|
||||
mvwaddch (ctx->window, /* y = */ 3, /* x = */ x + 2, ' ');
|
||||
else if (has_utf8 ())
|
||||
mvwprintw (ctx->window, /* y = */ 3, /* x = */ x + 2,
|
||||
- hist_symbols_utf8[index]);
|
||||
+ "%s", hist_symbols_utf8[index]);
|
||||
else
|
||||
mvwaddch (ctx->window, /* y = */ 3, /* x = */ x + 2,
|
||||
hist_symbols_acs[index] | A_ALTCHARSET);
|
||||
@@ -1639,8 +1639,7 @@ static void update_host_hook (pingobj_iter_t *iter, /* {{{ */
|
||||
|
||||
HOST_PRINTF ("%zu bytes from %s (%s): icmp_seq=%u ttl=%i ",
|
||||
data_len, context->host, context->addr,
|
||||
- sequence, recv_ttl,
|
||||
- format_qos (recv_qos, recv_qos_str, sizeof (recv_qos_str)));
|
||||
+ sequence, recv_ttl);
|
||||
if ((recv_qos != 0) || (opt_send_qos != 0))
|
||||
{
|
||||
HOST_PRINTF ("qos=%s ",
|
||||
--
|
||||
2.34.1
|
||||
|
||||
7
package/liboping/Config.in
Normal file
7
package/liboping/Config.in
Normal file
@@ -0,0 +1,7 @@
|
||||
config BR2_PACKAGE_LIBOPING
|
||||
bool "liboping"
|
||||
help
|
||||
liboping is a C library to generate ICMP echo requests,
|
||||
better known as "ping packets".
|
||||
|
||||
http://noping.cc/
|
||||
5
package/liboping/liboping.hash
Normal file
5
package/liboping/liboping.hash
Normal file
@@ -0,0 +1,5 @@
|
||||
# From http://noping.cc/#download
|
||||
sha256 eb38aa93f93e8ab282d97e2582fbaea88b3f889a08cbc9dbf20059c3779d5cd8 liboping-1.10.0.tar.bz2
|
||||
|
||||
# Hash for license file:
|
||||
sha256 dc626520dcd53a22f727af3ee42c770e56c97a64fe3adb063799d8ab032fe551 COPYING
|
||||
23
package/liboping/liboping.mk
Normal file
23
package/liboping/liboping.mk
Normal file
@@ -0,0 +1,23 @@
|
||||
################################################################################
|
||||
#
|
||||
# liboping
|
||||
#
|
||||
################################################################################
|
||||
|
||||
LIBOPING_VERSION = 1.10.0
|
||||
LIBOPING_SITE = http://noping.cc/files
|
||||
LIBOPING_SOURCE = liboping-$(LIBOPING_VERSION).tar.bz2
|
||||
LIBOPING_INSTALL_STAGING = YES
|
||||
LIBOPING_CONF_OPTS = --without-perl-bindings
|
||||
LIBOPING_LICENSE = LGPL-2.1+, GPL-2.0
|
||||
LIBOPING_LICENSE_FILES = COPYING
|
||||
LIBOPING_CPE_ID_VENDOR = noping
|
||||
|
||||
ifeq ($(BR2_PACKAGE_NCURSES),y)
|
||||
LIBOPING_DEPENDENCIES += ncurses
|
||||
LIBOPING_CONF_OPTS += --with-ncurses
|
||||
else
|
||||
LIBOPING_CONF_OPTS += --without-ncurses
|
||||
endif
|
||||
|
||||
$(eval $(autotools-package))
|
||||
Reference in New Issue
Block a user