Sanitize mtu in send_mtu_info()

This commit is contained in:
thorkill 2017-05-06 17:25:08 +02:00
parent f96d2d5d76
commit 94e5a9082b

View file

@ -351,6 +351,9 @@ bool send_mtu_info(node_t *from, node_t *to, int mtu) {
/* Skip cases where sending MTU info messages doesn't make sense. /* Skip cases where sending MTU info messages doesn't make sense.
This is done here in order to avoid repeating the same logic in multiple callsites. */ This is done here in order to avoid repeating the same logic in multiple callsites. */
if (mtu <= 0 || mtu > MTU)
return false;
if(to == myself) if(to == myself)
return true; return true;