ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/svn/hopm/branches/1.1.x/src/scan.c
(Generate patch)

Comparing hopm/trunk/src/scan.c (file contents):
Revision 5284 by michael, Fri Jan 2 21:35:19 2015 UTC vs.
Revision 5311 by michael, Mon Jan 5 19:26:38 2015 UTC

# Line 33 | Line 33
33   #include <errno.h>
34   #include <fcntl.h>
35   #include <poll.h>
36 + #include <sys/socket.h>
37 + #include <netinet/in.h>
38 + #include <arpa/inet.h>
39  
40   #include "compat.h"
41   #include "config.h"
# Line 305 | Line 308 | scan_init(void)
308   void
309   scan_connect(char **user, char *msg)
310   {
311 <  struct bopm_sockaddr ip;
311 >  struct sockaddr_in ip;
312    node_t *p, *p2;
313    struct scan_struct *ss;
314    struct scanner_struct *scs;
# Line 323 | Line 326 | scan_connect(char **user, char *msg)
326    /* Check negcache before anything */
327    if (OptionsItem->negcache > 0)
328    {
329 <    if (inet_pton(AF_INET, user[3], &(ip.sa4.sin_addr)) <= 0)
329 >    if (inet_pton(AF_INET, user[3], &ip.sin_addr) <= 0)
330      {
331        log_printf("SCAN -> Invalid IPv4 address '%s'!", user[3]);
332        return;
333      }
334      else
335      {
336 <      if (check_neg_cache(ip.sa4.sin_addr.s_addr))
336 >      if (check_neg_cache(ip.sin_addr.s_addr))
337        {
338          if (OPT_DEBUG)
339            log_printf("SCAN -> %s!%s@%s (%s) is negatively cached. "

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines