Check IP address command line arg in dhcp_release.c

This commit is contained in:
Moshe Levi authored and Simon Kelley committed 2015-04-19 22:10:40 +01:00
1 parent 554b580e97
commit a006eb7e14
1 file changed
+5
+5
View File
@@ -277,6 +277,11 @@ int main(int argc, char **argv)
exit(1);
}
if (inet_addr(argv[2]) == INADDR_NONE)
{
perror("invalid ip address");
exit(1);
}
lease.s_addr = inet_addr(argv[2]);
server = find_interface(lease, nl, if_nametoindex(argv[1]));