Cong Wang
2014-10-17 17:49:29 UTC
From: Cong Wang <***@twopensource.com>
Probably not a big deal, but IP is not the only network protocol,
don't clear skb->cb just for IP.
Also, IPv6 header is not always defined in struct tcp_skb_cb.
Cc: Krzysztof Kolasa <***@winsoft.pl>
Cc: Eric Dumazet <***@google.com>
Signed-off-by: Cong Wang <***@twopensource.com>
Signed-off-by: Cong Wang <***@gmail.com>
---
net/ipv4/tcp_output.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c
index e13d778..ee356e5 100644
--- a/net/ipv4/tcp_output.c
+++ b/net/ipv4/tcp_output.c
@@ -1005,9 +1005,7 @@ static int tcp_transmit_skb(struct sock *sk, struct sk_buff *skb, int clone_it,
/* Our usage of tstamp should remain private */
skb->tstamp.tv64 = 0;
- /* Cleanup our debris for IP stacks */
- memset(skb->cb, 0, max(sizeof(struct inet_skb_parm),
- sizeof(struct inet6_skb_parm)));
+ memset(TCP_SKB_CB(skb), 0, sizeof(*TCP_SKB_CB(skb)));
err = icsk->icsk_af_ops->queue_xmit(sk, skb, &inet->cork.fl);
Probably not a big deal, but IP is not the only network protocol,
don't clear skb->cb just for IP.
Also, IPv6 header is not always defined in struct tcp_skb_cb.
Cc: Krzysztof Kolasa <***@winsoft.pl>
Cc: Eric Dumazet <***@google.com>
Signed-off-by: Cong Wang <***@twopensource.com>
Signed-off-by: Cong Wang <***@gmail.com>
---
net/ipv4/tcp_output.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c
index e13d778..ee356e5 100644
--- a/net/ipv4/tcp_output.c
+++ b/net/ipv4/tcp_output.c
@@ -1005,9 +1005,7 @@ static int tcp_transmit_skb(struct sock *sk, struct sk_buff *skb, int clone_it,
/* Our usage of tstamp should remain private */
skb->tstamp.tv64 = 0;
- /* Cleanup our debris for IP stacks */
- memset(skb->cb, 0, max(sizeof(struct inet_skb_parm),
- sizeof(struct inet6_skb_parm)));
+ memset(TCP_SKB_CB(skb), 0, sizeof(*TCP_SKB_CB(skb)));
err = icsk->icsk_af_ops->queue_xmit(sk, skb, &inet->cork.fl);
--
1.8.3.1
1.8.3.1