Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 200159
b: refs/heads/master
c: db2c241
h: refs/heads/master
i:
  200157: 1cc6b12
  200155: 6c4881c
  200151: 4ed28fd
  200143: 990848f
  200127: 2aa255b
v: v3
  • Loading branch information
Changli Gao authored and David S. Miller committed Jun 3, 2010
1 parent 217c5e6 commit c225ba0
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 11 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: 3df95ce948dc8ceef07b49003ab944aa047f2a79
refs/heads/master: db2c24175d149b55784f7cb2c303622ce962c1ae
24 changes: 14 additions & 10 deletions trunk/net/sched/act_pedit.c
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ static int tcf_pedit(struct sk_buff *skb, struct tc_action *a,
{
struct tcf_pedit *p = a->priv;
int i, munged = 0;
u8 *pptr;
unsigned int off;

if (!(skb->tc_verd & TC_OK2MUNGE)) {
/* should we set skb->cloned? */
Expand All @@ -134,7 +134,7 @@ static int tcf_pedit(struct sk_buff *skb, struct tc_action *a,
}
}

pptr = skb_network_header(skb);
off = skb_network_offset(skb);

spin_lock(&p->tcf_lock);

Expand All @@ -144,17 +144,17 @@ static int tcf_pedit(struct sk_buff *skb, struct tc_action *a,
struct tc_pedit_key *tkey = p->tcfp_keys;

for (i = p->tcfp_nkeys; i > 0; i--, tkey++) {
u32 *ptr;
u32 *ptr, _data;
int offset = tkey->off;

if (tkey->offmask) {
if (skb->len > tkey->at) {
char *j = pptr + tkey->at;
offset += ((*j & tkey->offmask) >>
tkey->shift);
} else {
char *d, _d;

d = skb_header_pointer(skb, off + tkey->at, 1,
&_d);
if (!d)
goto bad;
}
offset += (*d & tkey->offmask) >> tkey->shift;
}

if (offset % 4) {
Expand All @@ -169,9 +169,13 @@ static int tcf_pedit(struct sk_buff *skb, struct tc_action *a,
goto bad;
}

ptr = (u32 *)(pptr+offset);
ptr = skb_header_pointer(skb, off + offset, 4, &_data);
if (!ptr)
goto bad;
/* just do it, baby */
*ptr = ((*ptr & tkey->mask) ^ tkey->val);
if (ptr == &_data)
skb_store_bits(skb, off + offset, ptr, 4);
munged++;
}

Expand Down

0 comments on commit c225ba0

Please sign in to comment.