diff options
Diffstat (limited to 'dns.c')
| -rw-r--r-- | dns.c | 15 |
1 files changed, 10 insertions, 5 deletions
| @@ -267,12 +267,11 @@ stralloc *sa; | |||
| 267 | int pref; | 267 | int pref; |
| 268 | { | 268 | { |
| 269 | int r; | 269 | int r; |
| 270 | struct ip_mx ix; | 270 | struct ip_mx ix = {0}; |
| 271 | 271 | ||
| 272 | if (!stralloc_copy(&glue,sa)) return DNS_MEM; | 272 | if (!stralloc_copy(&glue,sa)) return DNS_MEM; |
| 273 | if (!stralloc_0(&glue)) return DNS_MEM; | 273 | if (!stralloc_0(&glue)) return DNS_MEM; |
| 274 | if (glue.s[0]) { | 274 | if (glue.s[0]) { |
| 275 | ix.pref = 0; | ||
| 276 | if (!glue.s[ip_scan(glue.s,&ix.ip)] || !glue.s[ip_scanbracket(glue.s,&ix.ip)]) | 275 | if (!glue.s[ip_scan(glue.s,&ix.ip)] || !glue.s[ip_scanbracket(glue.s,&ix.ip)]) |
| 277 | { | 276 | { |
| 278 | if (!ipalloc_append(ia,&ix)) return DNS_MEM; | 277 | if (!ipalloc_append(ia,&ix)) return DNS_MEM; |
| @@ -291,9 +290,16 @@ int pref; | |||
| 291 | ix.ip = ip; | 290 | ix.ip = ip; |
| 292 | ix.pref = pref; | 291 | ix.pref = pref; |
| 293 | if (r == DNS_SOFT) return DNS_SOFT; | 292 | if (r == DNS_SOFT) return DNS_SOFT; |
| 294 | if (r == 1) | 293 | if (r == 1) { |
| 294 | #ifdef IX_FQDN | ||
| 295 | ix.fqdn = glue.s; | ||
| 296 | #endif | ||
| 295 | if (!ipalloc_append(ia,&ix)) return DNS_MEM; | 297 | if (!ipalloc_append(ia,&ix)) return DNS_MEM; |
| 296 | } | 298 | } |
| 299 | } | ||
| 300 | #ifdef IX_FQDN | ||
| 301 | glue.s = 0; | ||
| 302 | #endif | ||
| 297 | return 0; | 303 | return 0; |
| 298 | } | 304 | } |
| 299 | 305 | ||
| @@ -313,7 +319,7 @@ unsigned long random; | |||
| 313 | { | 319 | { |
| 314 | int r; | 320 | int r; |
| 315 | struct mx { stralloc sa; unsigned short p; } *mx; | 321 | struct mx { stralloc sa; unsigned short p; } *mx; |
| 316 | struct ip_mx ix; | 322 | struct ip_mx ix = {0}; |
| 317 | int nummx; | 323 | int nummx; |
| 318 | int i; | 324 | int i; |
| 319 | int j; | 325 | int j; |
| @@ -325,7 +331,6 @@ unsigned long random; | |||
| 325 | if (!stralloc_copy(&glue,sa)) return DNS_MEM; | 331 | if (!stralloc_copy(&glue,sa)) return DNS_MEM; |
| 326 | if (!stralloc_0(&glue)) return DNS_MEM; | 332 | if (!stralloc_0(&glue)) return DNS_MEM; |
| 327 | if (glue.s[0]) { | 333 | if (glue.s[0]) { |
| 328 | ix.pref = 0; | ||
| 329 | if (!glue.s[ip_scan(glue.s,&ix.ip)] || !glue.s[ip_scanbracket(glue.s,&ix.ip)]) | 334 | if (!glue.s[ip_scan(glue.s,&ix.ip)] || !glue.s[ip_scanbracket(glue.s,&ix.ip)]) |
| 330 | { | 335 | { |
| 331 | if (!ipalloc_append(ia,&ix)) return DNS_MEM; | 336 | if (!ipalloc_append(ia,&ix)) return DNS_MEM; |
