Blame SOURCES/fping3-sourceip-option.patch
|
|
1c3a77 |
diff -Nru zabbix-3.0.2.orig/src/libs/zbxicmpping/icmpping.c zabbix-3.0.2/src/libs/zbxicmpping/icmpping.c
|
|
|
1c3a77 |
--- zabbix-3.0.2.orig/src/libs/zbxicmpping/icmpping.c 2016-04-20 18:51:21.000000000 +0900
|
|
|
1c3a77 |
+++ zabbix-3.0.2/src/libs/zbxicmpping/icmpping.c 2016-04-20 22:28:59.000000000 +0900
|
|
|
1c3a77 |
@@ -42,34 +42,7 @@
|
|
|
1c3a77 |
|
|
|
1c3a77 |
static void get_source_ip_option(const char *fping, const char **option, unsigned char *checked)
|
|
|
1c3a77 |
{
|
|
|
1c3a77 |
- FILE *f;
|
|
|
1c3a77 |
- char *p, tmp[MAX_STRING_LEN];
|
|
|
1c3a77 |
-
|
|
|
1c3a77 |
- zbx_snprintf(tmp, sizeof(tmp), "%s -h 2>&1", fping);
|
|
|
1c3a77 |
-
|
|
|
1c3a77 |
- if (NULL == (f = popen(tmp, "r")))
|
|
|
1c3a77 |
- return;
|
|
|
1c3a77 |
-
|
|
|
1c3a77 |
- while (NULL != fgets(tmp, sizeof(tmp), f))
|
|
|
1c3a77 |
- {
|
|
|
1c3a77 |
- for (p = tmp; isspace(*p); p++)
|
|
|
1c3a77 |
- ;
|
|
|
1c3a77 |
-
|
|
|
1c3a77 |
- if ('-' == p[0] && 'I' == p[1] && (isspace(p[2]) || ',' == p[2]))
|
|
|
1c3a77 |
- {
|
|
|
1c3a77 |
- *option = "-I";
|
|
|
1c3a77 |
- continue;
|
|
|
1c3a77 |
- }
|
|
|
1c3a77 |
-
|
|
|
1c3a77 |
- if ('-' == p[0] && 'S' == p[1] && (isspace(p[2]) || ',' == p[2]))
|
|
|
1c3a77 |
- {
|
|
|
1c3a77 |
- *option = "-S";
|
|
|
1c3a77 |
- break;
|
|
|
1c3a77 |
- }
|
|
|
1c3a77 |
- }
|
|
|
1c3a77 |
-
|
|
|
1c3a77 |
- pclose(f);
|
|
|
1c3a77 |
-
|
|
|
1c3a77 |
+ *option = "-S";
|
|
|
1c3a77 |
*checked = 1;
|
|
|
1c3a77 |
}
|
|
|
1c3a77 |
|