diff options
author | NeilBrown <neilb@suse.de> | 2012-08-01 06:40:02 -0400 |
---|---|---|
committer | NeilBrown <neilb@suse.de> | 2012-08-01 06:40:02 -0400 |
commit | bb181e2e48f8c85db08c9cb015cbba9618dbf05c (patch) | |
tree | 191bc24dd97bcb174535cc217af082f16da3b43d /net/sched/cls_api.c | |
parent | d57368afe63b3b7b45ce6c2b8c5276417935be2f (diff) | |
parent | c039c332f23e794deb6d6f37b9f07ff3b27fb2cf (diff) |
Merge commit 'c039c332f23e794deb6d6f37b9f07ff3b27fb2cf' into md
Pull in pre-requisites for adding raid10 support to dm-raid.
Diffstat (limited to 'net/sched/cls_api.c')
-rw-r--r-- | net/sched/cls_api.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/net/sched/cls_api.c b/net/sched/cls_api.c index f452f696b4b3..6dd1131f2ec1 100644 --- a/net/sched/cls_api.c +++ b/net/sched/cls_api.c | |||
@@ -140,7 +140,7 @@ static int tc_ctl_tfilter(struct sk_buff *skb, struct nlmsghdr *n, void *arg) | |||
140 | int tp_created = 0; | 140 | int tp_created = 0; |
141 | 141 | ||
142 | replay: | 142 | replay: |
143 | t = NLMSG_DATA(n); | 143 | t = nlmsg_data(n); |
144 | protocol = TC_H_MIN(t->tcm_info); | 144 | protocol = TC_H_MIN(t->tcm_info); |
145 | prio = TC_H_MAJ(t->tcm_info); | 145 | prio = TC_H_MAJ(t->tcm_info); |
146 | nprio = prio; | 146 | nprio = prio; |
@@ -349,8 +349,10 @@ static int tcf_fill_node(struct sk_buff *skb, struct tcf_proto *tp, | |||
349 | struct nlmsghdr *nlh; | 349 | struct nlmsghdr *nlh; |
350 | unsigned char *b = skb_tail_pointer(skb); | 350 | unsigned char *b = skb_tail_pointer(skb); |
351 | 351 | ||
352 | nlh = NLMSG_NEW(skb, pid, seq, event, sizeof(*tcm), flags); | 352 | nlh = nlmsg_put(skb, pid, seq, event, sizeof(*tcm), flags); |
353 | tcm = NLMSG_DATA(nlh); | 353 | if (!nlh) |
354 | goto out_nlmsg_trim; | ||
355 | tcm = nlmsg_data(nlh); | ||
354 | tcm->tcm_family = AF_UNSPEC; | 356 | tcm->tcm_family = AF_UNSPEC; |
355 | tcm->tcm__pad1 = 0; | 357 | tcm->tcm__pad1 = 0; |
356 | tcm->tcm__pad2 = 0; | 358 | tcm->tcm__pad2 = 0; |
@@ -368,7 +370,7 @@ static int tcf_fill_node(struct sk_buff *skb, struct tcf_proto *tp, | |||
368 | nlh->nlmsg_len = skb_tail_pointer(skb) - b; | 370 | nlh->nlmsg_len = skb_tail_pointer(skb) - b; |
369 | return skb->len; | 371 | return skb->len; |
370 | 372 | ||
371 | nlmsg_failure: | 373 | out_nlmsg_trim: |
372 | nla_put_failure: | 374 | nla_put_failure: |
373 | nlmsg_trim(skb, b); | 375 | nlmsg_trim(skb, b); |
374 | return -1; | 376 | return -1; |
@@ -418,7 +420,7 @@ static int tc_dump_tfilter(struct sk_buff *skb, struct netlink_callback *cb) | |||
418 | struct net_device *dev; | 420 | struct net_device *dev; |
419 | struct Qdisc *q; | 421 | struct Qdisc *q; |
420 | struct tcf_proto *tp, **chain; | 422 | struct tcf_proto *tp, **chain; |
421 | struct tcmsg *tcm = (struct tcmsg *)NLMSG_DATA(cb->nlh); | 423 | struct tcmsg *tcm = nlmsg_data(cb->nlh); |
422 | unsigned long cl = 0; | 424 | unsigned long cl = 0; |
423 | const struct Qdisc_class_ops *cops; | 425 | const struct Qdisc_class_ops *cops; |
424 | struct tcf_dump_args arg; | 426 | struct tcf_dump_args arg; |