From: Jacob L E Blain Christen <dweomer@entheal.com>
To: Sourav Ghosh <sourav@cs.cmu.edu>
Cc: linux-kernel@vger.kernel.org
Subject: Re: creation of sock
Date: Fri, 23 Feb 2001 16:53:10 -0500 [thread overview]
Message-ID: <3A96DBC6.D02192AA@entheal.com> (raw)
In-Reply-To: <3A96C858.5C8FB714@cs.cmu.edu>
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
sources
yields only one call that sets the "zero out the allocated struct"
boolean
to false and that is:
net/ipv4/tcp_minisocks.c:tcp_create_openreq_child().
this funtion in turn is only ever called from:
net/ipv[46]/tcp_ipv[46].c:tcp_v[46]_syn_recv_sock()
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
net/core/sock.c:sk_alloc()
if(sk && zero_it) {
memset(sk, 0, sizeof(struct sock));
sk->family = family;
sock_lock_init(sk);
}
with
if( sk ) {
/* set your NULL init values here */
if( zero_it ) {
memset(sk, 0, sizeof(struct sock));
sk->family = family;
sock_lock_init(sk);
}
}
doh! i just re-read your mail and realized youre using the 2.2.15
kernel.
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
the
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.
next prev parent reply other threads:[~2001-02-23 21:53 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-02-23 20:30 Sourav Ghosh
2001-02-23 21:53 ` Jacob L E Blain Christen [this message]
2001-02-24 16:30 ` Sourav Ghosh
2001-02-23 22:11 ` Jacob L E Blain Christen
2001-02-24 0:29 ` Sourav Ghosh
2001-02-24 1:48 ` Sourav Ghosh
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=3A96DBC6.D02192AA@entheal.com \
--to=dweomer@entheal.com \
--cc=jacob.blain.christen@entheal.com \
--cc=linux-kernel@vger.kernel.org \
--cc=sourav@cs.cmu.edu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®