netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Thomas Graf <tgraf@suug.ch>
To: davem@davemloft.net
Cc: netdev@vger.kernel.org, hadi@cyberus.ca
Subject: [PATCH 3/3] [PKT_SCHED]: Fix error handling while dumping actions
Date: Wed, 05 Jul 2006 00:00:03 +0200	[thread overview]
Message-ID: <20060704220550.406275000@postel.suug.ch> (raw)
In-Reply-To: 20060704220504.787776000@postel.suug.ch

[-- Attachment #1: act_fix_dump_err_handling --]
[-- Type: text/plain, Size: 932 bytes --]

"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,

--


  parent reply	other threads:[~2006-07-04 22:06 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 ` Thomas Graf [this message]
2006-07-05  1:47   ` [PATCH 3/3] [PKT_SCHED]: Fix error handling while dumping actions jamal
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=20060704220550.406275000@postel.suug.ch \
    --to=tgraf@suug.ch \
    --cc=davem@davemloft.net \
    --cc=hadi@cyberus.ca \
    --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).