/[svn]/hopm/trunk/src/libopm/src/libopm.c
ViewVC logotype

Diff of /hopm/trunk/src/libopm/src/libopm.c

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

revision 8127 by michael, Thu Jul 2 09:05:52 2015 UTC revision 8128 by michael, Mon Apr 3 17:49:23 2017 UTC
# Line 403  opm_scan(OPM_T *scanner, OPM_REMOTE_T *r Line 403  opm_scan(OPM_T *scanner, OPM_REMOTE_T *r
403  {  {
404    OPM_SCAN_T *scan;  /* New scan for OPM_T */    OPM_SCAN_T *scan;  /* New scan for OPM_T */
405    OPM_NODE_T *node;  /* Node we'll add scan to when we link it to scans */    OPM_NODE_T *node;  /* Node we'll add scan to when we link it to scans */
406      opm_inaddr in;
407    
408    if (LIST_SIZE(scanner->protocols) == 0 &&    if (LIST_SIZE(scanner->protocols) == 0 &&
409        LIST_SIZE(remote->protocols) == 0)        LIST_SIZE(remote->protocols) == 0)
410      return OPM_ERR_NOPROTOCOLS;      return OPM_ERR_NOPROTOCOLS;
411    
412    scan = libopm_scan_create(scanner, remote);    /*
413       * XXX: libopm ideally shouldn't see an IP address in string representation.
414    if (inet_pton(AF_INET, remote->ip, &(scan->addr.sa4.sin_addr)) <= 0)     * Could have been stuffed into the _OPM_REMOTE struct by the caller that
415    {     * already does getaddrinfo() anyway.
416      libopm_scan_free(scan);     */
417      if (inet_pton(AF_INET, remote->ip, &in.in4) <= 0)
418      return OPM_ERR_BADADDR;      return OPM_ERR_BADADDR;
419    }  
420      scan = libopm_scan_create(scanner, remote);
421      memcpy(&scan->addr.sa4.sin_addr, &in.in4, sizeof(scan->addr.sa4.sin_addr));
422    
423    node = libopm_node_create(scan);    node = libopm_node_create(scan);
424    libopm_list_add(scanner->queue, node);    libopm_list_add(scanner->queue, node);

Legend:
Removed from v.8127  
changed lines
  Added in v.8128

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