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


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,
> 
> --
> 
> -
> To unsubscribe from this list: send the line "unsubscribe netdev" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 


  reply	other threads:[~2006-07-05  1:47 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 [this message]
2006-07-05 13:35     ` jamal
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=1152064058.5199.12.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).