diff options
author | Patrick McHardy <kaber@trash.net> | 2008-01-23 23:35:03 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-01-28 18:11:21 -0500 |
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 7d46df7eac09..28098564b4d7 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, | |||
221 | if (tb[TCA_TCINDEX_HASH]) { | 221 | if (tb[TCA_TCINDEX_HASH]) { |
222 | if (nla_len(tb[TCA_TCINDEX_HASH]) < sizeof(u32)) | 222 | if (nla_len(tb[TCA_TCINDEX_HASH]) < sizeof(u32)) |
223 | goto errout; | 223 | goto errout; |
224 | cp.hash = *(u32 *) nla_data(tb[TCA_TCINDEX_HASH]); | 224 | cp.hash = nla_get_u32(tb[TCA_TCINDEX_HASH]); |
225 | } | 225 | } |
226 | 226 | ||
227 | if (tb[TCA_TCINDEX_MASK]) { | 227 | if (tb[TCA_TCINDEX_MASK]) { |
228 | if (nla_len(tb[TCA_TCINDEX_MASK]) < sizeof(u16)) | 228 | if (nla_len(tb[TCA_TCINDEX_MASK]) < sizeof(u16)) |
229 | goto errout; | 229 | goto errout; |
230 | cp.mask = *(u16 *) nla_data(tb[TCA_TCINDEX_MASK]); | 230 | cp.mask = nla_get_u16(tb[TCA_TCINDEX_MASK]); |
231 | } | 231 | } |
232 | 232 | ||
233 | if (tb[TCA_TCINDEX_SHIFT]) { | 233 | if (tb[TCA_TCINDEX_SHIFT]) { |
234 | if (nla_len(tb[TCA_TCINDEX_SHIFT]) < sizeof(int)) | 234 | if (nla_len(tb[TCA_TCINDEX_SHIFT]) < sizeof(int)) |
235 | goto errout; | 235 | goto errout; |
236 | cp.shift = *(int *) nla_data(tb[TCA_TCINDEX_SHIFT]); | 236 | cp.shift = nla_get_u32(tb[TCA_TCINDEX_SHIFT]); |
237 | } | 237 | } |
238 | 238 | ||
239 | err = -EBUSY; | 239 | err = -EBUSY; |
@@ -251,8 +251,7 @@ tcindex_set_parms(struct tcf_proto *tp, unsigned long base, u32 handle, | |||
251 | if (tb[TCA_TCINDEX_FALL_THROUGH]) { | 251 | if (tb[TCA_TCINDEX_FALL_THROUGH]) { |
252 | if (nla_len(tb[TCA_TCINDEX_FALL_THROUGH]) < sizeof(u32)) | 252 | if (nla_len(tb[TCA_TCINDEX_FALL_THROUGH]) < sizeof(u32)) |
253 | goto errout; | 253 | goto errout; |
254 | cp.fall_through = | 254 | cp.fall_through = nla_get_u32(tb[TCA_TCINDEX_FALL_THROUGH]); |
255 | *(u32 *) nla_data(tb[TCA_TCINDEX_FALL_THROUGH]); | ||
256 | } | 255 | } |
257 | 256 | ||
258 | if (!cp.hash) { | 257 | if (!cp.hash) { |
@@ -305,7 +304,7 @@ tcindex_set_parms(struct tcf_proto *tp, unsigned long base, u32 handle, | |||
305 | } | 304 | } |
306 | 305 | ||
307 | if (tb[TCA_TCINDEX_CLASSID]) { | 306 | if (tb[TCA_TCINDEX_CLASSID]) { |
308 | cr.res.classid = *(u32 *) nla_data(tb[TCA_TCINDEX_CLASSID]); | 307 | cr.res.classid = nla_get_u32(tb[TCA_TCINDEX_CLASSID]); |
309 | tcf_bind_filter(tp, &cr.res, base); | 308 | tcf_bind_filter(tp, &cr.res, base); |
310 | } | 309 | } |
311 | 310 | ||