[Bug 1448500] Re: tftp-hpa doesn't accept IPv4 connections

2015-06-12 Thread Frans Oilinki
NOTE: There is an obvious limitation in the above solution - if you
want to listen on different port then you are back to square one. I wish
this helps someone to bypass the problem while waiting for proper and
complete fix.

-- 
You received this bug notification because you are a member of Ubuntu
Server Team, which is subscribed to tftp-hpa in Ubuntu.
https://bugs.launchpad.net/bugs/1448500

Title:
  tftp-hpa doesn't accept IPv4 connections

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/tftp-hpa/+bug/1448500/+subscriptions

-- 
Ubuntu-server-bugs mailing list
Ubuntu-server-bugs@lists.ubuntu.com
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/ubuntu-server-bugs


[Bug 1448500] Re: tftp-hpa doesn't accept IPv4 connections

2015-06-12 Thread Frans Oilinki
It seems tftpd-hpa interprets option --address ::69 to mean that only listen on 
IPv6:
1. By default (with TFTP_ADDRESS=[::]:69) it is started as

/usr/sbin/in.tftpd --listen --user tftp --address [::]:69 --secure
--create /srv/tftp

2. netstat (command sudo netstat -anutp | grep '[:]69') shows:

udp6   0  0 :::69   :::*
10681/in.tftpd

I do not know and I am not interested to check the source code if there
is way to explicitly tell tftpd-hpa to listen on all interfaces, both
IPv4 and IPv6, but if you just omit the --address option, tftpd-hpa -
per netstat output - listens on all interfaces both IPv4 and IPv6; when
I start tftp-hpa as  /usr/sbin/in.tftpd --listen --user tftp --secure
--create /srv/tftp then netstat shows

   udp0  0 0.0.0.0:69  0.0.0.0:*
   24607/in.tftpd  
   udp6   0  0 :::69   :::* 
   24607/in.tftpd  

I accomplished this by hacking /etc/init.d/tftpd-hpa as follows:

diff --git a/init.d/tftpd-hpa b/init.d/tftpd-hpa
index 115ca4e..a4a5b60 100755
--- a/init.d/tftpd-hpa
+++ b/init.d/tftpd-hpa
@@ -52,9 +52,15 @@ do_start()
fi
done
 
+   if [ $TFTP_ADDRESS = [::]:69 ]; then# all interfaces
+   start-stop-daemon --start --quiet --oknodo --exec $DAEMON -- \
+--listen --user $TFTP_USERNAME \
+   $TFTP_OPTIONS $TFTP_DIRECTORY
+   else
start-stop-daemon --start --quiet --oknodo --exec $DAEMON -- \
--listen --user $TFTP_USERNAME --address $TFTP_ADDRESS \
$TFTP_OPTIONS $TFTP_DIRECTORY
+   fi
 }
 
 do_stop ()

-- 
You received this bug notification because you are a member of Ubuntu
Server Team, which is subscribed to tftp-hpa in Ubuntu.
https://bugs.launchpad.net/bugs/1448500

Title:
  tftp-hpa doesn't accept IPv4 connections

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/tftp-hpa/+bug/1448500/+subscriptions

-- 
Ubuntu-server-bugs mailing list
Ubuntu-server-bugs@lists.ubuntu.com
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/ubuntu-server-bugs