Skip Menu |

This queue is for tickets about the Net-MRT CPAN distribution.

Report information
The Basics
Id: 118428
Status: open
Priority: 0/
Queue: Net-MRT

People
Owner: MBASUNOV [...] cpan.org
Requestors: christopher.turbeville [...] zayo.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: IPv6 causes croak
Date: Tue, 18 Oct 2016 18:22:20 -0500
To: bug-Net-MRT [...] rt.cpan.org
From: Christopher Turbeville <christopher.turbeville [...] zayo.com>
I was getting croaks trying to parse some route-views dumps until I commented out the case MST_TD2_RIB_IPV6_UNICAST line. I think your dual family code has a length wrong some where. The message was attempted to read 1 byte with 0 bytes remaining. Thanks -Chris -- Chris Turbeville Network Architect | zColo | Zayo Group, LLC 1950 Stemmons Frwy | Suite 4006 | Dallas, TX 75207 O: 214.442.1118 | christopher.turbeville@zayo.com | www.zcolo.com | www.zayo.com
Show quoted text
> I was getting croaks trying to parse some route-views dumps until I > commented out the > > case MST_TD2_RIB_IPV6_UNICAST > > line. I think your dual family code has a length wrong some where. The > message was attempted to read 1 byte with 0 bytes remaining.
Could please you send a buggy record or whole file which produces that error (if it is still actual)? I'm constantly use RIPE RIS dumps and have never seen that error.
Show quoted text
> Could please you send a buggy record or whole file which produces that > error (if it is still actual)? > > I'm constantly use RIPE RIS dumps and have never seen that error.
If not the same, then a very similar problem can be reproduced on almost any RIPE RIS dump, e. g.: http://data.ris.ripe.net/rrc00/2019.07/bview.20190701.0000.gz Simple test case attached. Output for a dump above is: Aborted after extracting 44008 records: Attempt to read 2 bytes while buffer contain only 0 at ./tc.pl line 22. last parsed record was: $VAR1 = {'sequence' => 44006,'subtype' => 4,'timestamp' => 1561939200,'type' => 13,'prefix' => '2000::','entries' => [{'originated_time' => 1560760072,'NEXT_HOP' => [],'ORIGIN' => 42,'peer_index' => 57,'' => undef,'AS_PATH' => [39351,12552]}],'bits' => 6}; at ./tc.pl line 26. bview.20190701.0000 contains 35287609 records.
Subject: tc.pl
#!/usr/bin/perl use 5.012; # implies "use strict;" use warnings; use autodie; use Data::Dumper; local $Data::Dumper::Indent = 0; use lib qw(blib/lib blib/arch); use Net::MRT; open my $fh, '<', '../bview.20190701.0000'; binmode $fh; my $count = 0; my $record; eval { while ($record = Net::MRT::mrt_read_next($fh)) { $count++; } }; if ($@) { die "Aborted after extracting $count records: $@" . 'last parsed record was: ' . Dumper($record); } say "$count records successfully exctracted";
Sorry guys. I started the library because Perl had no C implementation. A guy wrote interface to official C library which has Perl interface similar to mine. https://metacpan.org/release/Net-BGPdump You may switch to Net::BGPdump with minor changes in source code: $io = Net::BGPdump->open($file_name); ... while (<$io>) { } Some other replacements: type: type_id subtype: subtype_id bits: my ($netaddr, $bits) = split('/', $_->{'prefix'}); I've already switched my work to Net::BGPdump.