]> git.hungrycats.org Git - linux/commitdiff
[NET]: Two tc action fixes.
authorJamal Hadi Salim <hadi@zynx.com>
Tue, 29 Jun 2004 07:20:59 +0000 (00:20 -0700)
committerDavid S. Miller <davem@nuts.davemloft.net>
Tue, 29 Jun 2004 07:20:59 +0000 (00:20 -0700)
Another patchlet after turning on preempt and rerunning tests.
- against dev.c is a genuine bug - i wish preempt would have
given a more sane hint. Strange on how its a non issue when preempt is
off.
- against act_api.c is just an annoyance. I removed the kmod because it
will only make sense to list actions if policies exist for that action.
And if policies exist, the module would be loaded.

Signed-off-by: Jamal Hadi Salim <hadi@zynx.com>
Signed-off-by: David S. Miller <davem@redhat.com>
net/core/dev.c
net/sched/act_api.c

index 7ded444a61fe575468f50e97e90565038ceb86a8..381cd85a4c206a067ffa9a14cb35096180ea88fa 100644 (file)
@@ -1834,6 +1834,7 @@ int netif_receive_skb(struct sk_buff *skb)
 #ifdef CONFIG_NET_CLS_ACT
        if (skb->tc_verd & TC_NCLS) {
                skb->tc_verd = CLR_TC_NCLS(skb->tc_verd);
+               rcu_read_lock();
                goto ncls;
        }
  #endif
index 1e3bf5b42715cb7501e68e03a42cffddaf2cca6d..58d37d6bd48209f96e071243a10220012e231f63 100644 (file)
 #else
 #define DPRINTK(format,args...)
 #endif
+#if 0 /* data */
+#define D2PRINTK(format,args...) printk(KERN_DEBUG format,##args)
+#else
+#define D2PRINTK(format,args...)
+#endif
 
 static struct tc_action_ops *act_base = NULL;
 static rwlock_t act_mod_lock = RW_LOCK_UNLOCKED;
@@ -158,7 +163,7 @@ int tcf_action_exec(struct sk_buff *skb,struct tc_action *act)
 
        if (skb->tc_verd & TC_NCLS) {
                skb->tc_verd = CLR_TC_NCLS(skb->tc_verd);
-               DPRINTK("(%p)tcf_action_exec: cleared TC_NCLS in %s out %s\n",skb,skb->input_dev?skb->input_dev->name:"xxx",skb->dev->name);
+               D2PRINTK("(%p)tcf_action_exec: cleared TC_NCLS in %s out %s\n",skb,skb->input_dev?skb->input_dev->name:"xxx",skb->dev->name);
                return TC_ACT_OK;
        }
        while ((a = act) != NULL) {
@@ -816,6 +821,8 @@ int tcf_action_add(struct rtattr *rta, struct nlmsghdr *n, u32 pid, int ovr )
        if (NULL == act)
                return -ENOMEM;
 
+       memset(act, 0, sizeof(*act));
+
        ret = tcf_action_init(rta, NULL,act,NULL,ovr,0);
        /* NOTE: We have an all-or-none model
         * This means that of any of the actions fail
@@ -936,13 +943,6 @@ tc_dump_action(struct sk_buff *skb, struct netlink_callback *cb)
 
        a_o = tc_lookup_action_n(kind);
 
-#ifdef CONFIG_KMOD
-       if (NULL == a_o) {
-               DPRINTK("tc_dump_action: trying to load module %s\n", kind);
-               request_module(kind);
-               a_o = tc_lookup_action_n(kind);
-       }
-#endif
        if (NULL == a_o) {
                printk("failed to find %s\n", kind);
                return 0;