Re: iproute2, meta, flex parser bug?

Previous thread: problem with r8101 driver by ivaylo on Thursday, January 29, 2009 - 3:30 am. (1 message)

Next thread: How-to use Miltiqueue Rx on SMP ? by Vladimir Kukushkin on Thursday, January 29, 2009 - 5:15 am. (2 messages)
From: Denys Fedoryschenko
Date: Thursday, January 29, 2009 - 4:04 am

I'm trying to make meta work, without success. Seems parser done in flex 
failing. My knowledge is not enough to fix or understand how flex is working
Here is what i got:

home iproute2 # home iproute2 # tc/tc filter add dev eth0 protocol ip pref 11 
basic match meta\(rt_iif eq \"eth0\"\)
meta: unknown meta id

... meta(rt_iif >>eq<< ...
... meta(rt_iif eq >>"eth0"<<)...
Usage: meta(OBJECT { eq | lt | gt } OBJECT)
where: OBJECT  := { META_ID | VALUE }
       META_ID := id [ shift SHIFT ] [ mask MASK ]

Example: meta(nfmark gt 24)
         meta(indev shift 1 eq "ppp")
         meta(tcindex mask 0xf0 eq 0xf0)

For a list of meta identifiers, use meta(list).
Illegal "ematch"

I try with debug, and how flex is working - strange for me
--(end of buffer or a NUL)
--accepting rule at line 139 ("meta")
--accepting rule at line 135 ("(")
--accepting rule at line 139 ("rt_iif")
--(end of buffer or a NUL)
--accepting rule at line 70 (" ")
--accepting rule at line 139 ("eq")
--(end of buffer or a NUL)
--accepting rule at line 70 (" ")
--accepting rule at line 139 (""eth0"")
--accepting rule at line 136 (")")
--(end of buffer or a NUL)
--accepting rule at line 70 (" ")
--(end of buffer or a NUL)
--EOF (start condition 0)

Even with numbers
tc/tc filter add dev eth0 protocol ip pref 11 basic match meta\(rt_iif eq 
123\)
--(end of buffer or a NUL)
--accepting rule at line 139 ("meta")
--accepting rule at line 135 ("(")
--accepting rule at line 139 ("rt_iif")
--(end of buffer or a NUL)
--accepting rule at line 70 (" ")
--accepting rule at line 139 ("eq")
--(end of buffer or a NUL)
--accepting rule at line 70 (" ")
--accepting rule at line 139 ("123")
--accepting rule at line 136 (")")
--(end of buffer or a NUL)
--accepting rule at line 70 (" ")
--(end of buffer or a NUL)
--EOF (start condition 0)

It seems it is not matching any rules except 

70 [ \t\r\n]+
136 ")"                                   
139 [^ \t\r\n()]+                        

In flex rules all ...
From: Thomas Graf
Date: Friday, January 30, 2009 - 6:20 am

Try: tc filter ... basic match 'meta(rt_iif eq <NUM>)' classid XX:YY
--

Previous thread: problem with r8101 driver by ivaylo on Thursday, January 29, 2009 - 3:30 am. (1 message)

Next thread: How-to use Miltiqueue Rx on SMP ? by Vladimir Kukushkin on Thursday, January 29, 2009 - 5:15 am. (2 messages)