diff options
author | Patrick McHardy <kaber@trash.net> | 2008-01-23 20:35:03 -0800 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-01-28 15:11:21 -0800 |
commit | 1587bac49f8491b5006a78f8d726111b71757941 (patch) | |
tree | 753e9fb452917efd9da6751fa4c6a45442c9fb8d /net/sched/cls_tcindex.c | |
parent | 24beeab539c6f42c4a93e2ff7c3b5f272e60da45 (diff) |
[NET_SCHED]: Use typeful attribute parsing helpers
Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/sched/cls_tcindex.c')
-rw-r--r-- | net/sched/cls_tcindex.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/net/sched/cls_tcindex.c b/net/sched/cls_tcindex.c index 7d46df7eac0..28098564b4d 100644 --- a/net/sched/cls_tcindex.c +++ b/net/sched/cls_tcindex.c @@ -221,19 +221,19 @@ tcindex_set_parms(struct tcf_proto *tp, unsigned long base, u32 handle, if (tb[TCA_TCINDEX_HASH]) { if (nla_len(tb[TCA_TCINDEX_HASH]) < sizeof(u32)) goto errout; - cp.hash = *(u32 *) nla_data(tb[TCA_TCINDEX_HASH]); + cp.hash = nla_get_u32(tb[TCA_TCINDEX_HASH]); } if (tb[TCA_TCINDEX_MASK]) { if (nla_len(tb[TCA_TCINDEX_MASK]) < sizeof(u16)) goto errout; - cp.mask = *(u16 *) nla_data(tb[TCA_TCINDEX_MASK]); + cp.mask = nla_get_u16(tb[TCA_TCINDEX_MASK]); } if (tb[TCA_TCINDEX_SHIFT]) { if (nla_len(tb[TCA_TCINDEX_SHIFT]) < sizeof(int)) goto errout; - cp.shift = *(int *) nla_data(tb[TCA_TCINDEX_SHIFT]); + cp.shift = nla_get_u32(tb[TCA_TCINDEX_SHIFT]); } err = -EBUSY; @@ -251,8 +251,7 @@ tcindex_set_parms(struct tcf_proto *tp, unsigned long base, u32 handle, if (tb[TCA_TCINDEX_FALL_THROUGH]) { if (nla_len(tb[TCA_TCINDEX_FALL_THROUGH]) < sizeof(u32)) goto errout; - cp.fall_through = - *(u32 *) nla_data(tb[TCA_TCINDEX_FALL_THROUGH]); + cp.fall_through = nla_get_u32(tb[TCA_TCINDEX_FALL_THROUGH]); } if (!cp.hash) { @@ -305,7 +304,7 @@ tcindex_set_parms(struct tcf_proto *tp, unsigned long base, u32 handle, } if (tb[TCA_TCINDEX_CLASSID]) { - cr.res.classid = *(u32 *) nla_data(tb[TCA_TCINDEX_CLASSID]); + cr.res.classid = nla_get_u32(tb[TCA_TCINDEX_CLASSID]); tcf_bind_filter(tp, &cr.res, base); } |