Changeset c39cd8e for irc.c


Ignore:
Timestamp:
2017-04-02T18:50:49Z (3 years ago)
Author:
Wilmer van der Gaast <wilmer@…>
Children:
df67b48
Parents:
262a82b
Message:

Add reverse_lookup() function which does a more proper (verified) DNS
reverse lookup. (Code copied from OpenSSH instead of redoing it
poorly.)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • irc.c

    r262a82b rc39cd8e  
    6868                myhost = g_strdup(global.conf->hostname);
    6969        } else if (getsockname(irc->fd, (struct sockaddr*) &sock, &socklen) == 0) {
    70                 char buf[NI_MAXHOST + 1];
    71 
    72                 if (getnameinfo((struct sockaddr *) &sock, socklen, buf,
    73                                 NI_MAXHOST, NULL, 0, 0) == 0) {
    74                         myhost = g_strdup(ipv6_unwrap(buf));
    75                 }
     70                myhost = reverse_lookup((struct sockaddr*) &sock, socklen);
    7671        }
    7772
    7873        if (getpeername(irc->fd, (struct sockaddr*) &sock, &socklen) == 0) {
    79                 char buf[NI_MAXHOST + 1];
    80 
    81                 if (getnameinfo((struct sockaddr *) &sock, socklen, buf,
    82                                 NI_MAXHOST, NULL, 0, 0) == 0) {
    83                         host = g_strdup(ipv6_unwrap(buf));
    84                 }
     74                host = reverse_lookup((struct sockaddr*) &sock, socklen);
    8575        }
    8676
Note: See TracChangeset for help on using the changeset viewer.