diff options
author | wiz <wiz@pkgsrc.org> | 2017-10-11 07:34:51 +0000 |
---|---|---|
committer | wiz <wiz@pkgsrc.org> | 2017-10-11 07:34:51 +0000 |
commit | b8fae141d4a1275127a85ed6d036dcd871a6e90d (patch) | |
tree | 8be5f20c3ceb7965acb74058e2900b5380ac1d51 | |
parent | ec458756524e8c26dfa52afcc0f00661fb230d26 (diff) | |
download | pkgsrc-b8fae141d4a1275127a85ed6d036dcd871a6e90d.tar.gz |
p5-Net-Libdnet6: fix some bugs on NetBSD
From Edgar Fuß in PR 52610.
Bump PKGREVISION.
-rw-r--r-- | net/p5-Net-Libdnet6/Makefile | 5 | ||||
-rw-r--r-- | net/p5-Net-Libdnet6/distinfo | 4 | ||||
-rw-r--r-- | net/p5-Net-Libdnet6/patches/patch-Carp | 16 | ||||
-rw-r--r-- | net/p5-Net-Libdnet6/patches/patch-_get_routes | 96 |
4 files changed, 117 insertions, 4 deletions
diff --git a/net/p5-Net-Libdnet6/Makefile b/net/p5-Net-Libdnet6/Makefile index 0f79376d154..9f97496a2b1 100644 --- a/net/p5-Net-Libdnet6/Makefile +++ b/net/p5-Net-Libdnet6/Makefile @@ -1,9 +1,8 @@ -# $NetBSD: Makefile,v 1.9 2017/06/05 14:24:21 ryoon Exp $ -# +# $NetBSD: Makefile,v 1.10 2017/10/11 07:34:51 wiz Exp $ DISTNAME= Net-Libdnet6-0.27 PKGNAME= p5-${DISTNAME} -PKGREVISION= 3 +PKGREVISION= 4 CATEGORIES= perl5 net MASTER_SITES= ${MASTER_SITE_PERL_CPAN:=Net/} diff --git a/net/p5-Net-Libdnet6/distinfo b/net/p5-Net-Libdnet6/distinfo index 189bc6e80e9..377ce3fabfa 100644 --- a/net/p5-Net-Libdnet6/distinfo +++ b/net/p5-Net-Libdnet6/distinfo @@ -1,6 +1,8 @@ -$NetBSD: distinfo,v 1.3 2015/11/04 00:35:22 agc Exp $ +$NetBSD: distinfo,v 1.4 2017/10/11 07:34:51 wiz Exp $ SHA1 (Net-Libdnet6-0.27.tar.gz) = ab0162ca789f0136b01f2a41f2b71178b313676c RMD160 (Net-Libdnet6-0.27.tar.gz) = 1546992c09529f4d52620612e7ec8656168aae17 SHA512 (Net-Libdnet6-0.27.tar.gz) = 28376d8a7eb60a27a1b81cdf57b2fdb0481a9b5a782965242bb1ef5f4f307c1a8e0e06ca85d3b871771f482877cc88bab3417b4f1586e1a83954807b40d62b62 Size (Net-Libdnet6-0.27.tar.gz) = 9190 bytes +SHA1 (patch-Carp) = 56fa47f40c754e3bb59c5769cad49a42ba67145d +SHA1 (patch-_get_routes) = d401a4364a07118282b51469446cdded05a41c6e diff --git a/net/p5-Net-Libdnet6/patches/patch-Carp b/net/p5-Net-Libdnet6/patches/patch-Carp new file mode 100644 index 00000000000..2acba3b82c0 --- /dev/null +++ b/net/p5-Net-Libdnet6/patches/patch-Carp @@ -0,0 +1,16 @@ +$NetBSD: patch-Carp,v 1.1 2017/10/11 07:34:51 wiz Exp $ + +add missing "use Carp" +https://rt.cpan.org/Public/Bug/Display.html?id=114642 + +--- lib/Net/Libdnet6.pm.orig 2015-01-28 19:58:20.000000000 +0100 ++++ lib/Net/Libdnet6.pm 2016-05-24 19:24:29.000000000 +0200 +@@ -7,6 +7,8 @@ + + our $VERSION = '0.27'; + ++use Carp; ++ + use base qw(Exporter); + + # We also export Net::Libdnet subs (those without 6 at the end) diff --git a/net/p5-Net-Libdnet6/patches/patch-_get_routes b/net/p5-Net-Libdnet6/patches/patch-_get_routes new file mode 100644 index 00000000000..fff705272ec --- /dev/null +++ b/net/p5-Net-Libdnet6/patches/patch-_get_routes @@ -0,0 +1,96 @@ +$NetBSD: patch-_get_routes,v 1.1 2017/10/11 07:34:51 wiz Exp $ + +fix netstat -r parsing +https://rt.cpan.org/Public/Bug/Display.html?id=114642 + +--- lib/Net/Libdnet6.pm.orig 2016-05-24 19:26:45.000000000 +0200 ++++ lib/Net/Libdnet6.pm 2016-05-24 19:27:28.000000000 +0200 +@@ -68,11 +68,11 @@ + } + + my $osname = { +- linux => [ \&_get_routes_linux, ], +- freebsd => [ \&_get_routes_bsd, ], +- openbsd => [ \&_get_routes_bsd, ], +- netbsd => [ \&_get_routes_bsd, ], +- darwin => [ \&_get_routes_bsd, ], ++ linux => [ \&_get_routes_linux, ], ++ freebsd => [ \&_get_routes_freebsd, ], ++ openbsd => [ \&_get_routes_netbsd, ], ++ netbsd => [ \&_get_routes_netbsd, ], ++ darwin => [ \&_get_routes_freebsd, ], + }; + + *_get_routes = $osname->{$^O}->[0] || \&_get_routes_other; +@@ -227,7 +227,7 @@ + return; + } + +-sub _get_routes_bsd { ++sub _get_routes_freebsd { + return unless $_pathNetstat; + + my $buf = `$_pathNetstat -rnf inet6 2> /dev/null`; +@@ -294,6 +294,62 @@ + return; + } + ++sub _get_routes_netbsd { ++ return unless $_pathNetstat; ++ ++ my $buf = `$_pathNetstat -rnf inet6 2> /dev/null`; ++ return unless $buf; ++ ++ my @ifRoutes = (); ++ my %devIps; ++ my $lno; ++ for (split('\n', $buf)) { ++ $lno++; next unless $lno >= 5; # skip header ++ my @elts = split(/\s+/); ++ ++ my $destination = $elts[0] || undef; ++ my $gateway = $elts[1] || undef; ++ my $flags = $elts[2] || undef; ++ my $if = $elts[6] || undef; ++ ++ if (defined($destination)) { ++ $destination =~ s/%[a-z]+[0-9]+//; ++ } ++ if (defined($gateway)) { ++ $gateway =~ s/%[a-z]+[0-9]+//; ++ } ++ ++ next if ! defined($destination); ++ ++ if (Net::IPv6Addr::is_ipv6($destination)) { ++ my $route = { ++ destination => $destination, ++ interface => $if, ++ }; ++ if (Net::IPv6Addr::is_ipv6($gateway)) { ++ $route->{nextHop} = $gateway; ++ } ++ push @ifRoutes, $route; ++ } ++ elsif ($destination eq 'default') { ++ my $route = { ++ destination => $destination, ++ interface => $if, ++ }; ++ if (Net::IPv6Addr::is_ipv6($gateway)) { ++ $route->{nextHop} = $gateway; ++ } ++ push @ifRoutes, $route; ++ } ++ } ++ ++ if (@ifRoutes > 1) { ++ return \@ifRoutes; ++ } ++ ++ return; ++} ++ + sub _is_in_network { + my ($src, $net, $mask) = @_; + my $net1 = addr_net6($src.'/'.$mask); |