Skip Menu |

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

Report information
The Basics
Id: 100285
Status: resolved
Priority: 0/
Queue: Net-TFTPd

People
Owner: VINSWORLD [...] cpan.org
Requestors: Vegard.Vesterheim [...] uninett.no
Cc:
AdminCc:

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



Subject: Tiny patch against Net-TFTPd-0.06 to support IPv6-only operation
Date: Wed, 12 Nov 2014 09:41:36 +0100
To: bug-Net-TFTPd [...] rt.cpan.org
From: Vegard Vesterheim <vegard.vesterheim [...] uninett.no>
I needed to establish a IPv6-only TFTP-server alongside an existing IPv4 TFTP-server. This module came to the rescue, but I needed to apply a tiny patch. https://github.com/vv3/Net-TFTPd/commit/afd91a923c0b8d9c2bde32ed520029214a695758 diff --git a/TFTPd.pm b/TFTPd.pm index 282763c..88195d9 100755 --- a/TFTPd.pm +++ b/TFTPd.pm @@ -174,6 +174,12 @@ sub new $params{'LocalAddr'} = $cfg{'LocalAddr'}; } + # bind only to IPv6 + if ($cfg{'V6Only'}) + { + $params{'V6Only'} = $cfg{'V6Only'}; + } + if ($HAVE_IO_Socket_IP) { if (my $udpserver = IO::Socket::IP->new(%params)) @@ -1342,6 +1348,7 @@ Valid options are: Option Description Default ------ ----------- ------- LocalAddr Interface to bind to (for multi-homed server) any + V6Only If set, listen only on AF_INET6 addresses undef LocalPort Port to bind server to 69 Timeout Timeout in seconds to wait for a request 10 ACKtimeout Timeout in seconds to wait for an ACK packet 4
This is not needed. A construct for IPv6-only already exists with: my $server = Net::TFTPd->new( RootDir => '.', Family => 'v6' );
Subject: Re: [rt.cpan.org #100285] Tiny patch against Net-TFTPd-0.06 to support IPv6-only operation
Date: Wed, 12 Nov 2014 11:05:25 +0100
To: "Michael Vincent via RT" <bug-Net-TFTPd [...] rt.cpan.org>
From: Vegard Vesterheim <vegard.vesterheim [...] uninett.no>
On Wed, 12 Nov 2014 04:30:18 -0500 "Michael Vincent via RT" <bug-Net-TFTPd@rt.cpan.org> wrote: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=100285 > > > This is not needed. A construct for IPv6-only already exists with: > > my $server = Net::TFTPd->new( > RootDir => '.', > Family => 'v6' > );
No, I tried that, but it does not work: # netstat -nua | grep -w 69 udp 0 0 0.0.0.0:69 0.0.0.0:* # grep -C 5 Family vk-tftpd.pl my $listener = Net::TFTPd->new ( 'RootDir' => $root_dir, 'Timeout' => undef, 'Family' => 'v6', 'Writable' => 0, 'CallBack' => \&callback ) or die Net::TFTPd->error; # perl vk-tftpd.pl Error opening socket for listener: Address already in use
Subject: Re: [rt.cpan.org #100285] Tiny patch against Net-TFTPd-0.06 to support IPv6-only operation
Date: Wed, 12 Nov 2014 11:26:22 +0100
To: "Michael Vincent via RT" <bug-Net-TFTPd [...] rt.cpan.org>
From: Vegard Vesterheim <vegard.vesterheim [...] uninett.no>
On Wed, 12 Nov 2014 11:05:25 +0100 Vegard Vesterheim <vegard.vesterheim@uninett.no> wrote: Show quoted text
> On Wed, 12 Nov 2014 04:30:18 -0500 "Michael Vincent via RT" <bug-Net-TFTPd@rt.cpan.org> wrote: >
>> <URL: https://rt.cpan.org/Ticket/Display.html?id=100285 > >> >> This is not needed. A construct for IPv6-only already exists with: >> >> my $server = Net::TFTPd->new( >> RootDir => '.', >> Family => 'v6' >> );
> > No, I tried that, but it does not work:
From the man-page from IO::Socket::IP V6Only => BOOL If defined, set the "IPV6_V6ONLY" sockopt when creating "PF_INET6" sockets to the given value. If true, a listening-mode socket will only listen on the "AF_INET6" addresses; if false it will also accept connections from "AF_INET" addresses. - Vegard V -
reopening after testing on Linux. No issues on Windows.
Please check CPAN for version 0.07. Test and let me know if this works. My testing on both Windows (7 x64 / Strawberry Perl 5.18.1) and Linux (Ubuntu 14.04 / Perl 5.18.1) was successful for opening IPv6 TFTP server while IPv4 TFTP server was already running in a separate process. The v6Only option is now implicitly passed when calling for Family => 'v6' so no need for additional switch.
RT-Send-CC: Vegard.Vesterheim [...] uninett.no
Not sure if I included your email on the latest update - apologies if you get this twice: Please check CPAN for version 0.07. Test and let me know if this works. My testing on both Windows (7 x64 / Strawberry Perl 5.18.1) and Linux (Ubuntu 14.04 / Perl 5.18.1) was successful for opening IPv6 TFTP server while IPv4 TFTP server was already running in a separate process. The v6Only option is now implicitly passed when calling for Family => 'v6' so no need for additional switch.
Subject: Re: [rt.cpan.org #100285] Tiny patch against Net-TFTPd-0.06 to support IPv6-only operation
Date: Tue, 18 Nov 2014 23:17:10 +0100
To: bug-Net-TFTPd [...] rt.cpan.org
From: Vegard Vesterheim <vegard.vesterheim [...] uninett.no>
On Tue, 18 Nov 2014 15:13:16 -0500 "Michael Vincent via RT" <bug-Net-TFTPd@rt.cpan.org> wrote: Show quoted text
> Please check CPAN for version 0.07. Test and let me know if this > works.
Will do. Show quoted text
> The v6Only option is now implicitly passed when calling for Family => > 'v6' so no need for additional switch.
Ok. This means that Net::TFTPd does not follow the convention from IO::Socket::IP where setting Family to 'v6' simply means to listen to IPv6 *in addition* to IPv4, and you have to explicitly enable IPv6-only operation. I am personally unsure about what is the most sensible behaviour. Anyway, thanks for helping out with this. - Vegard V -
Subject: Re: [rt.cpan.org #100285] Tiny patch against Net-TFTPd-0.06 to support IPv6-only operation
Date: Tue, 18 Nov 2014 17:22:19 -0500
To: bug-Net-TFTPd [...] rt.cpan.org
From: Vince <vin [...] vinsworld.com>
Yes, the thought is to provide IPv4 *or* IPv6 exclusively. You could create both sockets through the Net::TFTPd interface and use IO::Select to switch between them. I intended that selecting the family would only create the socket on that address family - that is the behavior on Windows, which I started using and developed the IPv6 support on (since tftpd server was readily available in Linux). On Tue, Nov 18, 2014 at 5:17 PM, Vegard.Vesterheim@uninett.no via RT < bug-Net-TFTPd@rt.cpan.org> wrote: Show quoted text
> Queue: Net-TFTPd > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=100285 > > > On Tue, 18 Nov 2014 15:13:16 -0500 "Michael Vincent via RT" < > bug-Net-TFTPd@rt.cpan.org> wrote: >
> > Please check CPAN for version 0.07. Test and let me know if this > > works.
> > Will do. >
> > The v6Only option is now implicitly passed when calling for Family => > > 'v6' so no need for additional switch.
> > Ok. This means that Net::TFTPd does not follow the convention from > IO::Socket::IP where setting Family to 'v6' simply means to listen to > IPv6 *in addition* to IPv4, and you have to explicitly enable IPv6-only > operation. I am personally unsure about what is the most sensible > behaviour. > > Anyway, thanks for helping out with this. > > - Vegard V - > >
Subject: Re: [rt.cpan.org #100285] Tiny patch against Net-TFTPd-0.06 to support IPv6-only operation
Date: Wed, 19 Nov 2014 09:35:23 +0100
To: bug-Net-TFTPd [...] rt.cpan.org
From: Vegard Vesterheim <vegard.vesterheim [...] uninett.no>
On Tue, 18 Nov 2014 23:17:10 +0100 Vegard Vesterheim <vegard.vesterheim@uninett.no> wrote: Show quoted text
> On Tue, 18 Nov 2014 15:13:16 -0500 "Michael Vincent via RT" <bug-Net-TFTPd@rt.cpan.org> wrote: >
>> Please check CPAN for version 0.07. Test and let me know if this >> works.
> > Will do.
Version 0.07 works fine. This request can be closed. Thanks again. - Vegard V -
Resolved in v 0.07.