10 Feb, 2008
4 commits
-
Commit 954415e33ed6cfa932c13e8c2460bd05e50723b5 ("[PKT_SCHED] ematch:
tcf_em_destroy robustness") removed a cast on em->data when
passing it to kfree(), but em->data is an integer type that can
hold pointers as well as other values so the cast is necessary.Signed-off-by: David S. Miller
-
htb_requeue() enqueues skbs for which htb_classify() returns NULL.
This is wrong because such skbs could be handled by NET_CLS_ACT code,
and the decision could be different than earlier in htb_enqueue().
So htb_requeue() is changed to work and look more like htb_enqueue().Signed-off-by: Jarek Poplawski
Signed-off-by: David S. Miller -
Make the code in tcf_em_tree_destroy more robust and cleaner:
* Don't need to cast pointer to kfree() or avoid passing NULL.
* After freeing the tree, clear the pointer to avoid possible problems
from repeated free.Signed-off-by: Stephen Hemminger
Signed-off-by: David S. Miller -
A couple of functions in meta match don't need to be inline.
Signed-off-by: Stephen Hemminger
Signed-off-by: David S. Miller
09 Feb, 2008
1 commit
-
Setting up a meta match causes a kernel OOPS because of uninitialized
elements in tree.[ 37.322381] BUG: unable to handle kernel NULL pointer dereference at 0000000000000000
[ 37.322381] IP: [] :em_meta:em_meta_destroy+0x17/0x80[ 37.322381] Call Trace:
[ 37.322381] [] tcf_em_tree_destroy+0x2d/0xa0
[ 37.322381] [] tcf_em_tree_validate+0x2dc/0x4a0
[ 37.322381] [] nla_parse+0x92/0xe0
[ 37.322381] [] :cls_basic:basic_change+0x202/0x3c0
[ 37.322381] [] kmem_cache_alloc+0x67/0xa0
[ 37.322381] [] tc_ctl_tfilter+0x3b1/0x580
[ 37.322381] [] rtnetlink_rcv_msg+0x0/0x260
[ 37.322381] [] netlink_rcv_skb+0x74/0xa0
[ 37.322381] [] rtnetlink_rcv+0x18/0x20
[ 37.322381] [] netlink_unicast+0x263/0x290
[ 37.322381] [] __alloc_skb+0x96/0x160
[ 37.322381] [] netlink_sendmsg+0x274/0x340
[ 37.322381] [] sock_sendmsg+0x12b/0x140
[ 37.322381] [] autoremove_wake_function+0x0/0x30
[ 37.322381] [] autoremove_wake_function+0x0/0x30
[ 37.322381] [] sock_sendmsg+0x12b/0x140
[ 37.322381] [] zone_statistics+0xb1/0xc0
[ 37.322381] [] sys_sendmsg+0x20e/0x360
[ 37.322381] [] sockfd_lookup_light+0x41/0x80
[ 37.322381] [] handle_mm_fault+0x3eb/0x7f0
[ 37.322381] [] system_call_after_swapgs+0x7b/0x80Signed-off-by: Stephen Hemminger
Signed-off-by: David S. Miller
08 Feb, 2008
1 commit
-
If userspace passes a unknown match index into em_meta, then
em_meta_change will return an error and the data for the match will
not be set. This then causes an null pointer dereference when the
cleanup is done in the error path via tcf_em_tree_destroy. Since the
tree structure comes kzalloc, it is initialized to NULL.Discovered when testing a new version of tc command against an
accidental older kernel.Signed-off-by: Stephen Hemminger
Signed-off-by: David S. Miller
06 Feb, 2008
3 commits
-
Signed-off-by: Patrick McHardy
Signed-off-by: David S. Miller -
Since we're using fls(), we need to check whether the value is
non-zero first.Signed-off-by: Patrick McHardy
Signed-off-by: David S. Miller -
net/sched/em_meta.c: In function 'meta_int_vlan_tag':
net/sched/em_meta.c:179: warning: 'tag' may be used uninitialized in this functionSigned-off-by: Patrick McHardy
Signed-off-by: David S. Miller
05 Feb, 2008
2 commits
-
Provide a way to use tc filters on vlan tag even if tag is buried in
skb due to hardware acceleration.Signed-off-by: Stephen Hemminger
Signed-off-by: David S. Miller -
The 2.6 latest git build was broken when using the following
configuration options:
CONFIG_NET_EMATCH=n
CONFIG_NET_CLS_FLOW=ywith the following error:
net/sched/cls_flow.c: In function 'flow_dump':
net/sched/cls_flow.c:598: error: 'struct tcf_ematch_tree' has no
member named 'hdr'
make[2]: *** [net/sched/cls_flow.o] Error 1
make[1]: *** [net/sched] Error 2
make: *** [net] Error 2see the recent post by Li Zefan:
http://www.spinics.net/lists/netdev/msg54434.htmlThe reason for this crash is that struct tcf_ematch_tree
(net/pkt_cls.h) is empty when CONFIG_NET_EMATCH is not defined.When CONFIG_NET_EMATCH is defined, the tcf_ematch_tree structure
indeed holds a struct tcf_ematch_tree_hdr (hdr) as flow_dump()
expects.This patch adds #ifdef CONFIG_NET_EMATCH in flow_dump to avoid this.
Signed-off-by: Rami Rosen
Signed-off-by: David S. Miller
01 Feb, 2008
6 commits
-
Add new "flow" classifier, which is meant to extend the SFQ hashing
capabilities without hard-coding new hash functions and also allows
deterministic mappings of keys to classes, replacing some out of tree
iptables patches like IPCLASSIFY (maps IPs to classes), IPMARK (maps
IPs to marks, with fw filters to classes), ...Some examples:
- Classic SFQ hash:
tc filter add ... flow hash \
keys src,dst,proto,proto-src,proto-dst divisor 1024- Classic SFQ hash, but using information from conntrack to work properly in
combination with NAT:tc filter add ... flow hash \
keys nfct-src,nfct-dst,proto,nfct-proto-src,nfct-proto-dst divisor 1024- Map destination IPs of 192.168.0.0/24 to classids 1-257:
tc filter add ... flow map \
key dst addend -192.168.0.0 divisor 256- alternatively:
tc filter add ... flow map \
key dst and 0xff- similar, but reverse ordered:
tc filter add ... flow map \
key dst and 0xff xor 0xffPerturbation is currently not supported because we can't reliable kill the
timer on destruction.Signed-off-by: Patrick McHardy
Signed-off-by: David S. Miller -
Add support for dumping statistics and make internal queues visible as
classes.Signed-off-by: Patrick McHardy
Signed-off-by: David S. Miller -
Add support for external classifiers to allow using different flow
hash functions similar to ESFQ. When no classifier is attached the
built-in hash is used as before.Signed-off-by: Patrick McHardy
Signed-off-by: David S. Miller -
Signed-off-by: Patrick McHardy
Signed-off-by: David S. Miller -
Signed-off-by: Roel Kluin
Signed-off-by: David S. Miller -
Since the old policer code is gone, TC actions are needed for policing.
The ingress qdisc can get packets directly from netif_receive_skb()
in case TC actions are enabled or through netfilter otherwise, but
since without TC actions there is no policer the only thing it actually
does is count packets.Remove the netfilter support and always require TC actions.
Signed-off-by: Patrick McHardy
Acked-by: Jamal Hadi Salim
Signed-off-by: David S. Miller
29 Jan, 2008
23 commits
-
Signed-off-by: Patrick McHardy
Signed-off-by: David S. Miller -
Signed-off-by: Patrick McHardy
Signed-off-by: David S. Miller -
Signed-off-by: Patrick McHardy
Signed-off-by: David S. Miller -
Signed-off-by: Patrick McHardy
Signed-off-by: David S. Miller -
Signed-off-by: Patrick McHardy
Signed-off-by: David S. Miller -
Signed-off-by: Patrick McHardy
Signed-off-by: David S. Miller -
Signed-off-by: Patrick McHardy
Signed-off-by: David S. Miller -
Signed-off-by: Patrick McHardy
Signed-off-by: David S. Miller -
Use nla_nest_start/nla_nest_end for dumping nested attributes.
Signed-off-by: Patrick McHardy
Signed-off-by: David S. Miller -
nla_parse() returns more detailed errno codes, propagate them back on
error.Signed-off-by: Patrick McHardy
Signed-off-by: David S. Miller -
Signed-off-by: Patrick McHardy
Signed-off-by: David S. Miller -
Convert open-coded nlmsg_parse to use the real function.
Signed-off-by: Patrick McHardy
Signed-off-by: David S. Miller -
Fix two invalid attribute accesses, indices start at 1 with the new
netlink API.Signed-off-by: Patrick McHardy
Signed-off-by: David S. Miller -
Replace open coded equivalent of nla_parse_nested_compat().
Signed-off-by: Patrick McHardy
Signed-off-by: David S. Miller -
Fix format string warning introduces by the netlink API conversion:
net/sched/sch_atm.c:250: warning: format '%lu' expects type 'long unsigned int', but argument 3 has type 'int'.
Signed-off-by: Patrick McHardy
Signed-off-by: David S. Miller -
Signed-off-by: Patrick McHardy
Signed-off-by: David S. Miller -
Signed-off-by: Patrick McHardy
Signed-off-by: David S. Miller -
Convert packet schedulers to use the netlink API. Unfortunately a gradual
conversion is not possible without breaking compilation in the middle or
adding lots of casts, so this patch converts them all in one step. The
patch has been mostly generated automatically with some minor edits to
at least allow seperate conversion of classifiers and actions.Signed-off-by: Patrick McHardy
Signed-off-by: David S. Miller -
Additionally remove unnecessary NULL initilizations of the next pointer.
Signed-off-by: Patrick McHardy
Signed-off-by: David S. Miller -
Signed-off-by: Patrick McHardy
Signed-off-by: David S. Miller -
Classifier code cleanup. Get rid of printk wrapper, and fix whitespace
and other style stuff reported by checkpatchSigned-off-by: Stephen Hemminger
Signed-off-by: David S. Miller -
ATM scheduler clean house:
* get rid of printk and qdisc_priv() wrapper
* split some assignment in if() statements
* whitespace and line breaks.Signed-off-by: Stephen Hemminger
Signed-off-by: David S. Miller -
Get rid of all style things checkpatch warns about, indentation and
whitespace.Signed-off-by: Stephen Hemminger
Signed-off-by: David S. Miller