summaryrefslogtreecommitdiff
path: root/proto/babel/packets.c
diff options
context:
space:
mode:
authorOndrej Zajicek (work) <santiago@crfreenet.org>2017-10-13 12:34:08 +0200
committerOndrej Zajicek (work) <santiago@crfreenet.org>2017-12-07 13:53:42 +0100
commit8b58f565e4fcd076e2d9fe008c7f2b19e264b319 (patch)
treeef2b55dc9ddf353c5125450ccd8be88926ae36f0 /proto/babel/packets.c
parent6b5cd7c05f82e87d67c1b41296021757a3d952a0 (diff)
Babel: Update to new timers
Diffstat (limited to 'proto/babel/packets.c')
-rw-r--r--proto/babel/packets.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/proto/babel/packets.c b/proto/babel/packets.c
index d136efe8..6e8d2eb5 100644
--- a/proto/babel/packets.c
+++ b/proto/babel/packets.c
@@ -162,17 +162,17 @@ bytes_equal(u8 *b1, u8 *b2, uint maxlen)
return i;
}
-static inline u16
+static inline uint
get_time16(const void *p)
{
- u16 v = get_u16(p) / BABEL_TIME_UNITS;
- return MAX(1, v);
+ uint v = get_u16(p) * BABEL_TIME_UNITS;
+ return MAX(BABEL_MIN_INTERVAL, v);
}
static inline void
-put_time16(void *p, u16 v)
+put_time16(void *p, uint v)
{
- put_u16(p, v * BABEL_TIME_UNITS);
+ put_u16(p, v / BABEL_TIME_UNITS);
}
static inline void