From: eric Date: Wed, 3 Oct 2018 11:43:57 +0000 (+0000) Subject: correctly handle "+a:..." entries X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=b1cc6ff8162418196c8a80e821dc00749a9d1a5d;p=openbsd correctly handle "+a:..." entries from gilles@ ok otto@ gilles@ --- diff --git a/usr.sbin/smtpd/spfwalk.c b/usr.sbin/smtpd/spfwalk.c index cc9ed09240d..c4ce2e3d891 100644 --- a/usr.sbin/smtpd/spfwalk.c +++ b/usr.sbin/smtpd/spfwalk.c @@ -170,6 +170,12 @@ dispatch_txt(struct dns_rr *rr) if (dict_set(&seen, *ap, &seen)) continue; + if (**ap == '-' || **ap == '~') + continue; + + if (**ap == '+' || **ap == '?') + (*ap)++; + if (strncasecmp("ip4:", *ap, 4) == 0) { if ((ip_v4 == 1 || ip_both == 1) && inet_net_pton(AF_INET, *(ap) + 4, @@ -184,20 +190,6 @@ dispatch_txt(struct dns_rr *rr) printf("%s\n", *(ap) + 4); continue; } - if (strncasecmp("+ip4:", *ap, 5) == 0) { - if ((ip_v4 == 1 || ip_both == 1) && - inet_net_pton(AF_INET, *(ap) + 5, - &ina, sizeof(ina)) != -1) - printf("%s\n", *(ap) + 5); - continue; - } - if (strncasecmp("+ip6:", *ap, 5) == 0) { - if ((ip_v6 == 1 || ip_both == 1) && - inet_net_pton(AF_INET6, *(ap) + 5, - &ina, sizeof(ina)) != -1) - printf("%s\n", *(ap) + 5); - continue; - } if (strncasecmp("a:", *ap, 2) == 0) { lookup_record(T_A, *(ap) + 2, dispatch_a); continue;