Multiple fixes found by coverity scan

This commit is contained in:
goldsimon
2014-04-30 12:22:31 +02:00
parent 88a57dc98d
commit e4ddd6cb6d
4 changed files with 15 additions and 13 deletions

View File

@@ -704,6 +704,9 @@ igmp_start_timer(struct igmp_group *group, u8_t max_time)
}
/* ensure the random value is > 0 */
group->timer = (LWIP_RAND() % max_time);
if (group->timer == 0) {
group->timer = 1;
}
#else /* LWIP_RAND */
/* ATTENTION: use this only if absolutely necessary! */
group->timer = max_time / 2;