From f7de8573f5521263449fd80a2d5cdf3901b96087 Mon Sep 17 00:00:00 2001 From: John Denker Date: Sat, 24 Nov 2012 19:40:13 -0800 Subject: Now can check to see if hostnames map to observed IP --- tools/libskrewt.c | 93 ++++++++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 85 insertions(+), 8 deletions(-) (limited to 'tools/libskrewt.c') diff --git a/tools/libskrewt.c b/tools/libskrewt.c index 3c820f1..d93a9e1 100644 --- a/tools/libskrewt.c +++ b/tools/libskrewt.c @@ -214,12 +214,7 @@ int skrewt::dump_bigbuf(std::ostream& xout){ return 0; } -void check_name(name_tester& fqdn, const string ip) { - if (ip == "") { - cerr << "SPF: should never happen: email with no IP?" <ai_next){ + if (memcmp(res->ai_addr, ipresult->ai_addr, res->ai_addrlen) == 0) { + // match! + goto done; + } + } + // here if no match + fqdn.map2ip = fail; + return; +done: + fqdn.map2ip = pass; + return; +} + +void check_name_ip(name_tester& fqdn, const string ip) { + if (ip == "") { + cerr << "check_nane_ip: should never happen: email with no IP?" <