From: David Miller <davem@davemloft.net>
To: damian@tvk.rwth-aachen.de
Cc: netdev@vger.kernel.org
Subject: Re: [PATCH 1/3][v2] tcp: fix ICMP-RTO war: Check lower bound
Date: Sun, 31 Jan 2010 23:32:28 -0800 (PST) [thread overview]
Message-ID: <20100131.233228.48469829.davem@davemloft.net> (raw)
In-Reply-To: <4B635E1A.7040100@tvk.rwth-aachen.de>
From: Damian Lukowski <damian@tvk.rwth-aachen.de>
Date: Fri, 29 Jan 2010 23:15:54 +0100
> diff --git a/include/net/tcp.h b/include/net/tcp.h
> index 34f5cc2..ff6cbaa 100644
> --- a/include/net/tcp.h
> +++ b/include/net/tcp.h
> @@ -528,9 +528,12 @@ static inline void tcp_bound_rto(const struct sock *sk)
> inet_csk(sk)->icsk_rto = TCP_RTO_MAX;
> }
>
> +static inline u32 tcp_rto_min(struct sock *sk);
> static inline u32 __tcp_set_rto(const struct tcp_sock *tp)
> {
> - return (tp->srtt >> 3) + tp->rttvar;
> + u32 rto = (tp->srtt >> 3) + tp->rttvar;
> + u32 min = tcp_rto_min((struct sock *)tp);
> + return unlikely(rto < min) ? min : rto;
> }
>
> static inline void __tcp_fast_path_on(struct tcp_sock *tp, u32 snd_wnd)
Don't make assumptions about the layout and relationships
between struct sock and struct tcp_sock without using
the interfaces create for this purpose.
For this case, simply add a "struct sock *" first argument to
__tcp_set_rto() and update the callers.
Thanks.
prev parent reply other threads:[~2010-02-01 7:32 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-01-29 22:15 [PATCH 1/3][v2] tcp: fix ICMP-RTO war: Check lower bound Damian Lukowski
2010-02-01 7:32 ` David Miller [this message]
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=20100131.233228.48469829.davem@davemloft.net \
--to=davem@davemloft.net \
--cc=damian@tvk.rwth-aachen.de \
--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;
as well as URLs for NNTP newsgroup(s).