From 6b1b4fdf3f5146c95c1f047fbbf7d0af9273d1f9 Mon Sep 17 00:00:00 2001 From: Rostislav Lisovy Date: Mon, 8 Aug 2011 14:10:44 +0200 Subject: [PATCH] Is able of classifying acording to single CAN ID passed from userspace. --- net/sched/cls_canprio.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/net/sched/cls_canprio.c b/net/sched/cls_canprio.c index 9c3b9943a39..a4e2aa63be4 100644 --- a/net/sched/cls_canprio.c +++ b/net/sched/cls_canprio.c @@ -85,7 +85,9 @@ static int canprio_classify(struct sk_buff *skb, struct tcf_proto *tp, printk(" canprio_classify invoked\n"); list_for_each_entry(f, &head->flist, link) { - if (canprio_get_id(skb) == 123) { // Should match value given by user + printk(" canprio_classify can ID = 0x%x\n", canprio_get_id(skb)); + if (canprio_get_id(skb) == f->match) { + printk( " canprio_classify match ID 0x%x\n", f->match); *res = f->res; return TC_POLICE_OK; } @@ -215,7 +217,7 @@ static int canprio_change(struct tcf_proto *tp, unsigned long base, u32 handle, //f->match = nla_data(tb[TCA_CANPRIO_MATCH]); f->match = nla_get_u32(tb[TCA_CANPRIO_MATCH]); - printk(" match = %d\n", f->match); + printk(" can ID to match = 0x%x\n", f->match); //Add newly created filter to list of all filters tcf_tree_lock(tp); -- 2.39.2