fedora core 6 1.2949 + vserver 2.2.0
[linux-2.6.git] / net / sched / em_meta.c
index 700844d..45d47d3 100644 (file)
@@ -58,7 +58,6 @@
  *           only available if that subsytem is enabled in the kernel.
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/types.h>
 #include <linux/kernel.h>
@@ -209,13 +208,9 @@ META_COLLECTOR(int_maclen)
  * Netfilter
  **************************************************************************/
 
-META_COLLECTOR(int_nfmark)
+META_COLLECTOR(int_mark)
 {
-#ifdef CONFIG_NETFILTER
-       dst->value = skb->nfmark;
-#else
-       dst->value = 0;
-#endif
+       dst->value = skb->mark;
 }
 
 /**************************************************************************
@@ -491,7 +486,7 @@ static struct meta_ops __meta_ops[TCF_META_TYPE_MAX+1][TCF_META_ID_MAX+1] = {
                [META_ID(PKTLEN)]               = META_FUNC(int_pktlen),
                [META_ID(DATALEN)]              = META_FUNC(int_datalen),
                [META_ID(MACLEN)]               = META_FUNC(int_maclen),
-               [META_ID(NFMARK)]               = META_FUNC(int_nfmark),
+               [META_ID(NFMARK)]               = META_FUNC(int_mark),
                [META_ID(TCINDEX)]              = META_FUNC(int_tcindex),
                [META_ID(RTCLASSID)]            = META_FUNC(int_rtclassid),
                [META_ID(RTIIF)]                = META_FUNC(int_rtiif),
@@ -551,10 +546,9 @@ static int meta_var_change(struct meta_value *dst, struct rtattr *rta)
 {
        int len = RTA_PAYLOAD(rta);
 
-       dst->val = (unsigned long) kmalloc(len, GFP_KERNEL);
+       dst->val = (unsigned long)kmemdup(RTA_DATA(rta), len, GFP_KERNEL);
        if (dst->val == 0UL)
                return -ENOMEM;
-       memcpy((void *) dst->val, RTA_DATA(rta), len);
        dst->len = len;
        return 0;
 }
@@ -774,10 +768,9 @@ static int em_meta_change(struct tcf_proto *tp, void *data, int len,
            TCF_META_ID(hdr->right.kind) > TCF_META_ID_MAX)
                goto errout;
 
-       meta = kmalloc(sizeof(*meta), GFP_KERNEL);
+       meta = kzalloc(sizeof(*meta), GFP_KERNEL);
        if (meta == NULL)
                goto errout;
-       memset(meta, 0, sizeof(*meta));
 
        memcpy(&meta->lvalue.hdr, &hdr->left, sizeof(hdr->left));
        memcpy(&meta->rvalue.hdr, &hdr->right, sizeof(hdr->right));