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__) +/* + * 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