aboutgitcodebugslistschat
path: root/icmp.c
diff options
context:
space:
mode:
authorDavid Gibson <david@gibson.dropbear.id.au>2024-01-16 11:50:32 +1100
committerStefano Brivio <sbrivio@redhat.com>2024-01-22 23:35:10 +0100
commit8563e7c870e139baf14ef00b26cdc7db4884246c (patch)
tree766e432a1bfa21c863eef434e0a9a68ffabec856 /icmp.c
parent17bbab1c97516048fdcc6c2e6c8efc524e56e71e (diff)
downloadpasst-8563e7c870e139baf14ef00b26cdc7db4884246c.tar
passt-8563e7c870e139baf14ef00b26cdc7db4884246c.tar.gz
passt-8563e7c870e139baf14ef00b26cdc7db4884246c.tar.bz2
passt-8563e7c870e139baf14ef00b26cdc7db4884246c.tar.lz
passt-8563e7c870e139baf14ef00b26cdc7db4884246c.tar.xz
passt-8563e7c870e139baf14ef00b26cdc7db4884246c.tar.zst
passt-8563e7c870e139baf14ef00b26cdc7db4884246c.zip
treewide: Standardise on 'now' for current timestamp variables
In a number of places we pass around a struct timespec representing the (more or less) current time. Sometimes we call it 'now', and sometimes we call it 'ts'. Standardise on the more informative 'now'. Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
Diffstat (limited to 'icmp.c')
-rw-r--r--icmp.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/icmp.c b/icmp.c
index c82efd0..325dfb0 100644
--- a/icmp.c
+++ b/icmp.c
@@ -275,14 +275,14 @@ fail_sock:
* @c: Execution context
* @v6: Set for IPv6 echo identifier bindings
* @id: Echo identifier, host order
- * @ts: Timestamp from caller
+ * @now: Current timestamp
*/
static void icmp_timer_one(const struct ctx *c, int v6, uint16_t id,
- const struct timespec *ts)
+ const struct timespec *now)
{
struct icmp_id_sock *id_map = &icmp_id_map[v6 ? V6 : V4][id];
- if (ts->tv_sec - id_map->ts <= ICMP_ECHO_TIMEOUT)
+ if (now->tv_sec - id_map->ts <= ICMP_ECHO_TIMEOUT)
return;
bitmap_clear(icmp_act[v6 ? V6 : V4], id);
@@ -296,9 +296,9 @@ static void icmp_timer_one(const struct ctx *c, int v6, uint16_t id,
/**
* icmp_timer() - Scan activity bitmap for identifiers with timed events
* @c: Execution context
- * @ts: Timestamp from caller
+ * @now: Current timestamp
*/
-void icmp_timer(const struct ctx *c, const struct timespec *ts)
+void icmp_timer(const struct ctx *c, const struct timespec *now)
{
long *word, tmp;
unsigned int i;
@@ -310,7 +310,7 @@ v6:
tmp = *word;
while ((n = ffsl(tmp))) {
tmp &= ~(1UL << (n - 1));
- icmp_timer_one(c, v6, i * 8 + n - 1, ts);
+ icmp_timer_one(c, v6, i * 8 + n - 1, now);
}
}