From ace7fdb2f966728a9d902402b007e4b349a2793f Mon Sep 17 00:00:00 2001 From: Harvey Harrison Date: Mon, 22 Sep 2008 19:20:51 -0700 Subject: [PATCH] --- yaml --- r: 111763 b: refs/heads/master c: d48abfecea8513cfd2fd7e341439c1b8a28e9ff4 h: refs/heads/master i: 111761: 074426ad9e6fcc80e0df5cbe1378aa84f1adaa5e 111759: f2f410565b6f9507dd32fa61015a91267433f471 v: v3 --- [refs] | 2 +- trunk/net/sched/em_cmp.c | 9 +++------ 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/[refs] b/[refs] index e2c0ff2bf121..a5e6852b12c2 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 978e9aec262d66d13ccceece93b867bfc0fcd2f1 +refs/heads/master: d48abfecea8513cfd2fd7e341439c1b8a28e9ff4 diff --git a/trunk/net/sched/em_cmp.c b/trunk/net/sched/em_cmp.c index cc49c932641d..bc450397487a 100644 --- a/trunk/net/sched/em_cmp.c +++ b/trunk/net/sched/em_cmp.c @@ -14,6 +14,7 @@ #include #include #include +#include #include static inline int cmp_needs_transformation(struct tcf_em_cmp *cmp) @@ -37,8 +38,7 @@ static int em_cmp_match(struct sk_buff *skb, struct tcf_ematch *em, break; case TCF_EM_ALIGN_U16: - val = *ptr << 8; - val |= *(ptr+1); + val = get_unaligned_be16(ptr); if (cmp_needs_transformation(cmp)) val = be16_to_cpu(val); @@ -47,10 +47,7 @@ static int em_cmp_match(struct sk_buff *skb, struct tcf_ematch *em, case TCF_EM_ALIGN_U32: /* Worth checking boundries? The branching seems * to get worse. Visit again. */ - val = *ptr << 24; - val |= *(ptr+1) << 16; - val |= *(ptr+2) << 8; - val |= *(ptr+3); + val = get_unaligned_be32(ptr); if (cmp_needs_transformation(cmp)) val = be32_to_cpu(val);