Messages in this thread | | | Date | Thu, 3 Feb 2005 11:51:27 -0800 | From | Stephen Hemminger <> | Subject | Re: [PATCH] OpenBSD Networking-related randomization port |
| |
On Wed, 02 Feb 2005 18:38:37 +0100 Lorenzo Hernández García-Hierro <lorenzo@gnu.org> wrote:
> El mié, 02-02-2005 a las 17:17 +0000, linux@horizon.com escribió: > > There *are* things in OpenBSD, like randomized port assignment (as opposed > > to the linear scan in tcp_v4_get_port()) that would be worth emulating. > > Maybe worry about that first? > >
Recent 2.6 does a more advanced form of port randomization already using address hash at connect time. tcp_v4_get_port is only used for the case of applications that explicitly bind to port zero to find a free port.
So the sequence: socket(); connect(); will assign a random port in a manner similar to sequence number creation
The sequence: socket(); bind(); connect(); assigns a simple linear increasing port value. It could be randomized, but most applications don't bother binding, so the first case is sufficient.
-- Stephen Hemminger <shemminger@osdl.org> - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
| |