lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Wed, 24 Mar 2010 19:59:12 -0700 (PDT)
From:	Xiaofei Wu <xiaofei_wu08@...oo.com>
To:	hadi@...erus.ca
Cc:	linux netdev <netdev@...r.kernel.org>
Subject: Re: [iproute2]  tc pedit   modify  ethhdr ?




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


      
Download attachment "test.png" of type "application/octet-stream" (61263 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ