[NETFILTER]: Add partial checksum validation helper
[safe/jmp/linux-2.6] / net / sched / act_api.c
index 3602260..74e662c 100644 (file)
@@ -121,7 +121,7 @@ static int tcf_del_walker(struct sk_buff *skb, struct tc_action *a,
        nest = nla_nest_start(skb, a->order);
        if (nest == NULL)
                goto nla_put_failure;
-       NLA_PUT(skb, TCA_KIND, IFNAMSIZ, a->ops->kind);
+       NLA_PUT_STRING(skb, TCA_KIND, a->ops->kind);
        for (i = 0; i < (hinfo->hmask + 1); i++) {
                p = hinfo->htab[tcf_hash(i, hinfo->hmask)];
 
@@ -133,7 +133,7 @@ static int tcf_del_walker(struct sk_buff *skb, struct tc_action *a,
                        p = s_p;
                }
        }
-       NLA_PUT(skb, TCA_FCNT, 4, &n_i);
+       NLA_PUT_U32(skb, TCA_FCNT, n_i);
        nla_nest_end(skb, nest);
 
        return n_i;
@@ -423,7 +423,7 @@ tcf_action_dump_1(struct sk_buff *skb, struct tc_action *a, int bind, int ref)
        if (a->ops == NULL || a->ops->dump == NULL)
                return err;
 
-       NLA_PUT(skb, TCA_KIND, IFNAMSIZ, a->ops->kind);
+       NLA_PUT_STRING(skb, TCA_KIND, a->ops->kind);
        if (tcf_action_copy_stats(skb, a, 0))
                goto nla_put_failure;
        nest = nla_nest_start(skb, TCA_OPTIONS);
@@ -690,7 +690,7 @@ tcf_action_get_1(struct nlattr *nla, struct nlmsghdr *n, u32 pid)
        if (tb[TCA_ACT_INDEX] == NULL ||
            nla_len(tb[TCA_ACT_INDEX]) < sizeof(index))
                goto err_out;
-       index = *(int *)nla_data(tb[TCA_ACT_INDEX]);
+       index = nla_get_u32(tb[TCA_ACT_INDEX]);
 
        err = -ENOMEM;
        a = kzalloc(sizeof(struct tc_action), GFP_KERNEL);
@@ -951,7 +951,7 @@ done:
 
 static int tc_ctl_action(struct sk_buff *skb, struct nlmsghdr *n, void *arg)
 {
-       struct net *net = skb->sk->sk_net;
+       struct net *net = sock_net(skb->sk);
        struct nlattr *tca[TCA_ACT_MAX + 1];
        u32 pid = skb ? NETLINK_CB(skb).pid : 0;
        int ret = 0, ovr = 0;
@@ -1029,7 +1029,7 @@ find_dump_kind(struct nlmsghdr *n)
 static int
 tc_dump_action(struct sk_buff *skb, struct netlink_callback *cb)
 {
-       struct net *net = skb->sk->sk_net;
+       struct net *net = sock_net(skb->sk);
        struct nlmsghdr *nlh;
        unsigned char *b = skb_tail_pointer(skb);
        struct nlattr *nest;