Skip to contentSkip to conversation

: ipt: convert jiffie values to USER_HZ when dumping

PATCH In review Patrick McHardy 2 participants 2 messages Nov 4, 2004 – Nov 6, 2004

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 4/4 : ipt: convert jiffie values to USER_HZ when dumping

Convert jiffie values to USER_HZ in ipt action.

# This is a BitKeeper generated diff -Nru style patch. #
# ChangeSet
# 2004/11/05 00:17:18+01:00 [email protected]
# [PKT_SCHED]: ipt: convert jiffie values to USER_HZ when dumping
#
# Signed-off-by: Patrick McHardy <[email protected]>
#

# net/sched/ipt.c
#   2004/11/05 00:17:10+01:00 [email protected] +3 -3
#   [PKT_SCHED]: ipt: convert jiffie values to USER_HZ when dumping
#   
#   Signed-off-by: Patrick McHardy <[email protected]>
# 
diff -Nru a/net/sched/ipt.c b/net/sched/ipt.c
--- a/net/sched/ipt.c	2004-11-05 00:19:01 +01:00
+++ b/net/sched/ipt.c	2004-11-05 00:19:01 +01:00
@@ -334,9 +334,9 @@
 	RTA_PUT(skb, TCA_IPT_HOOK, 4, &p->hook);
 	RTA_PUT(skb, TCA_IPT_CNT, sizeof(struct tc_cnt), &c);
 	RTA_PUT(skb, TCA_IPT_TABLE, IFNAMSIZ, p->tname);
-	tm.install = jiffies - p->tm.install;
-	tm.lastuse = jiffies - p->tm.lastuse;
-	tm.expires = p->tm.expires;
+	tm.install = jiffies_to_clock_t(jiffies - p->tm.install);
+	tm.lastuse = jiffies_to_clock_t(jiffies - p->tm.lastuse);
+	tm.expires = jiffies_to_clock_t(p->tm.expires);
 	RTA_PUT(skb, TCA_IPT_TM, sizeof (tm), &tm);
 	return skb->len;
maintainer
#1 lore raw

All 4 patches applied, thanks Patrick.

BTW, you don't need to split up changes like this with such high granularity. It's perfectly fine to lump these kinds of simple changes together as "Convert to USER_HZ when dumping in TC action modules".

If the transformation is sizable or of non-trivial complexity, then yes splitting up the individual changes makes sense and makes it easier for people to review and verify the patches.

Just a FYI. :-)