diff options
| author | cinap_lenrek <cinap_lenrek@felloff.net> | 2018-09-25 20:28:19 +0200 |
|---|---|---|
| committer | cinap_lenrek <cinap_lenrek@felloff.net> | 2018-09-25 20:28:19 +0200 |
| commit | 05f6c08985c9bd522e0a938f0e90b20df3f6792d (patch) | |
| tree | c180285e090d051bd7a9d5d11bc9856b28d14cb2 | |
| parent | 347303b136c41ac5ca4408818fdd1a3fde89888a (diff) | |
| download | plan9front-05f6c08985c9bd522e0a938f0e90b20df3f6792d.tar.xz | |
ip/dhcp6d: handle internationalized domain names
| -rw-r--r-- | sys/src/cmd/ip/dhcp6d.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/sys/src/cmd/ip/dhcp6d.c b/sys/src/cmd/ip/dhcp6d.c index 473f681b7..ca87f0c00 100644 --- a/sys/src/cmd/ip/dhcp6d.c +++ b/sys/src/cmd/ip/dhcp6d.c @@ -562,6 +562,7 @@ oservers(uchar *w, int n, Otab *o, Req *r) static int odomainlist(uchar *w, int n, Otab *o, Req *q) { + char val[256]; Ndbtuple *t; int l, r; char *s; @@ -570,7 +571,9 @@ odomainlist(uchar *w, int n, Otab *o, Req *q) for(t = q->t; t != nil; t = t->entry){ if(strcmp(t->attr, o->q[0]) != 0) continue; - for(s = t->val; *s != 0; s++){ + if(utf2idn(t->val, val, sizeof(val)) == nil) + continue; + for(s = val; *s != 0; s++){ for(l = 0; *s != 0 && *s != '.'; l++) s++; if(r+1+l > n) @@ -578,6 +581,8 @@ odomainlist(uchar *w, int n, Otab *o, Req *q) w[r++] = l; memmove(w+r, s-l, l); r += l; + if(*s != '.') + break; } if(r >= n) return -1; |
