Allow running fping --help even when raw socket can't be opened, fixes #131

pull/132/head
David Schweikert 7 years ago
parent b2d35174c9
commit df7a819fd9

@ -5,6 +5,7 @@ fping 4.1 (UNRELEASED)
- Fix problem when socket fd is 0 (#125, thanks Ramón Novoa!)
- Fix running on servers with disabled IPv6 (#118, thanks Simon Matter)
- Allow running "fping -h" or "--help" even when raw socket can't be opened (#131, thanks @teto)
fping 4.0 (2017-04-23)
======================

@ -352,6 +352,12 @@ int main(int argc, char** argv)
HOST_ENTRY* cursor;
struct optparse optparse_state;
/* pre-parse -h/--help, so that we also can output help information
* without trying to open the socket, which might fail */
if(argc == 2 && ( strcmp(argv[1],"-h")==0 || strcmp(argv[1],"--help")==0 )) {
usage(0);
}
socket4 = open_ping_socket_ipv4(ping_data_size);
#ifdef IPV6
socket6 = open_ping_socket_ipv6(ping_data_size);

Loading…
Cancel
Save