From: jamal <hadi@cyberus.ca>
To: Xiaofei Wu <xiaofei_wu08@yahoo.com>
Cc: linux netdev <netdev@vger.kernel.org>
Subject: Re: [iproute2] tc pedit modify ethhdr ?
Date: Wed, 24 Mar 2010 23:21:15 -0400 [thread overview]
Message-ID: <1269487275.10851.0.camel@bigi> (raw)
In-Reply-To: <326421.66567.qm@web111606.mail.gq1.yahoo.com>
I put some effort in responding to you. Please put some
effort in testing it.
cheers,
jamal
On Wed, 2010-03-24 at 19:59 -0700, Xiaofei Wu wrote:
>
>
> I made a test like your example.
> The terminal prints:
> parse_cmd argc 20 set offset -14 length 2
> pack_key16: Final val 90000000 mask 0000ffff
> parse_cmd done argc 18 munge offset -16 length 2
>
> what's the meaning of the above 3 lines; It modify the value of -16,-15,-14,-13 , or just modify -14,-13 ?
> If it modified -16,-15 , would it cause any problems?
>
> Thanks.
>
>
> --
> Wu
>
>
>
> ----- Original Message ----
> > but the size of ethhdr is 14 bytes, 14 is not multiple of 4 .
> > How to use 'tc ... pedit ...' modify a packet's h_dest and h_source
> > of ethhdr ?
> > Use ' ... pedit munge offset -14 u16 set 0x0090 munge offset -12 u32 set 0x9600030a ... ' or
> > use ' ... pedit munge offset -16 u32 ... munge offset -12 ... ' ?
> >
>
> 0 is at ip header.
> dst MAC starts at -14
> src MAC at -8
> ethertype at -2
>
> Example:
> tc filter add dev eth0 parent ffff: protocol ip prio 10 u32 \
> match ip src 192.168.1.10/32 flowid 1:2 \
> action pedit munge offset -14 u16 set 0x0000 \
> munge offset -12 u32 set 0x00010100 \
> munge offset -8 u32 set 0x0aaf0100 \
> munge offset -4 u32 set 0x0008ec06 pipe \
> action mirred egress redirect dev eth1
>
>
>
prev parent reply other threads:[~2010-03-25 3:21 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-03-24 12:31 [iproute2] tc pedit modify ethhdr ? Xiaofei Wu
2010-03-24 13:50 ` jamal
2010-03-25 2:59 ` Xiaofei Wu
2010-03-25 3:21 ` jamal [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=1269487275.10851.0.camel@bigi \
--to=hadi@cyberus.ca \
--cc=netdev@vger.kernel.org \
--cc=xiaofei_wu08@yahoo.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).