Update to libopint 1.10.
Backport a fix for https://github.com/octo/liboping/issues/34 ok danj@
This commit is contained in:
parent
28171d0585
commit
537f02ec99
@ -1,10 +1,9 @@
|
||||
# $OpenBSD: Makefile,v 1.5 2017/09/23 10:13:19 sthen Exp $
|
||||
# $OpenBSD: Makefile,v 1.6 2018/04/28 14:29:30 landry Exp $
|
||||
|
||||
COMMENT = library and tools to generate ICMP echo requests
|
||||
|
||||
DISTNAME = liboping-1.9.0
|
||||
REVISION = 1
|
||||
SHARED_LIBS += oping 0.0 # 2.11
|
||||
DISTNAME = liboping-1.10.0
|
||||
SHARED_LIBS += oping 0.1 # 3.0
|
||||
|
||||
CATEGORIES = net
|
||||
|
||||
@ -13,7 +12,7 @@ HOMEPAGE = http://noping.cc/
|
||||
# LGPL v2.1+ (lib) GPLv2+ (binaries)
|
||||
PERMIT_PACKAGE_CDROM = Yes
|
||||
|
||||
WANTLIB += c m ncursesw perl
|
||||
WANTLIB += c m curses perl
|
||||
|
||||
MASTER_SITES = http://noping.cc/files/
|
||||
CONFIGURE_STYLE = gnu
|
||||
|
@ -1,2 +1,2 @@
|
||||
SHA256 (liboping-1.9.0.tar.gz) = hrRPaEoxUb1LW3UzaHZjXssPbP5UovspptoGQy8tuwA=
|
||||
SIZE (liboping-1.9.0.tar.gz) = 389502
|
||||
SHA256 (liboping-1.10.0.tar.gz) = wgawV0PQcwgUvjEVtIq9CwABZndSUVPHhzDaMHq6CEY=
|
||||
SIZE (liboping-1.10.0.tar.gz) = 395596
|
||||
|
75
net/liboping/patches/patch-src_liboping_c
Normal file
75
net/liboping/patches/patch-src_liboping_c
Normal file
@ -0,0 +1,75 @@
|
||||
$OpenBSD: patch-src_liboping_c,v 1.3 2018/04/28 14:29:30 landry Exp $
|
||||
|
||||
https://github.com/tfheen/liboping/commit/a88c51f38dafa1fba9118045176754bec05d3c94.patch
|
||||
|
||||
Index: src/liboping.c
|
||||
--- src/liboping.c.orig
|
||||
+++ src/liboping.c
|
||||
@@ -1344,43 +1344,12 @@ 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)
|
||||
{
|
||||
ping_set_errno (obj, errno);
|
||||
@@ -1699,6 +1668,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 */
|
@ -1,4 +1,4 @@
|
||||
@comment $OpenBSD: PLIST,v 1.2 2016/07/05 09:07:43 landry Exp $
|
||||
@comment $OpenBSD: PLIST,v 1.3 2018/04/28 14:29:30 landry Exp $
|
||||
@mode 4555
|
||||
@bin bin/noping
|
||||
@bin bin/oping
|
||||
@ -9,8 +9,7 @@ lib/liboping.la
|
||||
@lib lib/liboping.so.${LIBoping_VERSION}
|
||||
lib/pkgconfig/liboping.pc
|
||||
@comment libdata/perl5/${MACHINE_ARCH}-openbsd/
|
||||
@comment libdata/perl5/${MACHINE_ARCH}-openbsd/5.20.2/
|
||||
@comment libdata/perl5/${MACHINE_ARCH}-openbsd/5.20.2/perllocal.pod
|
||||
@comment libdata/perl5/${MACHINE_ARCH}-openbsd/perllocal.pod
|
||||
libdata/perl5/site_perl/${MACHINE_ARCH}-openbsd/
|
||||
libdata/perl5/site_perl/${MACHINE_ARCH}-openbsd/Net/
|
||||
libdata/perl5/site_perl/${MACHINE_ARCH}-openbsd/Net/Oping.pm
|
||||
|
Loading…
x
Reference in New Issue
Block a user