projects
/
oweals
/
odhcpd.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
3495f17
)
router: fix arithmetic exception fault
author
Hans Dedecker
<dedeckeh@gmail.com>
Mon, 20 Feb 2017 16:19:06 +0000
(17:19 +0100)
committer
Hans Dedecker
<dedeckeh@gmail.com>
Mon, 20 Feb 2017 16:19:06 +0000
(17:19 +0100)
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
src/router.c
patch
|
blob
|
history
diff --git
a/src/router.c
b/src/router.c
index dd3f09cebba6d72c64935c90188b394def3bfc34..ffafb9451f3c106e0c594c033cc4fc3b48d54ed8 100644
(file)
--- a/
src/router.c
+++ b/
src/router.c
@@
-233,7
+233,8
@@
static int calc_adv_interval(struct interface *iface, uint32_t minvalid,
minival = (*maxival >= 9 ? *maxival/3 : *maxival);
odhcpd_urandom(&msecs, sizeof(msecs));
- msecs = (labs(msecs) % ((*maxival - minival)*1000)) + minival*1000;
+ msecs = (labs(msecs) % ((*maxival != minival) ? (*maxival - minival)*1000 : 500)) +
+ minival*1000;
return msecs;
}