login
Header Space

 
 

gbnaidu's blog

Socket port selection code details

December 1, 2004 - 1:34am
Submitted by gbnaidu on December 1, 2004 - 1:34am.

From: Roberto Nibali drugphish.ch>
Subject: Re: client socket and source port selection
Newsgroups: gmane.linux.network.general, gmane.linux.kernel
Date: Mon, 29 Nov 2004 23:32:46 +0100

Hello,

> For the project i'm doing, i must know how the Linux kernel allocate
> sockets source port (from the dynamic range of the (2**16)-1 ports). I
> looked on the Web but it's really hard to find the algoritm of the

Setting the IP version field in the packet....

October 12, 2004 - 5:30pm
Submitted by gbnaidu on October 12, 2004 - 5:30pm.

fillpacket() function in pktgen.c is setting this version field.
check this link:

    http://lxr.linux.no/source/net/core/pktgen.c#L495<\ul> (of 2.4.20).
speck-geostationary