implement dn_skipname (legacy resolver function)
authorRich Felker <dalias@aerifal.cx>
Fri, 5 Apr 2013 02:36:30 +0000 (22:36 -0400)
committerRich Felker <dalias@aerifal.cx>
Fri, 5 Apr 2013 02:36:30 +0000 (22:36 -0400)
src/network/dn_skipname.c [new file with mode: 0644]

diff --git a/src/network/dn_skipname.c b/src/network/dn_skipname.c
new file mode 100644 (file)
index 0000000..d54c2e5
--- /dev/null
@@ -0,0 +1,12 @@
+#include <resolv.h>
+
+int dn_skipname(const unsigned char *s, const unsigned char *end)
+{
+       const unsigned char *p;
+       for (p=s; p<end; p++)
+               if (!*p) return p-s+1;
+               else if (*p>=192)
+                       if (p+1<end) return p-s+2;
+                       else break;
+       return -1;
+}