diff options
Diffstat (limited to 'main/zabbix/zabbix-dn_skipname.patch')
-rw-r--r-- | main/zabbix/zabbix-dn_skipname.patch | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/main/zabbix/zabbix-dn_skipname.patch b/main/zabbix/zabbix-dn_skipname.patch new file mode 100644 index 0000000000..df75e914a1 --- /dev/null +++ b/main/zabbix/zabbix-dn_skipname.patch @@ -0,0 +1,44 @@ +diff --git a/src/libs/zbxsysinfo/common/net.c b/src/libs/zbxsysinfo/common/net.c +index c8956a6..645fd8c 100644 +--- a/src/libs/zbxsysinfo/common/net.c ++++ b/src/libs/zbxsysinfo/common/net.c +@@ -26,6 +26,39 @@ + + #include "net.h" + ++#if defined(__UCLIBC__) && defined(HAVE_RES_QUERY) ++/* ++ * Skip over a compressed domain name. Return the size or -1. ++ */ ++int ++__dn_skipname(const u_char *comp_dn, const u_char *eom) ++{ ++ const u_char *cp; ++ int n; ++ ++ cp = comp_dn; ++ while (cp < eom && (n = *cp++)) { ++ /* ++ * check for indirection ++ */ ++ switch (n & INDIR_MASK) { ++ case 0: /* normal case, n == len */ ++ cp += n; ++ continue; ++ case INDIR_MASK: /* indirection */ ++ cp++; ++ break; ++ default: /* illegal type */ ++ return (-1); ++ } ++ break; ++ } ++ if (cp > eom) ++ return (-1); ++ return (cp - comp_dn); ++} ++#endif ++ + /* + * 0 - NOT OK + * 1 - OK |