Skip to content

Commit

Permalink
Check IP address command line arg in dhcp_release.c
Browse files Browse the repository at this point in the history
  • Loading branch information
moshe010 authored and simonkelley committed Apr 19, 2015
1 parent 554b580 commit a006eb7
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions contrib/wrt/dhcp_release.c
Expand Up @@ -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]));
Expand Down

0 comments on commit a006eb7

Please sign in to comment.