pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/net/p5-Net-Libdnet6 p5-Net-Libdnet6: fix some bugs on ...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/2554a61d27e3
branches:  trunk
changeset: 370085:2554a61d27e3
user:      wiz <wiz%pkgsrc.org@localhost>
date:      Wed Oct 11 07:34:51 2017 +0000

description:
p5-Net-Libdnet6: fix some bugs on NetBSD

>From Edgar Fu? in PR 52610.

Bump PKGREVISION.

diffstat:

 net/p5-Net-Libdnet6/Makefile                  |   5 +-
 net/p5-Net-Libdnet6/distinfo                  |   4 +-
 net/p5-Net-Libdnet6/patches/patch-Carp        |  16 ++++
 net/p5-Net-Libdnet6/patches/patch-_get_routes |  96 +++++++++++++++++++++++++++
 4 files changed, 117 insertions(+), 4 deletions(-)

diffs (148 lines):

diff -r e07fd49857b1 -r 2554a61d27e3 net/p5-Net-Libdnet6/Makefile
--- a/net/p5-Net-Libdnet6/Makefile      Wed Oct 11 07:18:27 2017 +0000
+++ b/net/p5-Net-Libdnet6/Makefile      Wed Oct 11 07:34:51 2017 +0000
@@ -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 -r e07fd49857b1 -r 2554a61d27e3 net/p5-Net-Libdnet6/distinfo
--- a/net/p5-Net-Libdnet6/distinfo      Wed Oct 11 07:18:27 2017 +0000
+++ b/net/p5-Net-Libdnet6/distinfo      Wed Oct 11 07:34:51 2017 +0000
@@ -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 -r e07fd49857b1 -r 2554a61d27e3 net/p5-Net-Libdnet6/patches/patch-Carp
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/net/p5-Net-Libdnet6/patches/patch-Carp    Wed Oct 11 07:34:51 2017 +0000
@@ -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 -r e07fd49857b1 -r 2554a61d27e3 net/p5-Net-Libdnet6/patches/patch-_get_routes
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/net/p5-Net-Libdnet6/patches/patch-_get_routes     Wed Oct 11 07:34:51 2017 +0000
@@ -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);



Home | Main Index | Thread Index | Old Index