From reinierk@titan.kleipool.org  Tue Oct 14 07:41:17 2003
Return-Path: <reinierk@titan.kleipool.org>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 7815F16A4B3
	for <FreeBSD-gnats-submit@freebsd.org>; Tue, 14 Oct 2003 07:41:17 -0700 (PDT)
Received: from titan.kleipool.org (e137166.upc-e.chello.nl [213.93.137.166])
	by mx1.FreeBSD.org (Postfix) with ESMTP id EE57743F75
	for <FreeBSD-gnats-submit@freebsd.org>; Tue, 14 Oct 2003 07:41:11 -0700 (PDT)
	(envelope-from reinierk@titan.kleipool.org)
Received: (from root@localhost)
	by titan.kleipool.org (8.12.6/8.12.6) id h9EEf8NP006731;
	Tue, 14 Oct 2003 16:41:08 +0200 (CEST)
	(envelope-from reinierk)
Message-Id: <200310141441.h9EEf8NP006731@titan.kleipool.org>
Date: Tue, 14 Oct 2003 16:41:08 +0200 (CEST)
From: reinier@protocomix.nl
Reply-To:
To: FreeBSD-gnats-submit@freebsd.org
Cc: reinier@protocomix.nl
Subject: Multihomed tftpd enhancement
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         58012
>Category:       bin
>Synopsis:       [patch] tftpd(8) Multihomed tftpd enhancement
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          update
>Submitter-Id:   current-users
>Arrival-Date:   Tue Oct 14 07:50:20 PDT 2003
>Closed-Date:    
>Last-Modified:  Sat May 24 19:03:25 UTC 2008
>Originator:     Reinier Kleipool
>Release:        FreeBSD 4.7-RELEASE i386
>Organization:
Protocomix
>Environment:
System: FreeBSD titan.kleipool.org 4.7-RELEASE FreeBSD 4.7-RELEASE #1: Sat Dec 28 13:19:57 CET 2002 reinierk@mail.uitwisseling.nl:/usr/src/sys/compile/OPTIPLEX i386

>Description:
	tftpd confuses clients on multihomed hosts:
	When the tftpd receives a connection from the client it answers on a new
	connection. This connection is bound to INADDR_ANY. On a multihomed host
	the routing may select another interface closer to the client as its source
	IP address. This confuses the client (they are trivial afterall!) because
	it may think the reply is coming from another host.
	This enhancement extracts the original destination IP address on a multihomed
	host from the first arriving packet, and uses that as the ip address to bind
	the new connection to.
>How-To-Repeat:
	Connect from a tftp client to the IP address of an interface on the server
	host that is not the closest one to the client. The return connection will
	have the IP address of the closer interface.
	You can watch this with tcpdump.
>Fix:
	Patch /usr/src/libexec/tftpd.c with this diff -u: (diff.out.gz.uue)

begin 644 diff.out.gz
M'XL("!\'C#\``V1I9F8N;W5T`(57ZV_B1A#_[/P5HYPN@N`0'@E'DA(EUW`I
MNEQ`A.NIK2K+V$M8Q?:ZWC6/5O>_=V9W[7`$V@^097;>C]]L3DY.0,U4&M:#
MNLCXLS/)&0P#!<TS:+8NV]W+Q@6T&HWV0:U6*SA_8.I<MEJ7S8YANKF!D_,/
M;@=J^/T!;FX.X!U/@B@/&?PDU_)4*E_5Y]=OR")X8;LNU#IEDNBU'^DY%YI[
MDS]ABN/GE"=;BOPL]4_)=Z*3B]TVN=@]LR[R1#DI8]F5.69L%:N%'T$/)H,O
M_>'7B;V(_97B,1.YPJOSX_*R1I<R"]Q0JBOM4\AFZ(HS^CQY&OS>=Y[Z]_2W
M=G8`P=S/G&D^^\/>_7FE/;IHD$<7+;?5UBY)E>4!*L6\^&&8>5*)S']F,,M$
M;+VA8\02,E@[/88GIO(4?(CE\SS,K((\0Q&1P8QG4J%4(&*>/$/J4[H/:G`,
M4L"20>`GP%8J\[&H:LX@9!)SZ2LN$B#[3$H0,[K20D:=T5+7E&\,$L9"Y.`2
M?&3.T07\"MBK?`)Q'BD^%S$RSH544HO>1NB#9*A`*"9ARB*QI(O3@YH)`AP;
MDS;K&;-7Q:W#Q8(%@"GU\.\58"H,A>)&ZJ8BB-=>8)7]@S:(^3;T4V4BQ0B+
MVR57<\B$B+4:'U/G41P4FLZ/KS#3+)ZR3.MWG-S#F@!H!1Z5Q4'=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>Q9(&7]'TS/T%S82O.[W<
M8O16L_/R]6YDI`R:N"2$H_>BIX,,U0'G,9>T?I@*$16C")YQ/C`<C;\MLU#:
MK>[K0D'H#.90B5E=2F_FQSQ:4W1X%6`7PNTG;_#8GUP2P=FUL0CL8U8]N9:X
MFE.1T<NRH4/_?W:BU:59Z+WM]5Q7PM[I'>!,,34O5]N.=?9[UMFTU=GPC5+1
M;N@7=/O\S&VV]ZTB`I:]:\C13Z^0$[@AU*#D,P$EUJIX-F)5=CQ#$8D1Q$*L
MD<%OD20(\<2@X05?X+U$B7FT/4RO^=#=A*]URP?[\JR7^=M,D[A]W\/'RJJ*
M\OAU!(W5;%8ES=MI&+.`\06Z7/2D!NSW45[?^-#NVR(=ND"HB4;0V>OKUAD^
M&NRYV7D]=XMCM>3'))3\^FSY];E;'*N@:T%3:;-8H7^"W/]XD-`W-3J]28I!
1WE5YJV]7\?\%0G+T'W$.````
`
end
>Release-Note:
>Audit-Trail:

From: Bruce M Simpson <bms@spc.org>
To: freebsd-gnats-submit@FreeBSD.org
Cc:  
Subject: Re: bin/58012: Multihomed tftpd enhancement
Date: Wed, 23 Jun 2004 02:08:34 +0100

 The patch attached to the PR is horrid and needs much improvement.
 Off to look at something else...
 
 BMS
Responsible-Changed-From-To: freebsd-bugs->edwin 
Responsible-Changed-By: edwin 
Responsible-Changed-When: Mon Oct 8 09:08:44 UTC 2007 
Responsible-Changed-Why:  
I'll take TFTP PRs 

http://www.freebsd.org/cgi/query-pr.cgi?pr=58012 
Responsible-Changed-From-To: edwin->freebsd-bugs 
Responsible-Changed-By: edwin 
Responsible-Changed-When: Thu Feb 14 10:27:36 UTC 2008 
Responsible-Changed-Why:  

Give back into the pool until later. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=58012 
>Unformatted:
