From efeff930f918cad30da28592fb277af96a14e28c Mon Sep 17 00:00:00 2001 From: Stephane Bortzmeyer Date: Sun, 13 Jun 2004 20:49:38 +0000 Subject: [PATCH] IPv4 and IPv6 in global options --- SRC/echoping.c | 8 ++++++++ SRC/echoping.h | 2 ++ 2 files changed, 10 insertions(+) diff --git a/SRC/echoping.c b/SRC/echoping.c index d6cac75..49a0b87 100644 --- a/SRC/echoping.c +++ b/SRC/echoping.c @@ -462,6 +462,14 @@ main (argc, argv) } global_options.udp = udp; global_options.verbose = verbose; + if (family == AF_INET) + global_options.only_ipv4 = 1; + else + global_options.only_ipv4 = 0; + if (family == AF_INET6) + global_options.only_ipv6 = 1; + else + global_options.only_ipv6 = 0; plugin_port_name = plugin_init (remaining, (const char **) leftover, global_options); if (plugin_port_name != NULL) diff --git a/SRC/echoping.h b/SRC/echoping.h index 03176f0..ddb5c66 100644 --- a/SRC/echoping.h +++ b/SRC/echoping.h @@ -122,6 +122,8 @@ unsigned short timeout_flag; struct echoping_struct { unsigned short udp; /* Use the UDP protocol (TCP is the default) */ + unsigned short only_ipv4; + unsigned short only_ipv6; unsigned short verbose; }; typedef struct echoping_struct echoping_options;