Mercurial > dnsbl
diff src/context.cpp @ 460:ad05c61d6372 stable-6-0-74
add debug code for spf check with microsoft /14
author | Carl Byington <carl@five-ten-sg.com> |
---|---|
date | Mon, 24 Dec 2018 09:37:36 -0800 |
parents | 48cfa55cd73b |
children | f3f1ece619ba |
line wrap: on
line diff
--- a/src/context.cpp Tue Sep 18 09:52:56 2018 -0700 +++ b/src/context.cpp Mon Dec 24 09:37:36 2018 -0800 @@ -1215,9 +1215,14 @@ if (inet_aton(p, &ipx)) { uint32_t ipy = ntohl(ipx.s_addr); int mask = (s) ? atoi(s+1) : 32; - if ((mask >= 16) && (mask <= 32)) { + if ((mask >= 14) && (mask <= 32)) { // microsoft has a /14 uint32_t low = (1 << (32-mask)) - 1; ipy &= low ^ 0xffffffff; + { + char buf[maxlen]; + snprintf(buf, maxlen, "ip=%08x, spf=%08x/%d, mask=%08x", ip, ipy, mask, low); + log(priv->queueid, "spf check %s", buf); + } if ((ipy <= ip) && (ip <= ipy + low)) { if (s) *s = '/'; log(priv->queueid, "match ip4:%s", p);