comparison src/dnsbl.cpp @ 120:1d9e6c1b8872

uribl patch from Jeff Evans <jeffe@tricab.com>
author carl
date Sun, 12 Mar 2006 12:55:40 -0800
parents d9d2f8699621
children ecd97e7eb1f0
comparison
equal deleted inserted replaced
119:d9d2f8699621 120:1d9e6c1b8872
696 // Else, look up three level domain. 696 // Else, look up three level domain.
697 bool check_uribl(mlfiPriv &priv, char *hostname) ; 697 bool check_uribl(mlfiPriv &priv, char *hostname) ;
698 bool check_uribl(mlfiPriv &priv, char *hostname) { 698 bool check_uribl(mlfiPriv &priv, char *hostname) {
699 in_addr ip; 699 in_addr ip;
700 if (inet_aton(hostname, &ip)) { 700 if (inet_aton(hostname, &ip)) {
701 const u_char *src = (const u_char *)&ip.s_addr;
701 char adr[sizeof "255.255.255.255"]; 702 char adr[sizeof "255.255.255.255"];
702 adr[0] = '\0'; 703 snprintf(adr, sizeof(adr), "%u.%u.%u.%u", src[3], src[2], src[1], src[0]);
703 inet_ntop(AF_INET, (const u_char *)&ip, adr, sizeof(adr));
704 return (uriblookup(priv, adr, NULL)); 704 return (uriblookup(priv, adr, NULL));
705 } 705 }
706 706
707 char *top, *top2, *top3; 707 char *top, *top2, *top3;
708 top = strrchr(hostname, '.'); 708 top = strrchr(hostname, '.');