fedora core 6 1.2949 + vserver 2.2.0
[linux-2.6.git] / net / sched / cls_api.c
index fe85d55..edb8fc9 100644 (file)
@@ -17,7 +17,6 @@
 #include <asm/uaccess.h>
 #include <asm/system.h>
 #include <linux/bitops.h>
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/types.h>
 #include <linux/kernel.h>
@@ -218,7 +217,7 @@ replay:
                /* Create new proto tcf */
 
                err = -ENOBUFS;
-               if ((tp = kmalloc(sizeof(*tp), GFP_KERNEL)) == NULL)
+               if ((tp = kzalloc(sizeof(*tp), GFP_KERNEL)) == NULL)
                        goto errout;
                err = -EINVAL;
                tp_ops = tcf_proto_lookup_ops(tca[TCA_KIND-1]);
@@ -248,7 +247,6 @@ replay:
                        kfree(tp);
                        goto errout;
                }
-               memset(tp, 0, sizeof(*tp));
                tp->ops = tp_ops;
                tp->protocol = protocol;
                tp->prio = nprio ? : tcf_auto_prio(*back);
@@ -322,16 +320,17 @@ errout:
 
 static int
 tcf_fill_node(struct sk_buff *skb, struct tcf_proto *tp, unsigned long fh,
-             u32 pid, u32 seq, unsigned flags, int event)
+             u32 pid, u32 seq, u16 flags, int event)
 {
        struct tcmsg *tcm;
        struct nlmsghdr  *nlh;
        unsigned char    *b = skb->tail;
 
-       nlh = NLMSG_PUT(skb, pid, seq, event, sizeof(*tcm));
-       nlh->nlmsg_flags = flags;
+       nlh = NLMSG_NEW(skb, pid, seq, event, sizeof(*tcm), flags);
        tcm = NLMSG_DATA(nlh);
        tcm->tcm_family = AF_UNSPEC;
+       tcm->tcm__pad1 = 0;
+       tcm->tcm__pad1 = 0;
        tcm->tcm_ifindex = tp->q->dev->ifindex;
        tcm->tcm_parent = tp->classid;
        tcm->tcm_info = TC_H_MAKE(tp->prio, tp->protocol);
@@ -366,7 +365,7 @@ static int tfilter_notify(struct sk_buff *oskb, struct nlmsghdr *n,
                return -EINVAL;
        }
 
-       return rtnetlink_send(skb, pid, RTMGRP_TC, n->nlmsg_flags&NLM_F_ECHO);
+       return rtnetlink_send(skb, pid, RTNLGRP_TC, n->nlmsg_flags&NLM_F_ECHO);
 }
 
 struct tcf_dump_args
@@ -401,7 +400,7 @@ static int tc_dump_tfilter(struct sk_buff *skb, struct netlink_callback *cb)
        if ((dev = dev_get_by_index(tcm->tcm_ifindex)) == NULL)
                return skb->len;
 
-       read_lock_bh(&qdisc_tree_lock);
+       read_lock(&qdisc_tree_lock);
        if (!tcm->tcm_parent)
                q = dev->qdisc_sleeping;
        else
@@ -458,7 +457,7 @@ errout:
        if (cl)
                cops->put(q, cl);
 out:
-       read_unlock_bh(&qdisc_tree_lock);
+       read_unlock(&qdisc_tree_lock);
        dev_put(dev);
        return skb->len;
 }
@@ -602,7 +601,7 @@ tcf_exts_dump_stats(struct sk_buff *skb, struct tcf_exts *exts,
 {
 #ifdef CONFIG_NET_CLS_ACT
        if (exts->action)
-               if (tcf_action_copy_stats(skb, exts->action) < 0)
+               if (tcf_action_copy_stats(skb, exts->action, 1) < 0)
                        goto rtattr_failure;
 #elif defined CONFIG_NET_CLS_POLICE
        if (exts->police)