From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?UTF-8?Q?Nie=C5=9Bcierowicz_Adam?= Subject: tc filter u32 match Date: Tue, 22 May 2012 15:45:16 +0200 Message-ID: Reply-To: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit To: Return-path: Received: from host-91.230.163.37.ltv.pl ([91.230.163.37]:46469 "EHLO mail.justnet.pl" rhost-flags-OK-FAIL-OK-OK) by vger.kernel.org with ESMTP id S1758257Ab2EVO2b (ORCPT ); Tue, 22 May 2012 10:28:31 -0400 Received: from [91.230.163.37] (helo=mail.justnet.pl) by service with esmtpa (Exim 4.72) (envelope-from ) id 1SWpOm-0005o4-5U for netdev@vger.kernel.org; Tue, 22 May 2012 15:45:16 +0200 Sender: netdev-owner@vger.kernel.org List-ID: Hello, I'm in the process of building a new shaper, when adding support for 802.1q vlan noticed that u32 can catch network traffic without giving 4 bytes offset. How is this possible? My environment: eth2 - network card eth2.200 - vlan /sbin/tc filter add dev eth2 parent 1:0 prio 5 handle 35: protocol ip u32 divisor 256 /sbin/tc filter add dev eth2 protocol ip parent 1:0 prio 5 u32 ht 800:: match ip dst 31.41.208.32/27 hashkey mask 0x000000ff at 16 link 35: /sbin/tc filter add dev eth2 protocol ip parent 1: prio 1 u32 ht 35:24: match ip dst 31.41.208.36 flowid 1:2e5 Here you can see the hits in the rule filter parent 1: protocol ip pref 5 u32 fh 35:24:800 order 2048 key ht 35 bkt 24 flowid 1:2e5 (rule hit 44037 success 44037) match 1f29d024/ffffffff at 16 (success 44037 ) I found a similar question here http://serverfault.com/questions/370795/tc-u32-how-to-match-l2-protocols-in-recent-kernels Thanks