iplink: validate maximum gso_max_size
Validate the upper limit for gso_max_size, valid range is [0-65,536] inclusive. Fix minor whitespace in iplink man page. Signed-off-by: Solio Sarabia <solio.sarabia@intel.com>
This commit is contained in:
parent
3a2fbf007b
commit
051274b4db
|
|
@ -853,7 +853,8 @@ int iplink_parse(int argc, char **argv, struct iplink_req *req,
|
|||
unsigned int max_size;
|
||||
|
||||
NEXT_ARG();
|
||||
if (get_unsigned(&max_size, *argv, 0) || max_size > UINT16_MAX)
|
||||
if (get_unsigned(&max_size, *argv, 0) ||
|
||||
max_size > UINT16_MAX + 1)
|
||||
invarg("Invalid \"gso_max_size\" value\n",
|
||||
*argv);
|
||||
addattr32(&req->n, sizeof(*req), IFLA_GSO_MAX_SIZE, max_size);
|
||||
|
|
|
|||
Loading…
Reference in New Issue