netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Thomas Graf <tgraf@suug.ch>
To: Jamal Hadi Salim <hadi@znyx.com>
Cc: "David S. Miller" <davem@davemloft.net>,
	netdev@oss.sgi.com, Patrick McHardy <kaber@trash.net>
Subject: Re: patch: introduce simple actions
Date: Sun, 20 Mar 2005 20:44:08 +0100	[thread overview]
Message-ID: <20050320194408.GU3086@postel.suug.ch> (raw)
In-Reply-To: <1111345551.1095.82.camel@jzny.localdomain>

* Jamal Hadi Salim <1111345551.1095.82.camel@jzny.localdomain> 2005-03-20 14:05
> 
> Ive posted this before - dont want it to sit here rotting. 
> If theres nothing glaringly wrong with it (Thomas/Patrick?) then Dave
> please apply so i can start shooting other patches based on it.

Looks good to me, see two minor comments below.

> +static inline int
> +tcf_defact_init(struct rtattr *rta, struct rtattr *est,
> +		struct tc_action *a, int ovr, int bind)
> +{
> +	struct rtattr *tb[TCA_DEF_MAX];
> +	struct tc_defact *parm;
> +	struct tcf_defact *p;
> +	void *defdata;
> +	u32 datalen = 0;
> +	int ret = 0;
> +
> +	if (rta == NULL || rtattr_parse_nested(tb, TCA_DEF_MAX, rta) < 0)
> +		return -EINVAL;
> +
> +	if (tb[TCA_DEF_PARMS - 1] == NULL)
> +		return -EINVAL;
> +	parm = RTA_DATA(tb[TCA_DEF_PARMS - 1]);
> +	defdata = RTA_DATA(tb[TCA_DEF_DATA - 1]);

Maybe do a size sanity check here for TCA_DEF_PARMS?

> +	if (defdata == NULL)
> +		return -EINVAL;
> +
> +	datalen = RTA_PAYLOAD(tb[TCA_DEF_DATA - 1]);
> --- /dev/null	2004-01-29 13:33:32.773091056 -0500
> +++ 2611-rc3+bk3/include/net/tc_act/tc_defact.h	2005-02-06 15:03:05.000000000 -0500
> @@ -0,0 +1,13 @@
> +#ifndef __NET_TC_DEF_H
> +#define __NET_TC_DEF_H
> +
> +#include <net/act_api.h>
> +
> +struct tcf_defact
> +{
> +	tca_gen(defact);
> +	u32     datalen;
> +	void    *defdata;
> +};
> +
> +#endif
> --- /dev/null	2004-01-29 13:33:32.773091056 -0500
> +++ 2611-rc3+bk3/include/linux/tc_act/tc_defact.h	2005-02-06 16:47:20.039209336 -0500
> @@ -0,0 +1,21 @@
> +#ifndef __LINUX_TC_DEF_H
> +#define __LINUX_TC_DEF_H
> +
> +#include <linux/pkt_cls.h>
> +
> +struct tc_defact
> +{
> +	tc_gen;
> +};

tcf_defact, tc_defact, .. quite easy to get this wrong. Maybe
it would a good idea to rename tcf_defact to tcf_defact_parm?

  parent reply	other threads:[~2005-03-20 19:44 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-03-20 19:05 patch: introduce simple actions Jamal Hadi Salim
2005-03-20 19:22 ` Patrick McHardy
2005-03-20 19:35   ` Jamal Hadi Salim
2005-03-20 19:58     ` Patrick McHardy
2005-03-20 20:17       ` Jamal Hadi Salim
2005-03-20 20:31         ` Thomas Graf
2005-03-20 20:41           ` jamal
2005-03-23  2:27         ` Patrick McHardy
2005-03-23  3:58         ` David S. Miller
2005-03-23  4:06           ` Jamal Hadi Salim
2005-04-06 13:29             ` PATCH: Allow Simple actions WAS(Re: " jamal
2005-04-25  3:10               ` David S. Miller
2005-03-20 19:44 ` Thomas Graf [this message]
2005-03-20 20:10   ` jamal
2005-03-20 20:18     ` Thomas Graf

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=20050320194408.GU3086@postel.suug.ch \
    --to=tgraf@suug.ch \
    --cc=davem@davemloft.net \
    --cc=hadi@znyx.com \
    --cc=kaber@trash.net \
    --cc=netdev@oss.sgi.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 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).