summaryrefslogtreecommitdiffstats
path: root/libc
diff options
context:
space:
mode:
authorDavid 'Digit' Turner <digit@google.com>2009-07-28 15:27:33 -0700
committerAndroid Git Automerger <android-git-automerger@android.com>2009-07-28 15:27:33 -0700
commit9cfb12e6bce65b49fd858b86149858ff3851072d (patch)
tree356310761476af56a25dd0988157c16e3329e2b9 /libc
parenteda65ce1a5586ae9c9d19d886e3ea10ef0400510 (diff)
parent3773d35eb98e22b5edab4d82fb72bdf86ff80494 (diff)
downloadbionic-9cfb12e6bce65b49fd858b86149858ff3851072d.zip
bionic-9cfb12e6bce65b49fd858b86149858ff3851072d.tar.gz
bionic-9cfb12e6bce65b49fd858b86149858ff3851072d.tar.bz2
am 3773d35e: Make the DNS resolver accept domain names with an underscore.
Merge commit '3773d35eb98e22b5edab4d82fb72bdf86ff80494' * commit '3773d35eb98e22b5edab4d82fb72bdf86ff80494': Make the DNS resolver accept domain names with an underscore.
Diffstat (limited to 'libc')
-rw-r--r--libc/netbsd/resolv/res_comp.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/libc/netbsd/resolv/res_comp.c b/libc/netbsd/resolv/res_comp.c
index 6991e8b..77b81b4 100644
--- a/libc/netbsd/resolv/res_comp.c
+++ b/libc/netbsd/resolv/res_comp.c
@@ -147,6 +147,12 @@ dn_skipname(const u_char *ptr, const u_char *eom) {
* tell us anything about network-format data. The rest of the BIND system
* is not careful about this, but for some reason, we're doing it right here.
*/
+
+/* BIONIC: We also accept underscores in the middle of labels.
+ * This extension is needed to make resolution on some VPN networks
+ * work properly.
+ */
+
#define PERIOD 0x2e
#define hyphenchar(c) ((c) == 0x2d)
#define bslashchar(c) ((c) == 0x5c)
@@ -155,9 +161,10 @@ dn_skipname(const u_char *ptr, const u_char *eom) {
#define alphachar(c) (((c) >= 0x41 && (c) <= 0x5a) \
|| ((c) >= 0x61 && (c) <= 0x7a))
#define digitchar(c) ((c) >= 0x30 && (c) <= 0x39)
+#define underscorechar(c) ((c) == 0x5f)
#define borderchar(c) (alphachar(c) || digitchar(c))
-#define middlechar(c) (borderchar(c) || hyphenchar(c))
+#define middlechar(c) (borderchar(c) || hyphenchar(c) || underscorechar(c))
#define domainchar(c) ((c) > 0x20 && (c) < 0x7f)
int