netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Denys Fedoryschenko <denys@visp.net.lb>
To: netdev@vger.kernel.org
Cc: Stephen Hemminger <shemminger@vyatta.com>
Subject: iproute2, meta, flex parser bug?
Date: Thu, 29 Jan 2009 13:04:24 +0200	[thread overview]
Message-ID: <200901291304.24257.denys@visp.net.lb> (raw)

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 looks correct, but maybe i miss something.
My software versions
bison (GNU Bison) 2.3
flex 2.5.35
gcc version 4.3.2 (Gentoo 4.3.2 p1.2)
iproute2 is latest git

             reply	other threads:[~2009-01-29 11:04 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-29 11:04 Denys Fedoryschenko [this message]
2009-01-30 13:20 ` iproute2, meta, flex parser bug? Thomas Graf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200901291304.24257.denys@visp.net.lb \
    --to=denys@visp.net.lb \
    --cc=netdev@vger.kernel.org \
    --cc=shemminger@vyatta.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).