From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jurijs Dorofejevs Date: Tue, 27 May 2003 09:49:05 +0000 Subject: [LARTC] U32 port masks Message-Id: List-Id: References: In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: lartc@vger.kernel.org Hi! Can anybody explain me how does the mask work in filters? This example set filter for exactly port #2000 : tc filter add dev eth1 parent 1:0 protocol ip prio 100 u32 match ip sport 2000 0xffff classid 1:256 But if I need to set filter for the range of ports, for example, ports from 2000 till 3000, what mask do I need? Trying google, I've read that Mask = 0xffff - (high_port - low_port), that in my case will be: Mask = 0xffff - (3000 - 2000) = 0xfc17 tc filter add dev eth1 parent 1:0 protocol ip prio 100 u32 match ip sport 2000 0xfc17 classid 1:256 But this example doesn't work correctly and I suppose that I'm wrong with mask defying algorithm. Any ideas? Hope for your help! _______________________________________________ LARTC mailing list / LARTC@mailman.ds9a.nl http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/