Changeset 6a3e5107c8ce5efbdacc6ba2b7a4364ab3ff1881

Show
Ignore:
Timestamp:
05/21/08 22:15:03 (11 years ago)
Author:
Theo Schlossnagle <jesus@omniti.com>
git-committer:
Theo Schlossnagle <jesus@omniti.com> 1211408103 +0000
git-parent:

[c9fd28ddcc5b6e5bcbe21baad2a60bb9ecce533a]

git-author:
Theo Schlossnagle <jesus@omniti.com> 1211408103 +0000
Message:

fixes #23

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • src/stratcon_datastore.c

    ra504323 r6a3e510  
    148148  /* Parse the log line, but only if we haven't already */ 
    149149  if(!d->nparams) { 
    150     struct sockaddr_in6 *rin6 = (struct sockaddr_in6 *)r; 
    151150    char raddr[128]; 
    152151    char *scp, *ecp; 
    153     if(inet_ntop(rin6->sin6_family, &rin6->sin6_addr, 
    154                  raddr, sizeof(raddr)) == NULL) 
    155       raddr[0] = '\0'; 
     152 
     153    /* setup our remote address */ 
     154    raddr[0] = '\0'; 
     155    switch(r->sa_family) { 
     156      case AF_INET: 
     157        inet_ntop(AF_INET, &(((struct sockaddr_in *)r)->sin_addr), 
     158                  raddr, sizeof(raddr)); 
     159        break; 
     160      case AF_INET6: 
     161        inet_ntop(AF_INET6, &(((struct sockaddr_in6 *)r)->sin6_addr), 
     162                  raddr, sizeof(raddr)); 
     163        break; 
     164    } 
    156165  
    157166    scp = d->data;