Message-ID: <440E316F.5080200@...41...> From: James Yonan MIME-Version: 1.0 Subject: Re: [Openvpn-devel] float is broken when source port changes References: <440D05E9.7030203@...564...> <1e6368e80603070813y6d2d144ex3cef3a8a26a02d9@...278...> <440DBD44.5060302@...564...> <440DD137.3060604@...41...> <440E24BE.3040904@...564...> In-Reply-To: <440E24BE.3040904@...564...> Sender: openvpn-devel-admin@lists.sourceforge.net Errors-To: openvpn-devel-admin@lists.sourceforge.net List-Unsubscribe: , List-Id: List-Post: List-Help: List-Subscribe: , List-Archive: Date: Tue Mar 7 17:21:07 2006 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit To: Kosta Welke Cc: openvpn-devel@lists.sourceforge.net Kosta Welke wrote: > James Yonan wrote: > >> No, --float only applies to the IP address, not the port. > > Sadly, yes. > >> You can't really float on the port efficiently because a UDP socket >> needs to bind to some port number (either static or dynamic). To do >> port floating, you would need to bind to every possible port that a >> packet might come in on -- fairly impractical. > > No. Using the same logic the openvpn server would need to listen on > all 4,294,967,296 IP addresses. > It is the *client* port that changes, which can be detect just as > easily as a change in the client IP address. The only problem is that > it is not checked. > Please re-visit my original post to see under what circumstances the > IP address can stay the same while the client port number changes > *from the servers point of view*. > > I think I found the potions of the code that would need modification: > > - In mroute.h, struct mroute_addr would need an unsigned short port to > store the port number. Also, mroute_addr_equal() would need to return > false if the port numbers dont match > > - In mroute.c, mroute_extract_addr_from_packet() would need to get the > port number from the packet. This is the part where I'm not too sure. > Is it safe to assume that the UDP header starts just after the IP > header? To be honest, I never understood the concept of IP header > options... :) > > HTH, > Kosta Okay, I understand what you are asking for -- If you were using static key mode (which is stateless), you would get the behavior you are looking for. In TLS mode, however, OpenVPN doesn't allow a port or IP change within a given TLS session (for security/DoS reasons). The behavior you should be seeing is that the new port and IP address is only accepted by the server after a fresh TLS renegotiation. James