fs: replace NIPQUAD()
Using NIPQUAD() with NIPQUAD_FMT, %d.%d.%d.%d or %u.%u.%u.%u can be replaced with %pI4 Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
committed by
David S. Miller
parent
63779436ab
commit
be85940548
@@ -330,7 +330,7 @@ static ssize_t failover_unlock_ip(struct file *file, char *buf, size_t size)
|
||||
return -EINVAL;
|
||||
|
||||
/* get ipv4 address */
|
||||
if (sscanf(fo_path, NIPQUAD_FMT "%c", &b1, &b2, &b3, &b4, &c) != 4)
|
||||
if (sscanf(fo_path, "%u.%u.%u.%u%c", &b1, &b2, &b3, &b4, &c) != 4)
|
||||
return -EINVAL;
|
||||
if (b1 > 255 || b2 > 255 || b3 > 255 || b4 > 255)
|
||||
return -EINVAL;
|
||||
|
Reference in New Issue
Block a user