Netdev List
 help / color / mirror / Atom feed
From: Stephen Hemminger <shemminger@vyatta.com>
To: "Anton 'EvilMan' Danilov" <littlesmilingcloud@gmail.com>
Cc: netdev@vger.kernel.org
Subject: Re: [PATCH iproute] tc pedit action: fix parsing offset options.
Date: Tue, 10 Apr 2012 09:08:44 -0700	[thread overview]
Message-ID: <20120410090844.798023c3@nehalam.linuxnetplumber.net> (raw)
In-Reply-To: <CAEzD07+xdGxMh9-RHvF0RJZsCvj0Dj=VEY=0csPrSbTED4Hb6g@mail.gmail.com>

On Wed, 29 Feb 2012 19:34:28 +0300
"Anton 'EvilMan' Danilov" <littlesmilingcloud@gmail.com> wrote:

> This patch fix parsing offset option with "at" parameter.
> Tc returns error If keywords "offmask" and "shift" are presented.
> 
> Example of wrong parsing:
> 
> ~$ tc f add dev eth0 parent 1: protocol ip pref 10 \
> u32 match u32 0 0 \
> action pedit help
> Usage: ... pedit munge <MUNGE>
> Where: MUNGE := <RAW>|<LAYERED>
>         <RAW>:= <OFFSETC>[ATC]<CMD>
>                 OFFSETC:= offset <offval> <u8|u16|u32>
>                 ATC:= at <atval> offmask <maskval> shift <shiftval>
>                 NOTE: offval is byte offset, must be multiple of 4
>                 NOTE: maskval is a 32 bit hex number
>                 NOTE: shiftval is a is a shift value
>                 CMD:= clear | invert | set <setval>| retain
>         <LAYERED>:= ip <ipdata> | ip6 <ip6data>
>                 | udp <udpdata> | tcp <tcpdata> | icmp <icmpdata>
> For Example usage look at the examples directory
> 
> #try to add filter with pedit action using "at" option
> ~$ tc f add dev eth0 parent 1: pref 10 protocol all handle ::10 \
> u32 match ip protocol 6 0xff \
> match ip src 10.10.20.119/32 \
> match ip dst 10.10.20.254/32 \
> action pedit munge offset 2 u16 at 0 offmask 0f0000000 shift 22 set 11500
> Illegal pedit construct (2)
> ...
> bad action parsing
> parse_action: bad value (19:pedit)!
> Illegal "action"
> 
> ~$ tc f add dev eth0 parent 1: pref 10 protocol all handle ::10 \
> u32 match ip protocol 6 0xff \
> match ip src 10.10.20.119/32 \
> match ip dst 10.10.20.254/32 \
> action pedit munge offset 2 u16 at 0 0f0000000 22 set 11500
> parse_cmd argc 8 set offset 2 length 2
> pack_key16: Final val ec2c0000 mask 0000ffff
> parse_cmd done argc 6 pipe offset 0 length 2
> 

Won't this break existing scripts because you changed the offset mask
from being a value to requiring a "offmask"?

      reply	other threads:[~2012-04-10 16:08 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-29 16:34 [PATCH iproute] tc pedit action: fix parsing offset options Anton 'EvilMan' Danilov
2012-04-10 16:08 ` Stephen Hemminger [this message]

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=20120410090844.798023c3@nehalam.linuxnetplumber.net \
    --to=shemminger@vyatta.com \
    --cc=littlesmilingcloud@gmail.com \
    --cc=netdev@vger.kernel.org \
    /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