netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH PKT_SCHED 11/17]: Remove checks for impossible conditions in ipt action
@ 2004-12-30  3:40 Patrick McHardy
  2004-12-30 13:40 ` Thomas Graf
  0 siblings, 1 reply; 3+ messages in thread
From: Patrick McHardy @ 2004-12-30  3:40 UTC (permalink / raw)
  To: jamal; +Cc: Maillist netdev

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

Remove checks for impossible conditions in ipt action, same as for gact.


[-- Attachment #2: 11.diff --]
[-- Type: text/x-patch, Size: 1394 bytes --]

# This is a BitKeeper generated diff -Nru style patch.
#
# ChangeSet
#   2004/12/30 02:52:02+01:00 kaber@coreworks.de 
#   [PKT_SCHED]: Remove checks for impossible conditions in ipt action
#   
#   Signed-off-by: Patrick McHardy <kaber@trash.net>
# 
# net/sched/ipt.c
#   2004/12/30 02:51:56+01:00 kaber@coreworks.de +1 -9
#   [PKT_SCHED]: Remove checks for impossible conditions in ipt action
#   
#   Signed-off-by: Patrick McHardy <kaber@trash.net>
# 
diff -Nru a/net/sched/ipt.c b/net/sched/ipt.c
--- a/net/sched/ipt.c	2004-12-30 04:01:42 +01:00
+++ b/net/sched/ipt.c	2004-12-30 04:01:42 +01:00
@@ -104,8 +104,7 @@
 	u32 index = 0;
 	u32 hook = 0;
 
-	if (a == NULL || rta == NULL ||
-	    rtattr_parse(tb, TCA_IPT_MAX, RTA_DATA(rta), RTA_PAYLOAD(rta)) < 0)
+	if (rtattr_parse(tb, TCA_IPT_MAX, RTA_DATA(rta), RTA_PAYLOAD(rta)) < 0)
 		return -1;
 
 	if (tb[TCA_IPT_INDEX - 1]) {
@@ -243,9 +242,6 @@
 	struct tcf_ipt *p = PRIV(a, ipt);
 	struct sk_buff *skb = *pskb;
 
-	if (p == NULL || skb == NULL)
-		return -1;
-
 	spin_lock(&p->lock);
 
 	p->tm.lastuse = jiffies;
@@ -293,10 +289,6 @@
 	unsigned char *b = skb->tail;
 	struct tcf_ipt *p = PRIV(a, ipt);
 
-	if (p == NULL) {
-		printk("BUG: tcf_ipt_dump called with NULL params\n");
-		goto rtattr_failure;
-	}
 	/* for simple targets kernel size == user size
 	** user name = target name
 	** for foolproof you need to not assume this

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH PKT_SCHED 11/17]: Remove checks for impossible conditions in ipt action
  2004-12-30  3:40 [PATCH PKT_SCHED 11/17]: Remove checks for impossible conditions in ipt action Patrick McHardy
@ 2004-12-30 13:40 ` Thomas Graf
  2004-12-30 14:25   ` Patrick McHardy
  0 siblings, 1 reply; 3+ messages in thread
From: Thomas Graf @ 2004-12-30 13:40 UTC (permalink / raw)
  To: Patrick McHardy; +Cc: jamal, Maillist netdev

* Patrick McHardy <41D378AB.70204@trash.net> 2004-12-30 04:40
> -	if (a == NULL || rta == NULL ||
> -	    rtattr_parse(tb, TCA_IPT_MAX, RTA_DATA(rta), RTA_PAYLOAD(rta)) < 0)
> +	if (rtattr_parse(tb, TCA_IPT_MAX, RTA_DATA(rta), RTA_PAYLOAD(rta)) < 0)
>  		return -1;

You might want to use rtattr_parse_nested here (see patch 1 of my latest
patchset)

if (rtattr_parse_nested(tb, TCA_IPT_MAX, rta) < 0)

Purely cosmetic though. It gives a slightly better hint on what is being
done.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH PKT_SCHED 11/17]: Remove checks for impossible conditions in ipt action
  2004-12-30 13:40 ` Thomas Graf
@ 2004-12-30 14:25   ` Patrick McHardy
  0 siblings, 0 replies; 3+ messages in thread
From: Patrick McHardy @ 2004-12-30 14:25 UTC (permalink / raw)
  To: Thomas Graf; +Cc: jamal, Maillist netdev

Thomas Graf wrote:
> * Patrick McHardy <41D378AB.70204@trash.net> 2004-12-30 04:40
> 
>>-	if (a == NULL || rta == NULL ||
>>-	    rtattr_parse(tb, TCA_IPT_MAX, RTA_DATA(rta), RTA_PAYLOAD(rta)) < 0)
>>+	if (rtattr_parse(tb, TCA_IPT_MAX, RTA_DATA(rta), RTA_PAYLOAD(rta)) < 0)
>> 		return -1;
> 
> 
> You might want to use rtattr_parse_nested here (see patch 1 of my latest
> patchset)
> 
> if (rtattr_parse_nested(tb, TCA_IPT_MAX, rta) < 0)
> 
> Purely cosmetic though. It gives a slightly better hint on what is being
> done.

We can do this once your changes are merged (I'll review
them later today). For now I prefer to leave it this way
so I can work on a vanilla tree.

Regards
Patrick

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2004-12-30 14:25 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-12-30  3:40 [PATCH PKT_SCHED 11/17]: Remove checks for impossible conditions in ipt action Patrick McHardy
2004-12-30 13:40 ` Thomas Graf
2004-12-30 14:25   ` Patrick McHardy

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).