netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Josh Boyer <jwboyer@redhat.com>
To: Eric Dumazet <eric.dumazet@gmail.com>
Cc: Joel Sing <jsing@google.com>, Julian Anastasov <ja@ssi.bg>,
	netdev@vger.kernel.org, francis.souyri@apec.fr
Subject: Re: loopback IP alias breaks tftp?
Date: Mon, 10 Oct 2011 11:10:59 -0400	[thread overview]
Message-ID: <20111010151058.GD1165@zod.bos.redhat.com> (raw)
In-Reply-To: <1317990201.3207.15.camel@edumazet-HP-Compaq-6005-Pro-SFF-PC>

On Fri, Oct 07, 2011 at 02:23:21PM +0200, Eric Dumazet wrote:
> Le vendredi 07 octobre 2011 à 14:04 +0200, Eric Dumazet a écrit :
> 
> > Its a completely different problem IMHO : You describe a tftp server
> > bug.
> > 
> > Say your tftp server is multihomed with 3 different IPS : 
> > 
> > 192.168.20.21, 192.168.20.22, 192.168.20.23
> > 
> > And tftp server listens to any address (UDP port 69) : 0.0.0.0:69
> > 
> > When receiving a request on 192.168.20.22, it should use same source
> > address, not let the system chose a "random or whatever policy" one.
> > 
> > 
> > 
> > So I would suggest to check/fix if TFTP server uses the correct socket
> > API to get both the client IP and its own IP in each UDP datagram
> > 
> > -> setsockopt(fd, IPPROTO_IP, &on, sizeof(on))
> 
> > This permits tftp server to use the same "struct in_pktinfo" for replies, forcing a correct source address.
> > 
> 
> By the way, there is no need for tftp change :
> 
> Just launch several tftpd instances, and bind each them to one
> particular IP.
> 
> If started from xinetd.d :
> 
> $ cat /etc/xinetd.d/tftp1
> service tftp
> {
> 	socket_type		= dgram
> 	protocol		= udp
> 	wait			= yes
> 	user			= root
> 	server			= /usr/sbin/in.tftpd
> 	server_args		= -s /tftpboot
> 	disable			= no
> 	bind		= 192.168.20.21
> 	per_source		= 11
> 	cps			= 100 2
> 	flags			= IPv4
> }

(I've CC'd the original bug reporter now.)

I did this locally and it still timed out.  So the bind alone is not
enough to fix the problem.  At least not on lo:0 127.0.0.2.

Changing the source address in the routing table as Joel suggested does
work around the problem.

So, in summary,  either the TFTP server needs to be changed per your
original suggestion, or the routing table needs to be altered for every
alias?  Is that correct?

josh

  reply	other threads:[~2011-10-10 15:11 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-05 20:27 loopback IP alias breaks tftp? Josh Boyer
2011-10-05 21:18 ` Julian Anastasov
2011-10-06 13:23   ` Josh Boyer
2011-10-07  7:02     ` Joel Sing
2011-10-07  7:29       ` Eric Dumazet
2011-10-07 11:40         ` Josh Boyer
2011-10-07 12:04           ` Eric Dumazet
2011-10-07 12:23             ` Eric Dumazet
2011-10-10 15:10               ` Josh Boyer [this message]
2011-10-10 15:15                 ` Olaf van der Spek
2011-10-10 15:22                   ` Eric Dumazet
2011-10-10 15:25                     ` Olaf van der Spek
2011-10-11  7:28                       ` Francis SOUYRI

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20111010151058.GD1165@zod.bos.redhat.com \
    --to=jwboyer@redhat.com \
    --cc=eric.dumazet@gmail.com \
    --cc=francis.souyri@apec.fr \
    --cc=ja@ssi.bg \
    --cc=jsing@google.com \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).