Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 111763
b: refs/heads/master
c: d48abfe
h: refs/heads/master
i:
  111761: 074426a
  111759: f2f4105
v: v3
  • Loading branch information
Harvey Harrison authored and David S. Miller committed Sep 23, 2008
1 parent f3f5614 commit ace7fdb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 978e9aec262d66d13ccceece93b867bfc0fcd2f1
refs/heads/master: d48abfecea8513cfd2fd7e341439c1b8a28e9ff4
9 changes: 3 additions & 6 deletions trunk/net/sched/em_cmp.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
#include <linux/kernel.h>
#include <linux/skbuff.h>
#include <linux/tc_ematch/tc_em_cmp.h>
#include <asm/unaligned.h>
#include <net/pkt_cls.h>

static inline int cmp_needs_transformation(struct tcf_em_cmp *cmp)
Expand All @@ -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);
Expand All @@ -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);
Expand Down

0 comments on commit ace7fdb

Please sign in to comment.