Commit Graph

15 Commits

Author SHA1 Message Date
Stephen Hemminger
913352fe54 drop unneeded include of syslog.h
Only arpd uses syslog

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
2017-11-12 16:22:36 -08:00
Phil Sutter
247ace6115 tc: ematch: Ignore all-zero mask value when printing filters
The optional mask which may be added to int values is considered by the
kernel only if it is non-zero, therefore tc should only then also print
it.

Without this, not passing a mask value like so:

| # tc filter add dev d0 parent 8001: \
| 	basic match meta\(vlan eq 1\) \
| 	classid 8001:1

Would lead to tc printing an all-zero mask later:

| # tc filter show dev d0
| filter parent 8001: protocol all pref 49151 basic
| filter parent 8001: protocol all pref 49151 basic handle 0x1 flowid 8001:1
|   meta(vlan mask 0x00000000 eq 1)

This is obviously confusing as an all-zero mask strictly means to
eliminate all bits from the value, but the opposite is the case.

Cc: Thomas Graf <tgraf@suug.ch>
Signed-off-by: Phil Sutter <phil@nwl.cc>
2016-07-20 12:20:13 -07:00
Phil Sutter
d17b136f7d Use C99 style initializers everywhere
This big patch was compiled by vimgrepping for memset calls and changing
to C99 initializer if applicable. One notable exception is the
initialization of union bpf_attr in tc/tc_bpf.c: changing it would break
for older gcc versions (at least <=3.4.6).

Calls to memset for struct rtattr pointer fields for parse_rtattr*()
were just dropped since they are not needed.

The changes here allowed the compiler to discover some unused variables,
so get rid of them, too.

Signed-off-by: Phil Sutter <phil@nwl.cc>
Acked-by: David Ahern <dsa@cumulusnetworks.com>
2016-07-20 12:05:24 -07:00
Stephen Hemminger
32a121cba2 tc: code cleanup
Use checkpatch to fix whitespace and other style issues.
2016-03-21 11:48:36 -07:00
Andy Furniss
a07c6d6135 add missing underscore to man page and example nf_mark ematch
The man page and the "fail" example are missing an underscore in the
nf_mark ematch.

eg.

tc filter add dev eth0 parent ffff:  basic match 'meta(nfmark gt 24)'
classid 2:4

meta: unknown meta id

... >>meta(nfmark gt 24)<< ...
... meta(>>nfmark<< gt 24)...
Usage: meta(OBJECT { eq | lt | gt } OBJECT)
where: OBJECT  := { META_ID | VALUE }
        META_ID := id [ shift SHIFT ] [ mask MASK ]

Example: meta(nfmark gt 24)
          meta(indev shift 1 eq "ppp")
          meta(tcindex mask 0xf0 eq 0xf0)

For a list of meta identifiers, use meta(list).
Illegal "ematch"

meta(list) does correctly show nf_mark and the above test works with
nf_mark.

Signed-off-by: Andy Furniss adf.lists@gmail.com
2014-10-09 08:24:00 -07:00
Stephen Hemminger
ff24746cca Convert to use rta_getattr_ functions
User new functions (inspired by libmnl) to do type safe access
of routeing attributes
2012-04-10 08:47:55 -07:00
Mike Frysinger
05b4f8492b tc: remove dlfcn.h from files that dont need it
A bunch of source files look like they're copy & pasted from other files,
and some include header files that they don't actually need.  Since dlfcn
has very specific usage (and is a pain on a static-only system), drop it
where it isn't really needed.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-11-13 14:14:07 -08:00
Denys Fedoryshchenko
11bbe7fd11 long/ulong iproute-git fix
This patch fixes bug in Metadata ematch attributes parser

strtoul on error return ULONG_MAX, not LONG_MAX

Patch attached as file
2008-07-31 15:25:15 -07:00
Stephen Hemminger
ba26a6e853 fix typos in help message for meta match
Make sure examples actually work.
2008-02-05 12:07:07 -08:00
Stephen Hemminger
5e76a87d4c Change where vlan option shows up in help
Vlan should not be in the socket section
2008-02-05 11:33:44 -08:00
Stephen Hemminger
9becb950e9 vlan meta tag match
Signed-off-by: Stephen Hemminger <stephen.hemminger@vyatta.com>
2008-01-24 13:16:41 -08:00
Patrick McHardy
6140785236 Fix meta ematch usage of 0 values
em_meta doesn't send 0 values to the kernel. breaking matching on them and
resulting in "Missing value TLV" messages on dump.

Signed-off-by: Patrick McHardy <kaber@trash.net>
2007-08-22 10:52:13 -07:00
Stephen Hemminger
ae665a522b Remove trailing whitespace
Go through source files and remove all trailing whitespace

Signed-off-by: Stephen Hemminger <shemminger@osdl.org>
2006-12-05 10:10:22 -08:00
shemminger
6864c1e789 Update to latest kernel headers.
Fix out of range on paretonormal
2005-08-08 20:24:41 +00:00
shemminger
311b41454d Add new extended match files. 2005-06-23 20:25:16 +00:00