diff options
author | Alexander Wittig <abgandar@gmail.com> | 2013-12-16 12:28:21 (GMT) |
---|---|---|
committer | Jan Wagner <waja@cyconet.org> | 2014-07-30 13:25:20 (GMT) |
commit | 8d50765653f1cefa551888e6d1f1ff91151f91fa (patch) | |
tree | 7a3af198b161f25b479421ab94bb7d30b4107011 | |
parent | 8c623b1a432524950050ef6f2d273a87e013dacf (diff) | |
download | monitoring-plugins-8d50765653f1cefa551888e6d1f1ff91151f91fa.tar.gz |
check_dig: takes into account the -4 and -6 switch
Fix automatic DNS server name detection to honor -4 and -6 switches
(default to 127.0.0.1 or ::1 respectively, i.e. if -6 is given ::1
is used instead of 127.0.0.1)
-rw-r--r-- | plugins/check_dig.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/plugins/check_dig.c b/plugins/check_dig.c index 8d996b0..d899b11 100644 --- a/plugins/check_dig.c +++ b/plugins/check_dig.c | |||
@@ -296,7 +296,10 @@ process_arguments (int argc, char **argv) | |||
296 | dns_server = argv[c]; | 296 | dns_server = argv[c]; |
297 | } | 297 | } |
298 | else { | 298 | else { |
299 | dns_server = strdup ("127.0.0.1"); | 299 | if (strcmp(query_transport,"-6") == 0) |
300 | dns_server = strdup("::1"); | ||
301 | else | ||
302 | dns_server = strdup ("127.0.0.1"); | ||
300 | } | 303 | } |
301 | } | 304 | } |
302 | 305 | ||