pkgsrc-Changes archive

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

CVS commit: pkgsrc/net/p5-Net-Libdnet6



Module Name:    pkgsrc
Committed By:   wiz
Date:           Wed Oct 11 07:34:51 UTC 2017

Modified Files:
        pkgsrc/net/p5-Net-Libdnet6: Makefile distinfo
Added Files:
        pkgsrc/net/p5-Net-Libdnet6/patches: patch-Carp patch-_get_routes

Log Message:
p5-Net-Libdnet6: fix some bugs on NetBSD

>From Edgar Fuß in PR 52610.

Bump PKGREVISION.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 pkgsrc/net/p5-Net-Libdnet6/Makefile
cvs rdiff -u -r1.3 -r1.4 pkgsrc/net/p5-Net-Libdnet6/distinfo
cvs rdiff -u -r0 -r1.1 pkgsrc/net/p5-Net-Libdnet6/patches/patch-Carp \
    pkgsrc/net/p5-Net-Libdnet6/patches/patch-_get_routes

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: pkgsrc/net/p5-Net-Libdnet6/Makefile
diff -u pkgsrc/net/p5-Net-Libdnet6/Makefile:1.9 pkgsrc/net/p5-Net-Libdnet6/Makefile:1.10
--- pkgsrc/net/p5-Net-Libdnet6/Makefile:1.9     Mon Jun  5 14:24:21 2017
+++ pkgsrc/net/p5-Net-Libdnet6/Makefile Wed Oct 11 07:34:51 2017
@@ -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/}
 

Index: pkgsrc/net/p5-Net-Libdnet6/distinfo
diff -u pkgsrc/net/p5-Net-Libdnet6/distinfo:1.3 pkgsrc/net/p5-Net-Libdnet6/distinfo:1.4
--- pkgsrc/net/p5-Net-Libdnet6/distinfo:1.3     Wed Nov  4 00:35:22 2015
+++ pkgsrc/net/p5-Net-Libdnet6/distinfo Wed Oct 11 07:34:51 2017
@@ -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

Added files:

Index: pkgsrc/net/p5-Net-Libdnet6/patches/patch-Carp
diff -u /dev/null pkgsrc/net/p5-Net-Libdnet6/patches/patch-Carp:1.1
--- /dev/null   Wed Oct 11 07:34:51 2017
+++ pkgsrc/net/p5-Net-Libdnet6/patches/patch-Carp       Wed Oct 11 07:34:51 2017
@@ -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)
Index: pkgsrc/net/p5-Net-Libdnet6/patches/patch-_get_routes
diff -u /dev/null pkgsrc/net/p5-Net-Libdnet6/patches/patch-_get_routes:1.1
--- /dev/null   Wed Oct 11 07:34:51 2017
+++ pkgsrc/net/p5-Net-Libdnet6/patches/patch-_get_routes        Wed Oct 11 07:34:51 2017
@@ -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