All of lore.kernel.org
 help / color / mirror / Atom feed
From: Hannes Frederic Sowa <hannes@stressinduktion.org>
To: Stephen Hemminger <shemminger@vyatta.com>,
	netdev@vger.kernel.org, eric.dumazet@gmail.com,
	davem@davemloft.net
Subject: Re: [PATCH] tcp: make sysctl_tcp_ecn namespace aware
Date: Sun, 6 Jan 2013 02:18:49 +0100	[thread overview]
Message-ID: <20130106011849.GA28545@order.stressinduktion.org> (raw)
In-Reply-To: <20130105190508.GE4031@order.stressinduktion.org>

On Sat, Jan 05, 2013 at 08:05:08PM +0100, Hannes Frederic Sowa wrote:
> On Sat, Jan 05, 2013 at 11:00:05AM -0800, Stephen Hemminger wrote:
> > Rather than passing sysctl_tcp_ecn around as a parameter, I think it
> > would be clearer and more efficient to make the ECN functions namespace
> > aware.
> > 
> > Instead of:
> > > @@ -728,7 +728,8 @@ struct tcp_skb_cb {
> > >   * notifications, we disable TCP ECN negociation.
> > >   */
> > >  static inline void
> > > -TCP_ECN_create_request(struct request_sock *req, const struct sk_buff *skb)
> > > +TCP_ECN_create_request(struct request_sock *req, const struct sk_buff *skb,
> > > +		int sysctl_tcp_ecn)
> > >  {
> > >  	const struct tcphdr *th = tcp_hdr(skb);
> > >  
> > 
> > @@ -731,8 +730,9 @@ static inline void
> >  TCP_ECN_create_request(struct request_sock *req, const struct sk_buff *skb)
> >  {
> >         const struct tcphdr *th = tcp_hdr(skb);
> > -
> > -       if (sysctl_tcp_ecn && th->ece && th->cwr &&
> > +       
> > +       if (sock_net(req->sk)->ipv4.sysctl_tcp_ecn && 
> > +           th->ece && th->cwr &&
> >             INET_ECN_is_not_ect(TCP_SKB_CB(skb)->ip_dsfield))
> >                 inet_rsk(req)->ecn_ok = 1;
> 
> Having a quick look, I think req->sk is not initialized at that moment, but
> I'll verify later.

I just verified that req->sk is indeed not initialized at that point. I
had a kernel panic on the first syn packet. So I would propose to keep
the patch as it is.

  reply	other threads:[~2013-01-06  1:18 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-05 15:01 [PATCH] tcp: make sysctl_tcp_ecn namespace aware Hannes Frederic Sowa
2013-01-05 19:00 ` Stephen Hemminger
2013-01-05 19:05   ` Hannes Frederic Sowa
2013-01-06  1:18     ` Hannes Frederic Sowa [this message]
2013-01-06  1:27       ` Eric Dumazet
2013-01-06  2:10         ` Hannes Frederic Sowa
2013-01-06  2:19           ` Eric Dumazet
2013-01-07  5:10             ` 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=20130106011849.GA28545@order.stressinduktion.org \
    --to=hannes@stressinduktion.org \
    --cc=davem@davemloft.net \
    --cc=eric.dumazet@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=shemminger@vyatta.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.