to this qdisc, (optionally) tests for protocol and asks
    specific classifiers.
  */
+int tc_classify_compat(struct sk_buff *skb, struct tcf_proto *tp,
+                      struct tcf_result *res)
+{
+       __be16 protocol = skb->protocol;
+       int err = 0;
+
+       for (; tp; tp = tp->next) {
+               if ((tp->protocol == protocol ||
+                    tp->protocol == htons(ETH_P_ALL)) &&
+                   (err = tp->classify(skb, tp, res)) >= 0) {
+#ifdef CONFIG_NET_CLS_ACT
+                       if (err != TC_ACT_RECLASSIFY && skb->tc_verd)
+                               skb->tc_verd = SET_TC_VERD(skb->tc_verd, 0);
+#endif
+                       return err;
+               }
+       }
+       return -1;
+}
+EXPORT_SYMBOL(tc_classify_compat);
+
 int tc_classify(struct sk_buff *skb, struct tcf_proto *tp,
-       struct tcf_result *res)
+               struct tcf_result *res)
 {
        int err = 0;
-       __be16 protocol = skb->protocol;
+       __be16 protocol;
 #ifdef CONFIG_NET_CLS_ACT
        struct tcf_proto *otp = tp;
 reclassify:
 #endif
        protocol = skb->protocol;
 
-       for ( ; tp; tp = tp->next) {
-               if ((tp->protocol == protocol ||
-                       tp->protocol == htons(ETH_P_ALL)) &&
-                       (err = tp->classify(skb, tp, res)) >= 0) {
+       err = tc_classify_compat(skb, tp, res);
 #ifdef CONFIG_NET_CLS_ACT
-                       if ( TC_ACT_RECLASSIFY == err) {
-                               __u32 verd = (__u32) G_TC_VERD(skb->tc_verd);
-                               tp = otp;
-
-                               if (MAX_REC_LOOP < verd++) {
-                                       printk("rule prio %d protocol %02x reclassify is buggy packet dropped\n",
-                                               tp->prio&0xffff, ntohs(tp->protocol));
-                                       return TC_ACT_SHOT;
-                               }
-                               skb->tc_verd = SET_TC_VERD(skb->tc_verd,verd);
-                               goto reclassify;
-                       } else {
-                               if (skb->tc_verd)
-                                       skb->tc_verd = SET_TC_VERD(skb->tc_verd,0);
-                               return err;
-                       }
-#else
-
-                       return err;
-#endif
+       if (err == TC_ACT_RECLASSIFY) {
+               u32 verd = G_TC_VERD(skb->tc_verd);
+               tp = otp;
+
+               if (verd++ >= MAX_REC_LOOP) {
+                       printk("rule prio %u protocol %02x reclassify loop, "
+                              "packet dropped\n",
+                              tp->prio&0xffff, ntohs(tp->protocol));
+                       return TC_ACT_SHOT;
                }
-
+               skb->tc_verd = SET_TC_VERD(skb->tc_verd, verd);
+               goto reclassify;
        }
-       return -1;
+#endif
+       return err;
 }
+EXPORT_SYMBOL(tc_classify);
 
 void tcf_destroy(struct tcf_proto *tp)
 {
 EXPORT_SYMBOL(qdisc_put_rtab);
 EXPORT_SYMBOL(register_qdisc);
 EXPORT_SYMBOL(unregister_qdisc);
-EXPORT_SYMBOL(tc_classify);
 
        unsigned char           priority2;      /* priority to be used after overlimit */
        unsigned char           ewma_log;       /* time constant for idle time calculation */
        unsigned char           ovl_strategy;
-#ifdef CONFIG_NET_CLS_POLICE
+#if defined(CONFIG_NET_CLS_ACT) || defined(CONFIG_NET_CLS_POLICE)
        unsigned char           police;
 #endif
 
        struct cbq_class        *active[TC_CBQ_MAXPRIO+1];      /* List of all classes
                                                                   with backlog */
 
-#ifdef CONFIG_NET_CLS_POLICE
+#if defined(CONFIG_NET_CLS_ACT) || defined(CONFIG_NET_CLS_POLICE)
        struct cbq_class        *rx_class;
 #endif
        struct cbq_class        *tx_class;
        return NULL;
 }
 
-#ifdef CONFIG_NET_CLS_POLICE
+#if defined(CONFIG_NET_CLS_ACT) || defined(CONFIG_NET_CLS_POLICE)
 
 static struct cbq_class *
 cbq_reclassify(struct sk_buff *skb, struct cbq_class *this)
                /*
                 * Step 2+n. Apply classifier.
                 */
-               if (!head->filter_list || (result = tc_classify(skb, head->filter_list, &res)) < 0)
+               if (!head->filter_list ||
+                   (result = tc_classify_compat(skb, head->filter_list, &res)) < 0)
                        goto fallback;
 
                if ((cl = (void*)res.class) == NULL) {
                        *qerr = NET_XMIT_SUCCESS;
                case TC_ACT_SHOT:
                        return NULL;
+               case TC_ACT_RECLASSIFY:
+                       return cbq_reclassify(skb, cl);
                }
 #elif defined(CONFIG_NET_CLS_POLICE)
                switch (result) {
        int ret;
        struct cbq_class *cl = cbq_classify(skb, sch, &ret);
 
-#ifdef CONFIG_NET_CLS_POLICE
+#if defined(CONFIG_NET_CLS_ACT) || defined(CONFIG_NET_CLS_POLICE)
        q->rx_class = cl;
 #endif
        if (cl == NULL) {
                return ret;
        }
 
-#ifdef CONFIG_NET_CLS_POLICE
+#if defined(CONFIG_NET_CLS_ACT) || defined(CONFIG_NET_CLS_POLICE)
        cl->q->__parent = sch;
 #endif
        if ((ret = cl->q->enqueue(skb, cl->q)) == NET_XMIT_SUCCESS) {
 
        cbq_mark_toplevel(q, cl);
 
-#ifdef CONFIG_NET_CLS_POLICE
+#if defined(CONFIG_NET_CLS_ACT) || defined(CONFIG_NET_CLS_POLICE)
        q->rx_class = cl;
        cl->q->__parent = sch;
 #endif
 }
 
 
-#ifdef CONFIG_NET_CLS_POLICE
+#if defined(CONFIG_NET_CLS_ACT) || defined(CONFIG_NET_CLS_POLICE)
 
 static int cbq_reshape_fail(struct sk_buff *skb, struct Qdisc *child)
 {
        return 0;
 }
 
-#ifdef CONFIG_NET_CLS_POLICE
+#if defined(CONFIG_NET_CLS_ACT) || defined(CONFIG_NET_CLS_POLICE)
 static int cbq_set_police(struct cbq_class *cl, struct tc_cbq_police *p)
 {
        cl->police = p->police;
        return -1;
 }
 
-#ifdef CONFIG_NET_CLS_POLICE
+#if defined(CONFIG_NET_CLS_ACT) || defined(CONFIG_NET_CLS_POLICE)
 static __inline__ int cbq_dump_police(struct sk_buff *skb, struct cbq_class *cl)
 {
        unsigned char *b = skb_tail_pointer(skb);
            cbq_dump_rate(skb, cl) < 0 ||
            cbq_dump_wrr(skb, cl) < 0 ||
            cbq_dump_ovl(skb, cl) < 0 ||
-#ifdef CONFIG_NET_CLS_POLICE
+#if defined(CONFIG_NET_CLS_ACT) || defined(CONFIG_NET_CLS_POLICE)
            cbq_dump_police(skb, cl) < 0 ||
 #endif
            cbq_dump_fopt(skb, cl) < 0)
                                                     cl->classid)) == NULL)
                                return -ENOBUFS;
                } else {
-#ifdef CONFIG_NET_CLS_POLICE
+#if defined(CONFIG_NET_CLS_ACT) || defined(CONFIG_NET_CLS_POLICE)
                        if (cl->police == TC_POLICE_RECLASSIFY)
                                new->reshape_fail = cbq_reshape_fail;
 #endif
        struct cbq_class *cl;
        unsigned h;
 
-#ifdef CONFIG_NET_CLS_POLICE
+#if defined(CONFIG_NET_CLS_ACT) || defined(CONFIG_NET_CLS_POLICE)
        q->rx_class = NULL;
 #endif
        /*
        struct cbq_class *cl = (struct cbq_class*)arg;
 
        if (--cl->refcnt == 0) {
-#ifdef CONFIG_NET_CLS_POLICE
+#if defined(CONFIG_NET_CLS_ACT) || defined(CONFIG_NET_CLS_POLICE)
                struct cbq_sched_data *q = qdisc_priv(sch);
 
                spin_lock_bh(&sch->dev->queue_lock);
            RTA_PAYLOAD(tb[TCA_CBQ_WRROPT-1]) < sizeof(struct tc_cbq_wrropt))
                        return -EINVAL;
 
-#ifdef CONFIG_NET_CLS_POLICE
+#if defined(CONFIG_NET_CLS_ACT) || defined(CONFIG_NET_CLS_POLICE)
        if (tb[TCA_CBQ_POLICE-1] &&
            RTA_PAYLOAD(tb[TCA_CBQ_POLICE-1]) < sizeof(struct tc_cbq_police))
                        return -EINVAL;
                if (tb[TCA_CBQ_OVL_STRATEGY-1])
                        cbq_set_overlimit(cl, RTA_DATA(tb[TCA_CBQ_OVL_STRATEGY-1]));
 
-#ifdef CONFIG_NET_CLS_POLICE
+#if defined(CONFIG_NET_CLS_ACT) || defined(CONFIG_NET_CLS_POLICE)
                if (tb[TCA_CBQ_POLICE-1])
                        cbq_set_police(cl, RTA_DATA(tb[TCA_CBQ_POLICE-1]));
 #endif
        cl->overlimit = cbq_ovl_classic;
        if (tb[TCA_CBQ_OVL_STRATEGY-1])
                cbq_set_overlimit(cl, RTA_DATA(tb[TCA_CBQ_OVL_STRATEGY-1]));
-#ifdef CONFIG_NET_CLS_POLICE
+#if defined(CONFIG_NET_CLS_ACT) || defined(CONFIG_NET_CLS_POLICE)
        if (tb[TCA_CBQ_POLICE-1])
                cbq_set_police(cl, RTA_DATA(tb[TCA_CBQ_POLICE-1]));
 #endif
                q->tx_class = NULL;
                q->tx_borrowed = NULL;
        }
-#ifdef CONFIG_NET_CLS_POLICE
+#if defined(CONFIG_NET_CLS_ACT) || defined(CONFIG_NET_CLS_POLICE)
        if (q->rx_class == cl)
                q->rx_class = NULL;
 #endif