diff mbox

tc action: pedit, fix header offset calculation

Message ID CAEzD07LUMu+SEy7YM=Wi=ZEihE6SWZxbh3qjUCYBxFGiC40uwA@mail.gmail.com
State Rejected, archived
Delegated to: David Miller
Headers show

Commit Message

Anton Danilov Feb. 29, 2012, 4:45 p.m. UTC
This patch fix header offset calculation in pedit action.
Header offset feature can be used for calculation offset of next
header, if options is presented in ipv4 header.

			if (offset % 4) {
diff mbox

Patch

diff --git a/net/sched/act_pedit.c b/net/sched/act_pedit.c
index 10d3aed..4678a77 100644
--- a/net/sched/act_pedit.c
+++ b/net/sched/act_pedit.c
@@ -151,7 +151,7 @@  static int tcf_pedit(struct sk_buff *skb, const
struct tc_action *a,
							&_d);
				if (!d)
					goto bad;
-				offset += (*d & tkey->offmask) >> tkey->shift;
+				offset += ntohl(*d & tkey->offmask) >> tkey->shift;
			}