/[svn]/hopm/branches/1.0.x/src/negcache.c
ViewVC logotype

Diff of /hopm/branches/1.0.x/src/negcache.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 5311 by michael, Thu Jan 1 20:09:33 2015 UTC revision 5312 by michael, Mon Jan 5 19:27:13 2015 UTC
# Line 44  along with this program; if not, write t Line 44  along with this program; if not, write t
44  #include <stdlib.h>  #include <stdlib.h>
45  #include <sys/time.h>  #include <sys/time.h>
46  #include <time.h>  #include <time.h>
47    #include <sys/types.h>
48    #include <sys/socket.h>
49    #include <netinet/in.h>
50    #include <arpa/inet.h>
51    
52  #include "irc.h"  #include "irc.h"
53  #include "negcache.h"  #include "negcache.h"
# Line 195  struct cnode *check_neg_cache(const unsi Line 199  struct cnode *check_neg_cache(const unsi
199   */   */
200  void negcache_insert(const char *ipstr)  void negcache_insert(const char *ipstr)
201  {  {
202     struct bopm_sockaddr ip;     struct sockaddr_in ip;
203     struct cnode *n;     struct cnode *n;
204    
205     if (inet_pton(AF_INET, ipstr, &(ip.sa4.sin_addr)) <= 0)     if (inet_pton(AF_INET, ipstr, &ip.sin_addr) <= 0)
206     {     {
207        log_printf("NEGCACHE -> Invalid IPv4 address '%s'", ipstr);        log_printf("NEGCACHE -> Invalid IPv4 address '%s'", ipstr);
208        return;        return;
209     }     }
210    
211     n = nc_insert(nc_head, ip.sa4.sin_addr.s_addr);     n = nc_insert(nc_head, ip.sin_addr.s_addr);
212    
213     if (n)     if (n)
214        n->seen = time(NULL);        n->seen = time(NULL);

Legend:
Removed from v.5311  
changed lines
  Added in v.5312

svnadmin@ircd-hybrid.org
ViewVC Help
Powered by ViewVC 1.1.28