[lkml]   [2001]   [Feb]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: creation of sock
im a kernel newbie here so pardon "the blind leading the blind" ...

doing a quick search for all calls to sk_alloc in the entire kernel
yields only one call that sets the "zero out the allocated struct"
to false and that is:
this funtion in turn is only ever called from:

the comment above the ipv4 version is (verbatim):

* The three way handshake has completed - we got a valid synack -
* now create the new socket.

so if you need those experimental values of yours zeroed out on socket
creation i suggest replacing this snippet from

if(sk && zero_it) {
memset(sk, 0, sizeof(struct sock));
sk->family = family;


if( sk ) {
/* set your NULL init values here */
if( zero_it ) {
memset(sk, 0, sizeof(struct sock));
sk->family = family;

doh! i just re-read your mail and realized youre using the 2.2.15
my examples are from the 2.4.2 sources...

looking at the 2.2.16 source (i have only 2.2.1[46] and not 2.2.15 for
2.2 series) the (roughly) congruent if block of code is:

if(sk) {
if (zero_it)
memset(sk, 0, sizeof(struct sock));
sk->family = family;

and so if you're setting your init values to NULL under the "zero_it"
condition you would get the behavior that you reported.

hope that helps.
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

 \ /
  Last update: 2005-03-22 13:17    [W:0.070 / U:0.232 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site