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