ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/svn/ircd-hybrid/trunk/src/auth.c
(Generate patch)

Comparing ircd-hybrid/trunk/src/auth.c (file contents):
Revision 4408 by michael, Wed Aug 6 21:19:38 2014 UTC vs.
Revision 4415 by michael, Thu Aug 7 14:09:36 2014 UTC

# Line 152 | Line 152 | auth_dns_callback(void *vptr, const stru
152    if (!EmptyString(name))
153    {
154      const struct sockaddr_in *v4, *v4dns;
155 #ifdef IPV6
155      const struct sockaddr_in6 *v6, *v6dns;
156  
157      if (auth->client->localClient->ip.ss.ss_family == AF_INET6)
# Line 168 | Line 167 | auth_dns_callback(void *vptr, const stru
167        }
168      }
169      else
171 #endif
170      {
171        v4 = (const struct sockaddr_in *)&auth->client->localClient->ip;
172        v4dns = (const struct sockaddr_in *)addr;
# Line 225 | Line 223 | start_auth_query(struct AuthRequest *aut
223   {
224    struct irc_ssaddr localaddr;
225    socklen_t locallen = sizeof(struct irc_ssaddr);
228 #ifdef IPV6
226    struct sockaddr_in6 *v6;
230 #else
231  struct sockaddr_in *v4;
232 #endif
227  
228    /* open a socket of the same type as the client socket */
229    if (comm_open(&auth->fd, auth->client->localClient->ip.ss.ss_family,
# Line 256 | Line 250 | start_auth_query(struct AuthRequest *aut
250    getsockname(auth->client->localClient->fd.fd, (struct sockaddr*)&localaddr,
251        &locallen);
252  
259 #ifdef IPV6
253    remove_ipv6_mapping(&localaddr);
254    v6 = (struct sockaddr_in6 *)&localaddr;
255    v6->sin6_port = htons(0);
263 #else
264  localaddr.ss_len = locallen;
265  v4 = (struct sockaddr_in *)&localaddr;
266  v4->sin_port = htons(0);
267 #endif
256    localaddr.ss_port = htons(0);
257  
258    comm_connect_tcp(&auth->fd, auth->client->sockhost, RFC1413_PORT,
# Line 363 | Line 351 | auth_connect_callback(fde_t *fd, int err
351    socklen_t ulen = sizeof(struct irc_ssaddr);
352    socklen_t tlen = sizeof(struct irc_ssaddr);
353    uint16_t uport, tport;
366 #ifdef IPV6
354    struct sockaddr_in6 *v6;
368 #else
369  struct sockaddr_in *v4;
370 #endif
355  
356    if (error != COMM_OK)
357    {
# Line 384 | Line 368 | auth_connect_callback(fde_t *fd, int err
368      return;
369    }
370  
387 #ifdef IPV6
371    v6 = (struct sockaddr_in6 *)&us;
372    uport = ntohs(v6->sin6_port);
373    v6 = (struct sockaddr_in6 *)&them;
374    tport = ntohs(v6->sin6_port);
375    remove_ipv6_mapping(&us);
376    remove_ipv6_mapping(&them);
394 #else
395  v4 = (struct sockaddr_in *)&us;
396  uport = ntohs(v4->sin_port);
397  v4 = (struct sockaddr_in *)&them;
398  tport = ntohs(v4->sin_port);
399  us.ss_len = ulen;
400  them.ss_len = tlen;
401 #endif
377  
378    snprintf(authbuf, sizeof(authbuf), "%u, %u\r\n", tport, uport);
379  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines