mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-06-19 08:58:28 +02:00
ndisc: avoid static analysis complaining about overflow check in receive_ra()
lgtm.com flags this. The check was there to be better safe than sorry. Also, it seems better to have code that shows what happens instead of a verbose code comment (or no comment at all). Anyway, avoid the false positive.
This commit is contained in:
parent
b447c80ad8
commit
53b2297701
1 changed files with 3 additions and 3 deletions
|
|
@ -179,9 +179,9 @@ receive_ra (struct ndp *ndp, struct ndp_msg *msg, gpointer user_data)
|
|||
*/
|
||||
#define NM_NDISC_VLTIME_MULT ((guint32) 48)
|
||||
clamp_pltime = ndp_msgra_router_lifetime (msgra);
|
||||
clamp_vltime = (clamp_pltime < G_MAXUINT32 / NM_NDISC_VLTIME_MULT)
|
||||
? clamp_pltime * NM_NDISC_VLTIME_MULT
|
||||
: G_MAXUINT32;
|
||||
|
||||
/* clamp_pltime has at most 16 bit set, and multiplication cannot overflow. */
|
||||
clamp_vltime = clamp_pltime * NM_NDISC_VLTIME_MULT;
|
||||
|
||||
ndp_msg_opt_for_each_offset (offset, msg, NDP_MSG_OPT_PREFIX) {
|
||||
guint8 r_plen;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue