* [PATCH] [NET_SCHED] Add #ifdef CONFIG_NET_EMATCH in net/sched/cls_flow.c (latest git broken build)
@ 2008-02-03 8:51 Rami Rosen
2008-02-03 9:04 ` Li Zefan
2008-02-05 10:57 ` David Miller
0 siblings, 2 replies; 3+ messages in thread
From: Rami Rosen @ 2008-02-03 8:51 UTC (permalink / raw)
To: David Miller, kaber, lizf, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 931 bytes --]
Hi,
The 2.6 latest git build was broken when using the following
configuration options:
CONFIG_NET_EMATCH=n
CONFIG_NET_CLS_FLOW=y
with the following error:
net/sched/cls_flow.c: In function 'flow_dump':
net/sched/cls_flow.c:598: error: 'struct tcf_ematch_tree' has no
member named 'hdr'
make[2]: *** [net/sched/cls_flow.o] Error 1
make[1]: *** [net/sched] Error 2
make: *** [net] Error 2
see the recent post by Li Zefan:
http://www.spinics.net/lists/netdev/msg54434.html
The reason for this crash is that struct tcf_ematch_tree (net/pkt_cls.h) is
empty when CONFIG_NET_EMATCH is not defined.
When CONFIG_NET_EMATCH is defined, the tcf_ematch_tree structure indeed holds
a struct tcf_ematch_tree_hdr (hdr) as flow_dump() expects.
This patch adds #ifdef CONFIG_NET_EMATCH in flow_dump to avoid this.
The patch was build against latest 2.6 git net tree.
Regards,
Rami Rosen
Signed-off-by: Rami Rosen <ramirose@gmail.com>
[-- Attachment #2: patch.txt --]
[-- Type: text/plain, Size: 559 bytes --]
diff --git a/net/sched/cls_flow.c b/net/sched/cls_flow.c
index 5a7f6a3..8d76986 100644
--- a/net/sched/cls_flow.c
+++ b/net/sched/cls_flow.c
@@ -594,11 +594,11 @@ static int flow_dump(struct tcf_proto *tp, unsigned long fh,
if (tcf_exts_dump(skb, &f->exts, &flow_ext_map) < 0)
goto nla_put_failure;
-
+#ifdef CONFIG_NET_EMATCH
if (f->ematches.hdr.nmatches &&
tcf_em_tree_dump(skb, &f->ematches, TCA_FLOW_EMATCHES) < 0)
goto nla_put_failure;
-
+#endif
nla_nest_end(skb, nest);
if (tcf_exts_dump_stats(skb, &f->exts, &flow_ext_map) < 0)
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] [NET_SCHED] Add #ifdef CONFIG_NET_EMATCH in net/sched/cls_flow.c (latest git broken build)
2008-02-03 8:51 [PATCH] [NET_SCHED] Add #ifdef CONFIG_NET_EMATCH in net/sched/cls_flow.c (latest git broken build) Rami Rosen
@ 2008-02-03 9:04 ` Li Zefan
2008-02-05 10:57 ` David Miller
1 sibling, 0 replies; 3+ messages in thread
From: Li Zefan @ 2008-02-03 9:04 UTC (permalink / raw)
To: Rami Rosen; +Cc: David Miller, kaber, linux-kernel
Rami Rosen wrote:
> Hi,
> The 2.6 latest git build was broken when using the following
> configuration options:
> CONFIG_NET_EMATCH=n
> CONFIG_NET_CLS_FLOW=y
>
> with the following error:
> net/sched/cls_flow.c: In function 'flow_dump':
> net/sched/cls_flow.c:598: error: 'struct tcf_ematch_tree' has no
> member named 'hdr'
> make[2]: *** [net/sched/cls_flow.o] Error 1
> make[1]: *** [net/sched] Error 2
> make: *** [net] Error 2
>
>
> see the recent post by Li Zefan:
> http://www.spinics.net/lists/netdev/msg54434.html
>
> The reason for this crash is that struct tcf_ematch_tree (net/pkt_cls.h) is
> empty when CONFIG_NET_EMATCH is not defined.
>
> When CONFIG_NET_EMATCH is defined, the tcf_ematch_tree structure indeed holds
> a struct tcf_ematch_tree_hdr (hdr) as flow_dump() expects.
>
> This patch adds #ifdef CONFIG_NET_EMATCH in flow_dump to avoid this.
>
> The patch was build against latest 2.6 git net tree.
>
The patch works. :)
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] [NET_SCHED] Add #ifdef CONFIG_NET_EMATCH in net/sched/cls_flow.c (latest git broken build)
2008-02-03 8:51 [PATCH] [NET_SCHED] Add #ifdef CONFIG_NET_EMATCH in net/sched/cls_flow.c (latest git broken build) Rami Rosen
2008-02-03 9:04 ` Li Zefan
@ 2008-02-05 10:57 ` David Miller
1 sibling, 0 replies; 3+ messages in thread
From: David Miller @ 2008-02-05 10:57 UTC (permalink / raw)
To: ramirose; +Cc: kaber, lizf, linux-kernel, netdev
From: "Rami Rosen" <ramirose@gmail.com>
Date: Sun, 3 Feb 2008 10:51:42 +0200
> The 2.6 latest git build was broken when using the following
> configuration options:
> CONFIG_NET_EMATCH=n
> CONFIG_NET_CLS_FLOW=y
>
> with the following error:
> net/sched/cls_flow.c: In function 'flow_dump':
> net/sched/cls_flow.c:598: error: 'struct tcf_ematch_tree' has no
> member named 'hdr'
> make[2]: *** [net/sched/cls_flow.o] Error 1
> make[1]: *** [net/sched] Error 2
> make: *** [net] Error 2
>
>
> see the recent post by Li Zefan:
> http://www.spinics.net/lists/netdev/msg54434.html
>
> The reason for this crash is that struct tcf_ematch_tree (net/pkt_cls.h) is
> empty when CONFIG_NET_EMATCH is not defined.
>
> When CONFIG_NET_EMATCH is defined, the tcf_ematch_tree structure indeed holds
> a struct tcf_ematch_tree_hdr (hdr) as flow_dump() expects.
>
> This patch adds #ifdef CONFIG_NET_EMATCH in flow_dump to avoid this.
>
> Signed-off-by: Rami Rosen <ramirose@gmail.com>
Applied, thanks.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2008-02-05 10:56 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-02-03 8:51 [PATCH] [NET_SCHED] Add #ifdef CONFIG_NET_EMATCH in net/sched/cls_flow.c (latest git broken build) Rami Rosen
2008-02-03 9:04 ` Li Zefan
2008-02-05 10:57 ` David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox