From: Joe Perches <joe@perches.com>
To: David Miller <davem@davemloft.net>
Cc: netdev@vger.kernel.org, herbert@gondor.apana.org.au,
eric.dumazet@gmail.com
Subject: Re: [PATCH 2/2] ipv4: Initialize on-stack cork more efficiently.
Date: Fri, 06 May 2011 15:44:54 -0700 [thread overview]
Message-ID: <1304721894.11874.28.camel@Joe-Laptop> (raw)
In-Reply-To: <20110506.152623.232747437.davem@davemloft.net>
On Fri, 2011-05-06 at 15:26 -0700, David Miller wrote:
> ip_setup_cork() explicitly initializes every member of
> inet_cork except flags, addr, and opt. So we can simply
> set those three members to zero instead of using a
> memset() via an empty struct assignment.
> Signed-off-by: David S. Miller <davem@davemloft.net>
> diff --git a/net/ipv4/ip_output.c b/net/ipv4/ip_output.c
[]
> @@ -1417,6 +1417,9 @@ struct sk_buff *ip_make_skb(struct sock *sk,
>
> __skb_queue_head_init(&queue);
>
> + cork.flags = 0;
> + cork.addr = 0;
> + cork.opt = 0;
cork.opt = NULL;
> err = ip_setup_cork(sk, &cork, ipc, rtp);
> if (err)
> return ERR_PTR(err);
Perhaps it'd be better to move the initialization
of all cork fields to ip_setup_cork.
next prev parent reply other threads:[~2011-05-06 22:44 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-05-06 22:26 [PATCH 2/2] ipv4: Initialize on-stack cork more efficiently David Miller
2011-05-06 22:35 ` Eric Dumazet
2011-05-06 22:37 ` David Miller
2011-05-07 5:11 ` Eric Dumazet
2011-05-07 5:21 ` David Miller
2011-05-06 22:44 ` Joe Perches [this message]
2011-05-06 22:59 ` David Miller
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=1304721894.11874.28.camel@Joe-Laptop \
--to=joe@perches.com \
--cc=davem@davemloft.net \
--cc=eric.dumazet@gmail.com \
--cc=herbert@gondor.apana.org.au \
--cc=netdev@vger.kernel.org \
/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