diff options
author | David S. Miller <davem@davemloft.net> | 2011-05-06 18:06:01 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-05-06 18:37:57 -0400 |
commit | b80d72261aec5e763a76497eba5fddc84833a154 (patch) | |
tree | 08480c09ea98195bbc48d5e52282b7129ccfd98b /net | |
parent | bdc712b4c2baf9515887de3a52e7ecd89fafc0c7 (diff) |
ipv4: Initialize on-stack cork more efficiently.
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>
Acked-by: Eric Dumazet <eric.dumazet@gmail.com>
Diffstat (limited to 'net')
-rw-r--r-- | net/ipv4/ip_output.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/net/ipv4/ip_output.c b/net/ipv4/ip_output.c index eb0647a2f073..5f5fe4f742b9 100644 --- a/net/ipv4/ip_output.c +++ b/net/ipv4/ip_output.c | |||
@@ -1408,7 +1408,7 @@ struct sk_buff *ip_make_skb(struct sock *sk, | |||
1408 | struct ipcm_cookie *ipc, struct rtable **rtp, | 1408 | struct ipcm_cookie *ipc, struct rtable **rtp, |
1409 | unsigned int flags) | 1409 | unsigned int flags) |
1410 | { | 1410 | { |
1411 | struct inet_cork cork = {}; | 1411 | struct inet_cork cork; |
1412 | struct sk_buff_head queue; | 1412 | struct sk_buff_head queue; |
1413 | int err; | 1413 | int err; |
1414 | 1414 | ||
@@ -1417,6 +1417,9 @@ struct sk_buff *ip_make_skb(struct sock *sk, | |||
1417 | 1417 | ||
1418 | __skb_queue_head_init(&queue); | 1418 | __skb_queue_head_init(&queue); |
1419 | 1419 | ||
1420 | cork.flags = 0; | ||
1421 | cork.addr = 0; | ||
1422 | cork.opt = 0; | ||
1420 | err = ip_setup_cork(sk, &cork, ipc, rtp); | 1423 | err = ip_setup_cork(sk, &cork, ipc, rtp); |
1421 | if (err) | 1424 | if (err) |
1422 | return ERR_PTR(err); | 1425 | return ERR_PTR(err); |