Commit 9f9dea7d authored by Thomas Graf's avatar Thomas Graf Committed by David S. Miller

[PKT_SCHED]: cls_fw: CONFIG_NET_CLS_IND is not dependant on CONFIG_NET_CLS_ACT

Signed-off-by: default avatarThomas Graf <tgraf@suug.ch>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent f01bf5a4
......@@ -56,11 +56,11 @@ struct fw_filter
struct fw_filter *next;
u32 id;
struct tcf_result res;
#ifdef CONFIG_NET_CLS_ACT
struct tc_action *action;
#ifdef CONFIG_NET_CLS_IND
char indev[IFNAMSIZ];
#endif /* CONFIG_NET_CLS_IND */
#ifdef CONFIG_NET_CLS_ACT
struct tc_action *action;
#else /* CONFIG_NET_CLS_ACT */
#ifdef CONFIG_NET_CLS_POLICE
struct tcf_police *police;
......@@ -88,11 +88,11 @@ static int fw_classify(struct sk_buff *skb, struct tcf_proto *tp,
for (f=head->ht[fw_hash(id)]; f; f=f->next) {
if (f->id == id) {
*res = f->res;
#ifdef CONFIG_NET_CLS_ACT
#ifdef CONFIG_NET_CLS_IND
if (!tcf_match_indev(skb, f->indev))
continue;
#endif /* CONFIG_NET_CLS_IND */
#ifdef CONFIG_NET_CLS_ACT
if (f->action) {
int act_res = tcf_action_exec(skb, f->action, res);
if (act_res >= 0)
......@@ -217,6 +217,14 @@ fw_change_attrs(struct tcf_proto *tp, struct fw_filter *f,
tcf_bind_filter(tp, &f->res, base);
}
#ifdef CONFIG_NET_CLS_IND
if (tb[TCA_FW_INDEV-1]) {
err = tcf_change_indev(tp, f->indev, tb[TCA_FW_INDEV-1]);
if (err < 0)
goto errout;
}
#endif /* CONFIG_NET_CLS_IND */
#ifdef CONFIG_NET_CLS_ACT
if (tb[TCA_FW_POLICE-1]) {
err = tcf_change_act_police(tp, &f->action, tb[TCA_FW_POLICE-1],
......@@ -231,14 +239,6 @@ fw_change_attrs(struct tcf_proto *tp, struct fw_filter *f,
if (err < 0)
goto errout;
}
#ifdef CONFIG_NET_CLS_IND
if (tb[TCA_FW_INDEV-1]) {
err = tcf_change_indev(tp, f->indev, tb[TCA_FW_INDEV-1]);
if (err < 0)
goto errout;
}
#endif /* CONFIG_NET_CLS_IND */
#else /* CONFIG_NET_CLS_ACT */
#ifdef CONFIG_NET_CLS_POLICE
if (tb[TCA_FW_POLICE-1]) {
......@@ -373,13 +373,13 @@ static int fw_dump(struct tcf_proto *tp, unsigned long fh,
if (f->res.classid)
RTA_PUT(skb, TCA_FW_CLASSID, 4, &f->res.classid);
#ifdef CONFIG_NET_CLS_ACT
if (tcf_dump_act(skb, f->action, TCA_FW_ACT, TCA_FW_POLICE) < 0)
goto rtattr_failure;
#ifdef CONFIG_NET_CLS_IND
if (strlen(f->indev))
RTA_PUT(skb, TCA_FW_INDEV, IFNAMSIZ, f->indev);
#endif /* CONFIG_NET_CLS_IND */
#ifdef CONFIG_NET_CLS_ACT
if (tcf_dump_act(skb, f->action, TCA_FW_ACT, TCA_FW_POLICE) < 0)
goto rtattr_failure;
#else /* CONFIG_NET_CLS_ACT */
#ifdef CONFIG_NET_CLS_POLICE
if (tcf_dump_police(skb, f->police, TCA_FW_POLICE) < 0)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment