pkgsrc-Bugs archive

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

pkg/52610: net/p5-Net-Libdnet6: missing 'use Carp', wrong netstat -r parsing



>Number:         52610
>Category:       pkg
>Synopsis:       net/p5-Net-Libdnet6: missing 'use Carp', wrong netstat -r parsing
>Confidential:   no
>Severity:       serious
>Priority:       low
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Oct 10 13:55:00 +0000 2017
>Originator:     Edgar FuÃ?
>Release:        pkgsrc-2017Q3
>Organization:
	Mathematisches Institut der Universität Bonn
>Environment:
>Description:
	Net::Libdnet6 is missing a 'use Carp' statement.
	Also, the parsing of netstat -r output is wrong.
	Patches have been submitted upstream a year ago to no avail:
	https://rt.cpan.org/Public/Bug/Display.html?id=114639
	https://rt.cpan.org/Public/Bug/Display.html?id=114642
>How-To-Repeat:
	I don't remember.
>Fix:
	Index: distinfo
	===================================================================
	RCS file: /cvsroot/pkgsrc/net/p5-Net-Libdnet6/distinfo,v
	retrieving revision 1.3
	diff -u -r1.3 distinfo
	--- distinfo	4 Nov 2015 00:35:22 -0000	1.3
	+++ distinfo	10 Oct 2017 13:50:26 -0000
	@@ -4,3 +4,5 @@
	 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
	Index: patches/patch-Carp
	===================================================================
	RCS file: patches/patch-Carp
	diff -N patches/patch-Carp
	--- /dev/null	1 Jan 1970 00:00:00 -0000
	+++ patches/patch-Carp	10 Oct 2017 13:50:26 -0000
	@@ -0,0 +1,16 @@
	+$NetBSD: patch-Carp $
	+
	+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: patches/patch-_get_routes
	===================================================================
	RCS file: patches/patch-_get_routes
	diff -N patches/patch-_get_routes
	--- /dev/null	1 Jan 1970 00:00:00 -0000
	+++ patches/patch-_get_routes	10 Oct 2017 13:50:26 -0000
	@@ -0,0 +1,96 @@
	+$NetBSD: patch-_get_routes $
	+
	+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