Package: iproute
Version: 20110107-2
Severity: normal

If you request pretty-printed filters with tc -p, it will print "sport" for a
match on the /destination/ port, and "dport" for a match on the /source/ port.

To reproduce:

1) Create a classful qdisc supporting filters, so the next command gets accepted
by the kernel (the default pfifo_fast is classless and rejects filters)

# tc qdisc add dev eth0 root handle 1: htb 

2) Create a filter for TCP dport 1234 (TCP starts at byte 20, first 32 bits is
sport/dport)

# tc filter add dev eth0 protocol ip parent 1: u32 match u32 0x000004d2 \
  0x0000ffff at 20 flowid 1:1

3) List the filters

# tc -p filter ls dev eth0

Expected result:
Output as:
...
  match dport 1234

Actual result:
...
  match sport 1234


The exact reverse happens when we do an actual match on the TCP sport:

Step 1) as before

2)
# tc filter add dev eth0 protocol ip parent 1: u32 match u32 0x04d20000 \
  0xffff0000 at 20 flowid 1:1

Step 3) as before

Instead of the actual "sport 1234", the output now says "dport 1234".

By the way, you could see the numeric matchers are actually correct by
generating some matching traffic and checking the filters with

# tc -p -s -d filter ls dev eth0

If you telnet /to/ a port 1234 over eth0, for example, you'll see the success
counter increasing for "sport 1234".


-- System Information:
Debian Release: wheezy/sid
  APT prefers testing
  APT policy: (900, 'testing'), (100, 'unstable'), (100, 'stable')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.38-2-amd64 (SMP w/2 CPU cores)
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages iproute depends on:
ii  libc6                         2.11.2-11  Embedded GNU C Library: Shared lib
ii  libdb4.8                      4.8.30-4   Berkeley v4.8 Database Libraries [

Versions of packages iproute recommends:
ii  libatm1                      1:2.5.1-1.2 shared library for ATM (Asynchrono

Versions of packages iproute suggests:
ii  iproute-doc                   20110107-2 networking and traffic control too

-- no debconf information



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to