DORMANTno replies

[PATCH] tc action: pedit, fix header offset calculation

From: Anton 'EvilMan' Danilov <hidden>
Date: 2012-02-29 16:45:09
Subsystem: networking [general], tc subsystem, the rest · Maintainers: "David S. Miller", Eric Dumazet, Jakub Kicinski, Paolo Abeni, Jamal Hadi Salim, Jiri Pirko, Linus Torvalds

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.
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;
			}

			if (offset % 4) {

-- 
Anton.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help