netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: jamal <hadi@cyberus.ca>
To: Thomas Graf <tgraf@suug.ch>
Cc: davem@davemloft.net, netdev@vger.kernel.org
Subject: Re: [PATCH 3/3] [PKT_SCHED]: Fix error handling while dumping actions
Date: Wed, 05 Jul 2006 09:35:27 -0400	[thread overview]
Message-ID: <1152106527.5199.23.camel@jzny2> (raw)
In-Reply-To: <1152064058.5199.12.camel@jzny2>

Thomas, 

Please resubmit this patch with changing -err to -1 (i.e a one liner)
I went back to about 2.6.10 and this is in there. I looked at my notes
and i cant see any reasoning to explain this. So it is a bug.
Is there a way to check whether this was a result of some other earlier
change or was always there?

I would say patch #1 deserves to go into stable; the others for later.
And thank you for your efforts.

cheers,
jamal

On Tue, 2006-04-07 at 21:47 -0400, jamal wrote:
> I need to stare at this one for longer than 1 minute and i dont have
> time right now; it does look strange (I am unsure what my thoughts were
> at that point with -err - or maybe that was a change made by someone
> else). 
> I dont have time until tommorow - but i would  think the better fix will
> be to change "return -err" to  "return -1"?
> 
> cheers,
> jamal 
> 
> On Wed, 2006-05-07 at 00:00 +0200, Thomas Graf wrote:
> > plain text document attachment (act_fix_dump_err_handling)
> > "return -err" and blindly inheriting the error code in the netlink
> > failure exception handler causes errors codes to be returned as
> > positive value therefore making them being ignored by the caller.
> > 
> > May lead to sending out incomplete netlink messages.
> > 
> > Signed-off-by: Thomas Graf <tgraf@suug.ch>
> > 
> > 
> > Index: net-2.6.git/net/sched/act_api.c
> > ===================================================================
> > --- net-2.6.git.orig/net/sched/act_api.c
> > +++ net-2.6.git/net/sched/act_api.c
> > @@ -250,15 +250,17 @@ tcf_action_dump(struct sk_buff *skb, str
> >  		RTA_PUT(skb, a->order, 0, NULL);
> >  		err = tcf_action_dump_1(skb, a, bind, ref);
> >  		if (err < 0)
> > -			goto rtattr_failure;
> > +			goto errout;
> >  		r->rta_len = skb->tail - (u8*)r;
> >  	}
> >  
> >  	return 0;
> >  
> >  rtattr_failure:
> > +	err = -EINVAL;
> > +errout:
> >  	skb_trim(skb, b - skb->data);
> > -	return -err;
> > +	return err;
> >  }
> >  
> >  struct tc_action *tcf_action_init_1(struct rtattr *rta, struct rtattr *est,
> > 



  reply	other threads:[~2006-07-05 13:35 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-07-04 22:05 [PATCH 0/3] Action API fixes Thomas Graf
2006-07-04 22:00 ` [PATCH 1/3] [PKT_SCHED]: Fix illegal memory dereferences when dumping actions Thomas Graf
2006-07-04 23:42   ` Patrick McHardy
2006-07-05  1:49     ` jamal
2006-07-05  9:09     ` Thomas Graf
2006-07-05  1:34   ` jamal
2006-07-04 22:00 ` [PATCH 2/3] [PKT_SCHED]: Return ENOENT if action module is unavailable Thomas Graf
2006-07-05  1:40   ` jamal
2006-07-04 22:00 ` [PATCH 3/3] [PKT_SCHED]: Fix error handling while dumping actions Thomas Graf
2006-07-05  1:47   ` jamal
2006-07-05 13:35     ` jamal [this message]
2006-07-05 13:54       ` Thomas Graf
2006-07-05 14:00         ` jamal
2006-07-06  3:47 ` [PATCH 0/3] Action API fixes David Miller
2006-07-06 12:03   ` jamal
2006-07-06 12:27     ` jamal
2006-07-06 12:45       ` Thomas Graf
2006-07-06 12:53         ` jamal
2006-07-07  6:56         ` David Miller
2006-07-07  6:54     ` 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=1152106527.5199.23.camel@jzny2 \
    --to=hadi@cyberus.ca \
    --cc=davem@davemloft.net \
    --cc=netdev@vger.kernel.org \
    --cc=tgraf@suug.ch \
    /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).