From: =?windows-1252?Q?Christian_R=F6=DFner?= Date: Thu, 10 Apr 2014 08:57:16 +0000 Subject: tc nexthdr Message-Id: <8B7BC216-6397-41E8-B39C-66178AD6C805@sys4.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: quoted-printable To: lartc@vger.kernel.org Hi, this is my first post to this list. I try to match several RTPv2 codecs with tc u32 and I ended up with the fol= lowing: tc filter add dev mydevice protocol ip parent 1:0 pref 3 u32 \ match ip protocol 0x11 0xFF \ match u16 0x8008 0xC07F at 28 \ flowid 1:110 So far this works. It means (at least I hope so): - match UDP, - match the first two bytes in the UDP payload, which are part of the RTP h= eader - first two bits say =84version 2=93 RTP - last 7 bits encode the codec. In this example G.711 PCMA So now this code is just working for IPv4. And I would like to have a more = generic one using nexthdr. So I tried: tc filter add dev mydevice protocol ip parent 1:0 pref 3 u32 \ match ip protocol 0x11 0xFF \ match u16 0x8008 0xC07F at nexthdr+4 \ flowid 1:110 Problem with this is that it matches packets, but when doing a test call wi= th VoIP I can see that it does not match RTP traffic but some wrong traffic= . So I guess my =84nexthdr+4=93 is wrong. I thought that the nexthdr depend= s on the selector u16 and therefor needs to be 4. 4*16d, which should be 8 = bytes offset to UDP, which is the beginning of the payload, isn=92t it? Can someone help me fixing this rule? Thanks in advance Kind regards -Christian R=F6=DFner -- [*] sys4 AG http://sys4.de, +49 (89) 30 90 46 64 Franziskanerstra=DFe 15, 81669 M=FCnchen Sitz der Gesellschaft: M=FCnchen, Amtsgericht M=FCnchen: HRB 199263 Vorstand: Patrick Ben Koetter, Marc Schiffbauer Aufsichtsratsvorsitzender: Florian Kirstein