* [PATCH] tcp: remove duplicate th = tcp_hdr(skb)
@ 2011-01-13 15:41 Christoph Paasch
2011-01-13 15:54 ` Jesse Gross
2011-01-13 15:59 ` Eric Dumazet
0 siblings, 2 replies; 3+ messages in thread
From: Christoph Paasch @ 2011-01-13 15:41 UTC (permalink / raw)
To: davem, netdev; +Cc: Christoph Paasch
th is already set some lines before to be th = tcp_hdr(skb).
Signed-off-by: Christoph Paasch <christoph.paasch@uclouvain.be>
---
net/ipv4/tcp_ipv4.c | 1 -
1 files changed, 0 insertions(+), 1 deletions(-)
diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c
index 856f684..7fe29c6 100644
--- a/net/ipv4/tcp_ipv4.c
+++ b/net/ipv4/tcp_ipv4.c
@@ -1644,7 +1644,6 @@ int tcp_v4_rcv(struct sk_buff *skb)
if (!skb_csum_unnecessary(skb) && tcp_v4_checksum_init(skb))
goto bad_packet;
- th = tcp_hdr(skb);
iph = ip_hdr(skb);
TCP_SKB_CB(skb)->seq = ntohl(th->seq);
TCP_SKB_CB(skb)->end_seq = (TCP_SKB_CB(skb)->seq + th->syn + th->fin +
--
1.7.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] tcp: remove duplicate th = tcp_hdr(skb)
2011-01-13 15:41 [PATCH] tcp: remove duplicate th = tcp_hdr(skb) Christoph Paasch
@ 2011-01-13 15:54 ` Jesse Gross
2011-01-13 15:59 ` Eric Dumazet
1 sibling, 0 replies; 3+ messages in thread
From: Jesse Gross @ 2011-01-13 15:54 UTC (permalink / raw)
To: Christoph Paasch; +Cc: davem, netdev
On Thu, Jan 13, 2011 at 10:41 AM, Christoph Paasch
<christoph.paasch@uclouvain.be> wrote:
> th is already set some lines before to be th = tcp_hdr(skb).
>
> Signed-off-by: Christoph Paasch <christoph.paasch@uclouvain.be>
> ---
> net/ipv4/tcp_ipv4.c | 1 -
> 1 files changed, 0 insertions(+), 1 deletions(-)
>
> diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c
> index 856f684..7fe29c6 100644
> --- a/net/ipv4/tcp_ipv4.c
> +++ b/net/ipv4/tcp_ipv4.c
> @@ -1644,7 +1644,6 @@ int tcp_v4_rcv(struct sk_buff *skb)
> if (!skb_csum_unnecessary(skb) && tcp_v4_checksum_init(skb))
> goto bad_packet;
>
> - th = tcp_hdr(skb);
It needs to be reloaded because pskb_may_pull() may reallocate the buffer.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] tcp: remove duplicate th = tcp_hdr(skb)
2011-01-13 15:41 [PATCH] tcp: remove duplicate th = tcp_hdr(skb) Christoph Paasch
2011-01-13 15:54 ` Jesse Gross
@ 2011-01-13 15:59 ` Eric Dumazet
1 sibling, 0 replies; 3+ messages in thread
From: Eric Dumazet @ 2011-01-13 15:59 UTC (permalink / raw)
To: Christoph Paasch; +Cc: davem, netdev
Le jeudi 13 janvier 2011 à 16:41 +0100, Christoph Paasch a écrit :
> th is already set some lines before to be th = tcp_hdr(skb).
>
> Signed-off-by: Christoph Paasch <christoph.paasch@uclouvain.be>
> ---
> net/ipv4/tcp_ipv4.c | 1 -
> 1 files changed, 0 insertions(+), 1 deletions(-)
>
> diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c
> index 856f684..7fe29c6 100644
> --- a/net/ipv4/tcp_ipv4.c
> +++ b/net/ipv4/tcp_ipv4.c
> @@ -1644,7 +1644,6 @@ int tcp_v4_rcv(struct sk_buff *skb)
> if (!skb_csum_unnecessary(skb) && tcp_v4_checksum_init(skb))
> goto bad_packet;
>
Well... no please.
> - th = tcp_hdr(skb);
> iph = ip_hdr(skb);
> TCP_SKB_CB(skb)->seq = ntohl(th->seq);
> TCP_SKB_CB(skb)->end_seq = (TCP_SKB_CB(skb)->seq + th->syn + th->fin +
Hint : pskb_may_pull() can change tcp_hdr(skb) result.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2011-01-13 15:59 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-01-13 15:41 [PATCH] tcp: remove duplicate th = tcp_hdr(skb) Christoph Paasch
2011-01-13 15:54 ` Jesse Gross
2011-01-13 15:59 ` Eric Dumazet
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox