netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] act_mirred: don't go back.
@ 2009-11-09  6:43 Changli Gao
  2009-11-09  7:22 ` jamal
  0 siblings, 1 reply; 12+ messages in thread
From: Changli Gao @ 2009-11-09  6:43 UTC (permalink / raw)
  To: Jamal Hadi Salim; +Cc: Stephen Hemminger, David S. Miller, netdev, xiaosuo

don't go back.

don't go back.
----
net/sched/act_mirred.c | 24 +++++++++++++-----------
1 file changed, 13 insertions(+), 11 deletions(-)

diff --git a/net/sched/act_mirred.c b/net/sched/act_mirred.c
index b9aaab4..e1d8e2c 100644
--- a/net/sched/act_mirred.c
+++ b/net/sched/act_mirred.c
@@ -160,17 +160,7 @@ static int tcf_mirred(struct sk_buff *skb, struct tc_action *a,
 		if (net_ratelimit())
 			printk("mirred to Houston: device %s is gone!\n",
 			       dev->name);
-bad_mirred:
-		if (skb2 != NULL)
-			kfree_skb(skb2);
-		m->tcf_qstats.overlimits++;
-		m->tcf_bstats.bytes += qdisc_pkt_len(skb);
-		m->tcf_bstats.packets++;
-		spin_unlock(&m->tcf_lock);
-		/* should we be asking for packet to be dropped?
-		 * may make sense for redirect case only
-		*/
-		return TC_ACT_SHOT;
+		goto bad_mirred;
 	}
 
 	skb2 = skb_act_clone(skb, GFP_ATOMIC);
@@ -199,6 +189,18 @@ bad_mirred:
 	dev_queue_xmit(skb2);
 	spin_unlock(&m->tcf_lock);
 	return m->tcf_action;
+
+bad_mirred:
+	if (skb2 != NULL)
+		kfree_skb(skb2);
+	m->tcf_qstats.overlimits++;
+	m->tcf_bstats.bytes += qdisc_pkt_len(skb);
+	m->tcf_bstats.packets++;
+	spin_unlock(&m->tcf_lock);
+	/* should we be asking for packet to be dropped?
+	 * may make sense for redirect case only
+	 */
+	return TC_ACT_SHOT;
 }
 
 static int tcf_mirred_dump(struct sk_buff *skb, struct tc_action *a, int bind, int ref)



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

end of thread, other threads:[~2009-11-11  9:23 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-11-09  6:43 [PATCH] act_mirred: don't go back Changli Gao
2009-11-09  7:22 ` jamal
2009-11-09  8:31   ` Changli Gao
2009-11-09 10:54     ` jamal
2009-11-09 11:06       ` Changli Gao
2009-11-09 12:33       ` Changli Gao
2009-11-10  7:40         ` jamal
2009-11-10  8:50           ` Changli Gao
2009-11-11  8:11             ` jamal
2009-11-11  8:44               ` Changli Gao
2009-11-11  9:03                 ` jamal
2009-11-11  9:23                   ` Changli Gao

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