summaryrefslogtreecommitdiff
path: root/dns.c
diff options
context:
space:
mode:
authorJohn Denker <jsd@av8n.com>2016-01-01 11:15:35 -0700
committerJohn Denker <jsd@av8n.com>2016-01-01 16:33:29 -0800
commita16bea1ca0aa3ef44919fbe045b9040874fd8628 (patch)
tree99ac443b96f8b89f8a480bb378b619d18e8cfc31 /dns.c
parent4dabcdf185f53439af8fdf71bd2da7317336bcf0 (diff)
the big starttls patch
Diffstat (limited to 'dns.c')
-rw-r--r--dns.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/dns.c b/dns.c
index c2f7d86..dc3bd84 100644
--- a/dns.c
+++ b/dns.c
@@ -284,12 +284,11 @@ stralloc *sa;
int pref;
{
int r;
- struct ip_mx ix;
+ struct ip_mx ix = {0};
if (!stralloc_copy(&glue,sa)) return DNS_MEM;
if (!stralloc_0(&glue)) return DNS_MEM;
if (glue.s[0]) {
- ix.pref = 0;
if (!glue.s[ip_scan(glue.s,&ix.ip)] || !glue.s[ip_scanbracket(glue.s,&ix.ip)])
{
if (!ipalloc_append(ia,&ix)) return DNS_MEM;
@@ -308,9 +307,16 @@ int pref;
ix.ip = ip;
ix.pref = pref;
if (r == DNS_SOFT) return DNS_SOFT;
- if (r == 1)
+ if (r == 1) {
+#ifdef IX_FQDN
+ ix.fqdn = glue.s;
+#endif
if (!ipalloc_append(ia,&ix)) return DNS_MEM;
}
+ }
+#ifdef IX_FQDN
+ glue.s = 0;
+#endif
return 0;
}
@@ -330,7 +336,7 @@ unsigned long random;
{
int r;
struct mx { stralloc sa; unsigned short p; } *mx;
- struct ip_mx ix;
+ struct ip_mx ix = {0};
int nummx;
int i;
int j;
@@ -342,7 +348,6 @@ unsigned long random;
if (!stralloc_copy(&glue,sa)) return DNS_MEM;
if (!stralloc_0(&glue)) return DNS_MEM;
if (glue.s[0]) {
- ix.pref = 0;
if (!glue.s[ip_scan(glue.s,&ix.ip)] || !glue.s[ip_scanbracket(glue.s,&ix.ip)])
{
if (!ipalloc_append(ia,&ix)) return DNS_MEM;