2008-02-03 08:51:54

by Rami Rosen

[permalink] [raw]
Subject: [PATCH] [NET_SCHED] Add #ifdef CONFIG_NET_EMATCH in net/sched/cls_flow.c (latest git broken build)

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 <[email protected]>


Attachments:
(No filename) (931.00 B)
patch.txt (559.00 B)
Download all attachments

2008-02-03 09:06:19

by Li Zefan

[permalink] [raw]
Subject: Re: [PATCH] [NET_SCHED] Add #ifdef CONFIG_NET_EMATCH in net/sched/cls_flow.c (latest git broken build)

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. :)

2008-02-05 10:56:58

by David Miller

[permalink] [raw]
Subject: Re: [PATCH] [NET_SCHED] Add #ifdef CONFIG_NET_EMATCH in net/sched/cls_flow.c (latest git broken build)

From: "Rami Rosen" <[email protected]>
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 <[email protected]>

Applied, thanks.