Replacing legacy IPV6 define with RB_IPV6 (which is included in libratbox's config.h).
This commit is contained in:
parent
8325120565
commit
2c2e0aa96e
45
configure.ac
45
configure.ac
|
@ -317,50 +317,6 @@ AC_CHECK_TYPE(socklen_t, ,
|
||||||
AC_ARG_ENABLE(ipv6,
|
AC_ARG_ENABLE(ipv6,
|
||||||
AC_HELP_STRING([--enable-ipv6],[Enable IPv6 support]),[ipv6=$enableval],[ipv6=no])
|
AC_HELP_STRING([--enable-ipv6],[Enable IPv6 support]),[ipv6=$enableval],[ipv6=no])
|
||||||
|
|
||||||
if test $ipv6 != yes; then
|
|
||||||
have_v6="no"
|
|
||||||
else
|
|
||||||
AC_MSG_CHECKING([for core IPv6 support])
|
|
||||||
|
|
||||||
AC_COMPILE_IFELSE(
|
|
||||||
[AC_LANG_PROGRAM(
|
|
||||||
[[#define IN_AUTOCONF
|
|
||||||
#include <sys/types.h>
|
|
||||||
#include <sys/socket.h>
|
|
||||||
#include <netinet/in.h>]],
|
|
||||||
[[struct sockaddr_in6 s;
|
|
||||||
s.sin6_family = 0;]]
|
|
||||||
)],
|
|
||||||
[
|
|
||||||
if test "$CYGWIN" = "yes"; then
|
|
||||||
AC_MSG_RESULT([no, Cygwin's IPv6 is incomplete])
|
|
||||||
have_v6=no
|
|
||||||
else
|
|
||||||
have_v6=yes
|
|
||||||
AC_DEFINE(IPV6, 1, [Define if IPv6 support is present and available.])
|
|
||||||
AC_MSG_RESULT(yes)
|
|
||||||
AC_MSG_CHECKING([for struct in6addr_any])
|
|
||||||
AC_COMPILE_IFELSE(
|
|
||||||
[AC_LANG_PROGRAM(
|
|
||||||
[[#define IN_AUTOCONF
|
|
||||||
#include <sys/types.h>
|
|
||||||
#include <sys/socket.h>
|
|
||||||
#include <netinet/in.h>]],
|
|
||||||
[[struct in6_addr a = in6addr_any;]]
|
|
||||||
)],
|
|
||||||
[AC_MSG_RESULT(yes)],
|
|
||||||
[
|
|
||||||
AC_MSG_RESULT(no)
|
|
||||||
AC_DEFINE(NO_IN6ADDR_ANY, 1, [Define to 1 if your system has no in6addr_any.])
|
|
||||||
inet_misc=1
|
|
||||||
]
|
|
||||||
)
|
|
||||||
fi
|
|
||||||
],
|
|
||||||
[AC_MSG_RESULT(no)
|
|
||||||
have_v6="no"])
|
|
||||||
fi
|
|
||||||
|
|
||||||
AC_SEARCH_LIBS(crypt, [crypt descrypt],,)
|
AC_SEARCH_LIBS(crypt, [crypt descrypt],,)
|
||||||
|
|
||||||
CRYPT_LIB=$ac_cv_search_crypt
|
CRYPT_LIB=$ac_cv_search_crypt
|
||||||
|
@ -1267,7 +1223,6 @@ Configuration:
|
||||||
|
|
||||||
Ziplinks : $zlib
|
Ziplinks : $zlib
|
||||||
OpenSSL : $openssl
|
OpenSSL : $openssl
|
||||||
IPv6 support : $have_v6
|
|
||||||
Socket Engine : $SELECT_TYPE
|
Socket Engine : $SELECT_TYPE
|
||||||
Small network : $small_net
|
Small network : $small_net
|
||||||
Block allocator : $balloc
|
Block allocator : $balloc
|
||||||
|
|
|
@ -139,20 +139,20 @@
|
||||||
#define CLIENT_PARSE_ERROR -1
|
#define CLIENT_PARSE_ERROR -1
|
||||||
#define CLIENT_OK 1
|
#define CLIENT_OK 1
|
||||||
|
|
||||||
#ifdef IPV6
|
#ifdef RB_IPV6
|
||||||
#ifndef AF_INET6
|
#ifndef AF_INET6
|
||||||
#error "AF_INET6 not defined"
|
#error "AF_INET6 not defined"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
#else /* #ifdef IPV6 */
|
#else /* #ifdef RB_IPV6 */
|
||||||
|
|
||||||
#ifndef AF_INET6
|
#ifndef AF_INET6
|
||||||
#define AF_INET6 AF_MAX /* Dummy AF_INET6 declaration */
|
#define AF_INET6 AF_MAX /* Dummy AF_INET6 declaration */
|
||||||
#endif
|
#endif
|
||||||
#endif /* #ifdef IPV6 */
|
#endif /* #ifdef RB_IPV6 */
|
||||||
|
|
||||||
#ifdef IPV6
|
#ifdef RB_IPV6
|
||||||
#define PATRICIA_BITS 128
|
#define PATRICIA_BITS 128
|
||||||
#else
|
#else
|
||||||
#define PATRICIA_BITS 32
|
#define PATRICIA_BITS 32
|
||||||
|
|
|
@ -47,7 +47,7 @@ struct AuthRequest
|
||||||
unsigned int flags; /* current state of request */
|
unsigned int flags; /* current state of request */
|
||||||
rb_fde_t *F; /* file descriptor for auth queries */
|
rb_fde_t *F; /* file descriptor for auth queries */
|
||||||
time_t timeout; /* time when query expires */
|
time_t timeout; /* time when query expires */
|
||||||
#ifdef IPV6
|
#ifdef RB_IPV6
|
||||||
int ip6_int;
|
int ip6_int;
|
||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
|
|
|
@ -91,7 +91,7 @@ mo_etrace(struct Client *client_p, struct Client *source_p, int parc, const char
|
||||||
{
|
{
|
||||||
if(!irccmp(parv[1], "-full"))
|
if(!irccmp(parv[1], "-full"))
|
||||||
do_etrace_full(source_p);
|
do_etrace_full(source_p);
|
||||||
#ifdef IPV6
|
#ifdef RB_IPV6
|
||||||
else if(!irccmp(parv[1], "-v6"))
|
else if(!irccmp(parv[1], "-v6"))
|
||||||
do_etrace(source_p, 0, 1);
|
do_etrace(source_p, 0, 1);
|
||||||
else if(!irccmp(parv[1], "-v4"))
|
else if(!irccmp(parv[1], "-v4"))
|
||||||
|
@ -151,7 +151,7 @@ do_etrace(struct Client *source_p, int ipv4, int ipv6)
|
||||||
{
|
{
|
||||||
target_p = ptr->data;
|
target_p = ptr->data;
|
||||||
|
|
||||||
#ifdef IPV6
|
#ifdef RB_IPV6
|
||||||
if((!ipv4 && target_p->localClient->ip.ss_family == AF_INET) ||
|
if((!ipv4 && target_p->localClient->ip.ss_family == AF_INET) ||
|
||||||
(!ipv6 && target_p->localClient->ip.ss_family == AF_INET6))
|
(!ipv6 && target_p->localClient->ip.ss_family == AF_INET6))
|
||||||
continue;
|
continue;
|
||||||
|
|
|
@ -701,7 +701,7 @@ already_placed_kline(struct Client *source_p, const char *luser, const char *lho
|
||||||
bits = 0;
|
bits = 0;
|
||||||
if((t = parse_netmask(lhost, (struct sockaddr *)&iphost, &bits)) != HM_HOST)
|
if((t = parse_netmask(lhost, (struct sockaddr *)&iphost, &bits)) != HM_HOST)
|
||||||
{
|
{
|
||||||
#ifdef IPV6
|
#ifdef RB_IPV6
|
||||||
if(t == HM_IPV6)
|
if(t == HM_IPV6)
|
||||||
t = AF_INET6;
|
t = AF_INET6;
|
||||||
else
|
else
|
||||||
|
|
|
@ -119,7 +119,7 @@ mo_testline(struct Client *client_p, struct Client *source_p, int parc, const ch
|
||||||
/* parses as an IP, check for a dline */
|
/* parses as an IP, check for a dline */
|
||||||
if((type = parse_netmask(host, (struct sockaddr *)&ip, &host_mask)) != HM_HOST)
|
if((type = parse_netmask(host, (struct sockaddr *)&ip, &host_mask)) != HM_HOST)
|
||||||
{
|
{
|
||||||
#ifdef IPV6
|
#ifdef RB_IPV6
|
||||||
if(type == HM_IPV6)
|
if(type == HM_IPV6)
|
||||||
aconf = find_dline((struct sockaddr *)&ip, AF_INET6);
|
aconf = find_dline((struct sockaddr *)&ip, AF_INET6);
|
||||||
else
|
else
|
||||||
|
@ -153,7 +153,7 @@ mo_testline(struct Client *client_p, struct Client *source_p, int parc, const ch
|
||||||
if((aconf = find_address_conf(host, NULL, user_trunc, notildeuser_trunc,
|
if((aconf = find_address_conf(host, NULL, user_trunc, notildeuser_trunc,
|
||||||
(type != HM_HOST) ? (struct sockaddr *)&ip : NULL,
|
(type != HM_HOST) ? (struct sockaddr *)&ip : NULL,
|
||||||
(type != HM_HOST) ? (
|
(type != HM_HOST) ? (
|
||||||
#ifdef IPV6
|
#ifdef RB_IPV6
|
||||||
(type == HM_IPV6) ? AF_INET6 :
|
(type == HM_IPV6) ? AF_INET6 :
|
||||||
#endif
|
#endif
|
||||||
AF_INET) : 0)))
|
AF_INET) : 0)))
|
||||||
|
|
|
@ -149,7 +149,7 @@ confopts(struct Client *source_p)
|
||||||
*p++ = 'Z';
|
*p++ = 'Z';
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef IPV6
|
#ifdef RB_IPV6
|
||||||
*p++ = '6';
|
*p++ = '6';
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -33,7 +33,7 @@
|
||||||
#include "send.h"
|
#include "send.h"
|
||||||
#include "irc_string.h"
|
#include "irc_string.h"
|
||||||
|
|
||||||
#ifdef IPV6
|
#ifdef RB_IPV6
|
||||||
static unsigned long hash_ipv6(struct sockaddr *, int);
|
static unsigned long hash_ipv6(struct sockaddr *, int);
|
||||||
#endif
|
#endif
|
||||||
static unsigned long hash_ipv4(struct sockaddr *, int);
|
static unsigned long hash_ipv4(struct sockaddr *, int);
|
||||||
|
@ -63,7 +63,7 @@ parse_netmask(const char *text, struct sockaddr *naddr, int *nb)
|
||||||
else
|
else
|
||||||
addr = (struct rb_sockaddr_storage *)naddr;
|
addr = (struct rb_sockaddr_storage *)naddr;
|
||||||
|
|
||||||
#ifdef IPV6
|
#ifdef RB_IPV6
|
||||||
if(strchr(ip, ':'))
|
if(strchr(ip, ':'))
|
||||||
{
|
{
|
||||||
if((ptr = strchr(ip, '/')))
|
if((ptr = strchr(ip, '/')))
|
||||||
|
@ -133,7 +133,7 @@ hash_ipv4(struct sockaddr *saddr, int bits)
|
||||||
* Output: A hash value of the IP address.
|
* Output: A hash value of the IP address.
|
||||||
* Side effects: None
|
* Side effects: None
|
||||||
*/
|
*/
|
||||||
#ifdef IPV6
|
#ifdef RB_IPV6
|
||||||
static unsigned long
|
static unsigned long
|
||||||
hash_ipv6(struct sockaddr *saddr, int bits)
|
hash_ipv6(struct sockaddr *saddr, int bits)
|
||||||
{
|
{
|
||||||
|
@ -221,7 +221,7 @@ find_conf_by_address(const char *name, const char *sockhost,
|
||||||
if(addr)
|
if(addr)
|
||||||
{
|
{
|
||||||
/* Check for IPV6 matches... */
|
/* Check for IPV6 matches... */
|
||||||
#ifdef IPV6
|
#ifdef RB_IPV6
|
||||||
if(fam == AF_INET6)
|
if(fam == AF_INET6)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
@ -448,7 +448,7 @@ find_exact_conf_by_address(const char *address, int type, const char *username)
|
||||||
address = "/NOMATCH!/";
|
address = "/NOMATCH!/";
|
||||||
arec = rb_malloc(sizeof(struct AddressRec));
|
arec = rb_malloc(sizeof(struct AddressRec));
|
||||||
masktype = parse_netmask(address, (struct sockaddr *)&addr, &bits);
|
masktype = parse_netmask(address, (struct sockaddr *)&addr, &bits);
|
||||||
#ifdef IPV6
|
#ifdef RB_IPV6
|
||||||
if(masktype == HM_IPV6)
|
if(masktype == HM_IPV6)
|
||||||
{
|
{
|
||||||
/* We have to do this, since we do not re-hash for every bit -A1kmm. */
|
/* We have to do this, since we do not re-hash for every bit -A1kmm. */
|
||||||
|
@ -507,7 +507,7 @@ add_conf_by_address(const char *address, int type, const char *username, struct
|
||||||
masktype = parse_netmask(address, (struct sockaddr *)&arec->Mask.ipa.addr, &bits);
|
masktype = parse_netmask(address, (struct sockaddr *)&arec->Mask.ipa.addr, &bits);
|
||||||
arec->Mask.ipa.bits = bits;
|
arec->Mask.ipa.bits = bits;
|
||||||
arec->masktype = masktype;
|
arec->masktype = masktype;
|
||||||
#ifdef IPV6
|
#ifdef RB_IPV6
|
||||||
if(masktype == HM_IPV6)
|
if(masktype == HM_IPV6)
|
||||||
{
|
{
|
||||||
/* We have to do this, since we do not re-hash for every bit -A1kmm. */
|
/* We have to do this, since we do not re-hash for every bit -A1kmm. */
|
||||||
|
@ -550,7 +550,7 @@ delete_one_address_conf(const char *address, struct ConfItem *aconf)
|
||||||
struct AddressRec *arec, *arecl = NULL;
|
struct AddressRec *arec, *arecl = NULL;
|
||||||
struct rb_sockaddr_storage addr;
|
struct rb_sockaddr_storage addr;
|
||||||
masktype = parse_netmask(address, (struct sockaddr *)&addr, &bits);
|
masktype = parse_netmask(address, (struct sockaddr *)&addr, &bits);
|
||||||
#ifdef IPV6
|
#ifdef RB_IPV6
|
||||||
if(masktype == HM_IPV6)
|
if(masktype == HM_IPV6)
|
||||||
{
|
{
|
||||||
/* We have to do this, since we do not re-hash for every bit -A1kmm. */
|
/* We have to do this, since we do not re-hash for every bit -A1kmm. */
|
||||||
|
|
|
@ -34,7 +34,7 @@
|
||||||
#define INADDRSZ 4
|
#define INADDRSZ 4
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef IPV6
|
#ifdef RB_IPV6
|
||||||
#ifndef IN6ADDRSZ
|
#ifndef IN6ADDRSZ
|
||||||
#define IN6ADDRSZ 16
|
#define IN6ADDRSZ 16
|
||||||
#endif
|
#endif
|
||||||
|
@ -398,7 +398,7 @@ inetntoa(const char *in)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static const char *inet_ntop4(const u_char * src, char *dst, unsigned int size);
|
static const char *inet_ntop4(const u_char * src, char *dst, unsigned int size);
|
||||||
#ifdef IPV6
|
#ifdef RB_IPV6
|
||||||
static const char *inet_ntop6(const u_char * src, char *dst, unsigned int size);
|
static const char *inet_ntop6(const u_char * src, char *dst, unsigned int size);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -427,7 +427,7 @@ inet_ntop4(const unsigned char *src, char *dst, unsigned int size)
|
||||||
* author:
|
* author:
|
||||||
* Paul Vixie, 1996.
|
* Paul Vixie, 1996.
|
||||||
*/
|
*/
|
||||||
#ifdef IPV6
|
#ifdef RB_IPV6
|
||||||
static const char *
|
static const char *
|
||||||
inet_ntop6(const unsigned char *src, char *dst, unsigned int size)
|
inet_ntop6(const unsigned char *src, char *dst, unsigned int size)
|
||||||
{
|
{
|
||||||
|
@ -542,7 +542,7 @@ inetpton_sock(const char *src, struct sockaddr *dst)
|
||||||
SET_SS_LEN((struct rb_sockaddr_storage *) dst, sizeof(struct sockaddr_in));
|
SET_SS_LEN((struct rb_sockaddr_storage *) dst, sizeof(struct sockaddr_in));
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
#ifdef IPV6
|
#ifdef RB_IPV6
|
||||||
else if(inetpton(AF_INET6, src, &((struct sockaddr_in6 *) dst)->sin6_addr))
|
else if(inetpton(AF_INET6, src, &((struct sockaddr_in6 *) dst)->sin6_addr))
|
||||||
{
|
{
|
||||||
((struct sockaddr_in6 *) dst)->sin6_port = 0;
|
((struct sockaddr_in6 *) dst)->sin6_port = 0;
|
||||||
|
@ -562,7 +562,7 @@ inetntop_sock(struct sockaddr *src, char *dst, unsigned int size)
|
||||||
case AF_INET:
|
case AF_INET:
|
||||||
return (inetntop(AF_INET, &((struct sockaddr_in *) src)->sin_addr, dst, size));
|
return (inetntop(AF_INET, &((struct sockaddr_in *) src)->sin_addr, dst, size));
|
||||||
break;
|
break;
|
||||||
#ifdef IPV6
|
#ifdef RB_IPV6
|
||||||
case AF_INET6:
|
case AF_INET6:
|
||||||
return (inetntop(AF_INET6, &((struct sockaddr_in6 *) src)->sin6_addr, dst, size));
|
return (inetntop(AF_INET6, &((struct sockaddr_in6 *) src)->sin6_addr, dst, size));
|
||||||
break;
|
break;
|
||||||
|
@ -588,7 +588,7 @@ inetntop(int af, const void *src, char *dst, unsigned int size)
|
||||||
{
|
{
|
||||||
case AF_INET:
|
case AF_INET:
|
||||||
return (inet_ntop4(src, dst, size));
|
return (inet_ntop4(src, dst, size));
|
||||||
#ifdef IPV6
|
#ifdef RB_IPV6
|
||||||
case AF_INET6:
|
case AF_INET6:
|
||||||
if(IN6_IS_ADDR_V4MAPPED((const struct in6_addr *) src) ||
|
if(IN6_IS_ADDR_V4MAPPED((const struct in6_addr *) src) ||
|
||||||
IN6_IS_ADDR_V4COMPAT((const struct in6_addr *) src))
|
IN6_IS_ADDR_V4COMPAT((const struct in6_addr *) src))
|
||||||
|
@ -677,7 +677,7 @@ inet_pton4(src, dst)
|
||||||
return (1);
|
return (1);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef IPV6
|
#ifdef RB_IPV6
|
||||||
/* int
|
/* int
|
||||||
* inet_pton6(src, dst)
|
* inet_pton6(src, dst)
|
||||||
* convert presentation level address to network order binary form.
|
* convert presentation level address to network order binary form.
|
||||||
|
@ -803,7 +803,7 @@ inetpton(af, src, dst)
|
||||||
{
|
{
|
||||||
case AF_INET:
|
case AF_INET:
|
||||||
return (inet_pton4(src, dst));
|
return (inet_pton4(src, dst));
|
||||||
#ifdef IPV6
|
#ifdef RB_IPV6
|
||||||
case AF_INET6:
|
case AF_INET6:
|
||||||
/* Somebody might have passed as an IPv4 address this is sick but it works */
|
/* Somebody might have passed as an IPv4 address this is sick but it works */
|
||||||
if(inet_pton4(src, dst))
|
if(inet_pton4(src, dst))
|
||||||
|
|
|
@ -307,7 +307,7 @@ int comp_with_mask_sock(struct sockaddr *addr, struct sockaddr *dest, u_int mask
|
||||||
iaddr = &((struct sockaddr_in *)addr)->sin_addr;
|
iaddr = &((struct sockaddr_in *)addr)->sin_addr;
|
||||||
idest = &((struct sockaddr_in *)dest)->sin_addr;
|
idest = &((struct sockaddr_in *)dest)->sin_addr;
|
||||||
}
|
}
|
||||||
#ifdef IPV6
|
#ifdef RB_IPV6
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
iaddr = &((struct sockaddr_in6 *)addr)->sin6_addr;
|
iaddr = &((struct sockaddr_in6 *)addr)->sin6_addr;
|
||||||
|
@ -346,7 +346,7 @@ int match_ips(const char *s1, const char *s2)
|
||||||
if (cidrlen == 0)
|
if (cidrlen == 0)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
#ifdef IPV6
|
#ifdef RB_IPV6
|
||||||
if (strchr(mask, ':') && strchr(address, ':'))
|
if (strchr(mask, ':') && strchr(address, ':'))
|
||||||
{
|
{
|
||||||
aftype = AF_INET6;
|
aftype = AF_INET6;
|
||||||
|
@ -414,7 +414,7 @@ int match_cidr(const char *s1, const char *s2)
|
||||||
if (cidrlen == 0)
|
if (cidrlen == 0)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
#ifdef IPV6
|
#ifdef RB_IPV6
|
||||||
if (strchr(ip, ':') && strchr(ipmask, ':'))
|
if (strchr(ip, ':') && strchr(ipmask, ':'))
|
||||||
{
|
{
|
||||||
aftype = AF_INET6;
|
aftype = AF_INET6;
|
||||||
|
|
|
@ -241,7 +241,7 @@ conf_set_serverinfo_vhost(void *data)
|
||||||
static void
|
static void
|
||||||
conf_set_serverinfo_vhost6(void *data)
|
conf_set_serverinfo_vhost6(void *data)
|
||||||
{
|
{
|
||||||
#ifdef IPV6
|
#ifdef RB_IPV6
|
||||||
if(inetpton(AF_INET6, (char *) data, &ServerInfo.ip6.sin6_addr) <= 0)
|
if(inetpton(AF_INET6, (char *) data, &ServerInfo.ip6.sin6_addr) <= 0)
|
||||||
{
|
{
|
||||||
conf_report_error("Invalid netmask for server IPv6 vhost (%s)", (char *) data);
|
conf_report_error("Invalid netmask for server IPv6 vhost (%s)", (char *) data);
|
||||||
|
@ -670,7 +670,7 @@ conf_set_class_ping_time(void *data)
|
||||||
static void
|
static void
|
||||||
conf_set_class_cidr_bitlen(void *data)
|
conf_set_class_cidr_bitlen(void *data)
|
||||||
{
|
{
|
||||||
#ifdef IPV6
|
#ifdef RB_IPV6
|
||||||
unsigned int maxsize = 128;
|
unsigned int maxsize = 128;
|
||||||
#else
|
#else
|
||||||
unsigned int maxsize = 32;
|
unsigned int maxsize = 32;
|
||||||
|
@ -759,14 +759,14 @@ conf_set_listen_port(void *data)
|
||||||
if(listener_address == NULL)
|
if(listener_address == NULL)
|
||||||
{
|
{
|
||||||
add_listener(args->v.number, listener_address, AF_INET);
|
add_listener(args->v.number, listener_address, AF_INET);
|
||||||
#ifdef IPV6
|
#ifdef RB_IPV6
|
||||||
add_listener(args->v.number, listener_address, AF_INET6);
|
add_listener(args->v.number, listener_address, AF_INET6);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
int family;
|
int family;
|
||||||
#ifdef IPV6
|
#ifdef RB_IPV6
|
||||||
if(strchr(listener_address, ':') != NULL)
|
if(strchr(listener_address, ':') != NULL)
|
||||||
family = AF_INET6;
|
family = AF_INET6;
|
||||||
else
|
else
|
||||||
|
@ -1221,7 +1221,7 @@ conf_set_connect_aftype(void *data)
|
||||||
|
|
||||||
if(strcasecmp(aft, "ipv4") == 0)
|
if(strcasecmp(aft, "ipv4") == 0)
|
||||||
yy_server->aftype = AF_INET;
|
yy_server->aftype = AF_INET;
|
||||||
#ifdef IPV6
|
#ifdef RB_IPV6
|
||||||
else if(strcasecmp(aft, "ipv6") == 0)
|
else if(strcasecmp(aft, "ipv6") == 0)
|
||||||
yy_server->aftype = AF_INET6;
|
yy_server->aftype = AF_INET6;
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -142,7 +142,7 @@ add_reject(struct Client *client_p, const char *mask1, const char *mask2)
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
int bitlen = 32;
|
int bitlen = 32;
|
||||||
#ifdef IPV6
|
#ifdef RB_IPV6
|
||||||
if(client_p->localClient->ip.ss_family == AF_INET6)
|
if(client_p->localClient->ip.ss_family == AF_INET6)
|
||||||
bitlen = 128;
|
bitlen = 128;
|
||||||
#endif
|
#endif
|
||||||
|
@ -262,7 +262,7 @@ add_unknown_ip(struct Client *client_p)
|
||||||
if((pnode = rb_match_ip(unknown_tree, (struct sockaddr *)&client_p->localClient->ip)) == NULL)
|
if((pnode = rb_match_ip(unknown_tree, (struct sockaddr *)&client_p->localClient->ip)) == NULL)
|
||||||
{
|
{
|
||||||
int bitlen = 32;
|
int bitlen = 32;
|
||||||
#ifdef IPV6
|
#ifdef RB_IPV6
|
||||||
if(client_p->localClient->ip.ss_family == AF_INET6)
|
if(client_p->localClient->ip.ss_family == AF_INET6)
|
||||||
bitlen = 128;
|
bitlen = 128;
|
||||||
#endif
|
#endif
|
||||||
|
|
16
src/res.c
16
src/res.c
|
@ -118,7 +118,7 @@ extern char irc_domain[HOSTLEN + 1];
|
||||||
*/
|
*/
|
||||||
static int res_ourserver(const struct rb_sockaddr_storage *inp)
|
static int res_ourserver(const struct rb_sockaddr_storage *inp)
|
||||||
{
|
{
|
||||||
#ifdef IPV6
|
#ifdef RB_IPV6
|
||||||
struct sockaddr_in6 *v6;
|
struct sockaddr_in6 *v6;
|
||||||
struct sockaddr_in6 *v6in = (struct sockaddr_in6 *)inp;
|
struct sockaddr_in6 *v6in = (struct sockaddr_in6 *)inp;
|
||||||
#endif
|
#endif
|
||||||
|
@ -129,7 +129,7 @@ static int res_ourserver(const struct rb_sockaddr_storage *inp)
|
||||||
for (ns = 0; ns < irc_nscount; ns++)
|
for (ns = 0; ns < irc_nscount; ns++)
|
||||||
{
|
{
|
||||||
const struct rb_sockaddr_storage *srv = &irc_nsaddr_list[ns];
|
const struct rb_sockaddr_storage *srv = &irc_nsaddr_list[ns];
|
||||||
#ifdef IPV6
|
#ifdef RB_IPV6
|
||||||
v6 = (struct sockaddr_in6 *)srv;
|
v6 = (struct sockaddr_in6 *)srv;
|
||||||
#endif
|
#endif
|
||||||
v4 = (struct sockaddr_in *)srv;
|
v4 = (struct sockaddr_in *)srv;
|
||||||
|
@ -139,7 +139,7 @@ static int res_ourserver(const struct rb_sockaddr_storage *inp)
|
||||||
*/
|
*/
|
||||||
switch (srv->ss_family)
|
switch (srv->ss_family)
|
||||||
{
|
{
|
||||||
#ifdef IPV6
|
#ifdef RB_IPV6
|
||||||
case AF_INET6:
|
case AF_INET6:
|
||||||
if (srv->ss_family == inp->ss_family)
|
if (srv->ss_family == inp->ss_family)
|
||||||
if (v6->sin6_port == v6in->sin6_port)
|
if (v6->sin6_port == v6in->sin6_port)
|
||||||
|
@ -446,7 +446,7 @@ static void do_query_number(struct DNSQuery *query, const struct rb_sockaddr_sto
|
||||||
rb_sprintf(request->queryname, "%u.%u.%u.%u.in-addr.arpa", (unsigned int)(cp[3]),
|
rb_sprintf(request->queryname, "%u.%u.%u.%u.in-addr.arpa", (unsigned int)(cp[3]),
|
||||||
(unsigned int)(cp[2]), (unsigned int)(cp[1]), (unsigned int)(cp[0]));
|
(unsigned int)(cp[2]), (unsigned int)(cp[1]), (unsigned int)(cp[0]));
|
||||||
}
|
}
|
||||||
#ifdef IPV6
|
#ifdef RB_IPV6
|
||||||
else if (addr->ss_family == AF_INET6)
|
else if (addr->ss_family == AF_INET6)
|
||||||
{
|
{
|
||||||
struct sockaddr_in6 *v6 = (struct sockaddr_in6 *)addr;
|
struct sockaddr_in6 *v6 = (struct sockaddr_in6 *)addr;
|
||||||
|
@ -532,7 +532,7 @@ static void resend_query(struct reslist *request)
|
||||||
do_query_number(NULL, &request->addr, request);
|
do_query_number(NULL, &request->addr, request);
|
||||||
break;
|
break;
|
||||||
case T_A:
|
case T_A:
|
||||||
#ifdef IPV6
|
#ifdef RB_IPV6
|
||||||
case T_AAAA:
|
case T_AAAA:
|
||||||
#endif
|
#endif
|
||||||
do_query_name(NULL, request->name, request, request->type);
|
do_query_name(NULL, request->name, request, request->type);
|
||||||
|
@ -577,7 +577,7 @@ static int proc_answer(struct reslist *request, HEADER * header, char *buf, char
|
||||||
int n; /* temp count */
|
int n; /* temp count */
|
||||||
int rd_length;
|
int rd_length;
|
||||||
struct sockaddr_in *v4; /* conversion */
|
struct sockaddr_in *v4; /* conversion */
|
||||||
#ifdef IPV6
|
#ifdef RB_IPV6
|
||||||
struct sockaddr_in6 *v6;
|
struct sockaddr_in6 *v6;
|
||||||
#endif
|
#endif
|
||||||
current = (unsigned char *)buf + sizeof(HEADER);
|
current = (unsigned char *)buf + sizeof(HEADER);
|
||||||
|
@ -658,7 +658,7 @@ static int proc_answer(struct reslist *request, HEADER * header, char *buf, char
|
||||||
memcpy(&v4->sin_addr, current, sizeof(struct in_addr));
|
memcpy(&v4->sin_addr, current, sizeof(struct in_addr));
|
||||||
return (1);
|
return (1);
|
||||||
break;
|
break;
|
||||||
#ifdef IPV6
|
#ifdef RB_IPV6
|
||||||
case T_AAAA:
|
case T_AAAA:
|
||||||
if (request->type != T_AAAA)
|
if (request->type != T_AAAA)
|
||||||
return (0);
|
return (0);
|
||||||
|
@ -818,7 +818,7 @@ static void res_readreply(rb_fde_t *F, void *data)
|
||||||
* ip#.
|
* ip#.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
#ifdef IPV6
|
#ifdef RB_IPV6
|
||||||
if (request->addr.ss_family == AF_INET6)
|
if (request->addr.ss_family == AF_INET6)
|
||||||
gethost_byname_type(request->name, request->query, T_AAAA);
|
gethost_byname_type(request->name, request->query, T_AAAA);
|
||||||
else
|
else
|
||||||
|
|
|
@ -199,7 +199,7 @@ auth_dns_callback(void *vptr, struct DNSReply *reply)
|
||||||
good = 0;
|
good = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#ifdef IPV6
|
#ifdef RB_IPV6
|
||||||
else if(auth->client->localClient->ip.ss_family == AF_INET6)
|
else if(auth->client->localClient->ip.ss_family == AF_INET6)
|
||||||
{
|
{
|
||||||
struct sockaddr_in6 *ip, *ip_fwd;
|
struct sockaddr_in6 *ip, *ip_fwd;
|
||||||
|
@ -304,7 +304,7 @@ start_auth_query(struct AuthRequest *auth)
|
||||||
(struct sockaddr *) &localaddr, &locallen);
|
(struct sockaddr *) &localaddr, &locallen);
|
||||||
|
|
||||||
/* XXX mangle_mapped_sockaddr((struct sockaddr *)&localaddr); */
|
/* XXX mangle_mapped_sockaddr((struct sockaddr *)&localaddr); */
|
||||||
#ifdef IPV6
|
#ifdef RB_IPV6
|
||||||
if(localaddr.ss_family == AF_INET6)
|
if(localaddr.ss_family == AF_INET6)
|
||||||
{
|
{
|
||||||
((struct sockaddr_in6 *)&localaddr)->sin6_port = 0;
|
((struct sockaddr_in6 *)&localaddr)->sin6_port = 0;
|
||||||
|
@ -313,7 +313,7 @@ start_auth_query(struct AuthRequest *auth)
|
||||||
((struct sockaddr_in *)&localaddr)->sin_port = 0;
|
((struct sockaddr_in *)&localaddr)->sin_port = 0;
|
||||||
|
|
||||||
destaddr = auth->client->localClient->ip;
|
destaddr = auth->client->localClient->ip;
|
||||||
#ifdef IPV6
|
#ifdef RB_IPV6
|
||||||
if(localaddr.ss_family == AF_INET6)
|
if(localaddr.ss_family == AF_INET6)
|
||||||
{
|
{
|
||||||
((struct sockaddr_in6 *)&destaddr)->sin6_port = htons(113);
|
((struct sockaddr_in6 *)&destaddr)->sin6_port = htons(113);
|
||||||
|
|
|
@ -245,7 +245,7 @@ check_client(struct Client *client_p, struct Client *source_p, const char *usern
|
||||||
case NOT_AUTHORISED:
|
case NOT_AUTHORISED:
|
||||||
{
|
{
|
||||||
int port = -1;
|
int port = -1;
|
||||||
#ifdef IPV6
|
#ifdef RB_IPV6
|
||||||
if(source_p->localClient->ip.ss_family == AF_INET6)
|
if(source_p->localClient->ip.ss_family == AF_INET6)
|
||||||
port = ntohs(((struct sockaddr_in6 *)&source_p->localClient->listener->addr)->sin6_port);
|
port = ntohs(((struct sockaddr_in6 *)&source_p->localClient->listener->addr)->sin6_port);
|
||||||
else
|
else
|
||||||
|
@ -721,7 +721,7 @@ set_default_conf(void)
|
||||||
|
|
||||||
memset(&ServerInfo.ip, 0, sizeof(ServerInfo.ip));
|
memset(&ServerInfo.ip, 0, sizeof(ServerInfo.ip));
|
||||||
ServerInfo.specific_ipv4_vhost = 0;
|
ServerInfo.specific_ipv4_vhost = 0;
|
||||||
#ifdef IPV6
|
#ifdef RB_IPV6
|
||||||
memset(&ServerInfo.ip6, 0, sizeof(ServerInfo.ip6));
|
memset(&ServerInfo.ip6, 0, sizeof(ServerInfo.ip6));
|
||||||
ServerInfo.specific_ipv6_vhost = 0;
|
ServerInfo.specific_ipv6_vhost = 0;
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -1498,7 +1498,7 @@ serv_connect(struct server_conf *server_p, struct Client *by)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef IPV6
|
#ifdef RB_IPV6
|
||||||
if(theiripnum.ss_family == AF_INET6)
|
if(theiripnum.ss_family == AF_INET6)
|
||||||
((struct sockaddr_in6 *)&theiripnum)->sin6_port = htons(server_p->port);
|
((struct sockaddr_in6 *)&theiripnum)->sin6_port = htons(server_p->port);
|
||||||
else
|
else
|
||||||
|
@ -1586,7 +1586,7 @@ serv_connect(struct server_conf *server_p, struct Client *by)
|
||||||
SET_SS_LEN(&myipnum, sizeof(struct sockaddr_in));
|
SET_SS_LEN(&myipnum, sizeof(struct sockaddr_in));
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef IPV6
|
#ifdef RB_IPV6
|
||||||
else if((server_p->aftype == AF_INET6) && ServerInfo.specific_ipv6_vhost)
|
else if((server_p->aftype == AF_INET6) && ServerInfo.specific_ipv6_vhost)
|
||||||
{
|
{
|
||||||
memcpy(&myipnum, &ServerInfo.ip6, sizeof(myipnum));
|
memcpy(&myipnum, &ServerInfo.ip6, sizeof(myipnum));
|
||||||
|
@ -1599,7 +1599,7 @@ serv_connect(struct server_conf *server_p, struct Client *by)
|
||||||
{
|
{
|
||||||
/* log */
|
/* log */
|
||||||
ilog(L_SERVER, "Connecting to %s[%s] port %d (%s)", server_p->name, server_p->host, server_p->port,
|
ilog(L_SERVER, "Connecting to %s[%s] port %d (%s)", server_p->name, server_p->host, server_p->port,
|
||||||
#ifdef IPV6
|
#ifdef RB_IPV6
|
||||||
server_p->aftype == AF_INET6 ? "IPv6" :
|
server_p->aftype == AF_INET6 ? "IPv6" :
|
||||||
#endif
|
#endif
|
||||||
(server_p->aftype == AF_INET ? "IPv4" : "?"));
|
(server_p->aftype == AF_INET ? "IPv4" : "?"));
|
||||||
|
@ -1615,7 +1615,7 @@ serv_connect(struct server_conf *server_p, struct Client *by)
|
||||||
/* log */
|
/* log */
|
||||||
inetntop_sock((struct sockaddr *)&myipnum, vhoststr, sizeof vhoststr);
|
inetntop_sock((struct sockaddr *)&myipnum, vhoststr, sizeof vhoststr);
|
||||||
ilog(L_SERVER, "Connecting to %s[%s] port %d (%s) (vhost %s)", server_p->name, server_p->host, server_p->port,
|
ilog(L_SERVER, "Connecting to %s[%s] port %d (%s) (vhost %s)", server_p->name, server_p->host, server_p->port,
|
||||||
#ifdef IPV6
|
#ifdef RB_IPV6
|
||||||
server_p->aftype == AF_INET6 ? "IPv6" :
|
server_p->aftype == AF_INET6 ? "IPv6" :
|
||||||
#endif
|
#endif
|
||||||
(server_p->aftype == AF_INET ? "IPv4" : "?"), vhoststr);
|
(server_p->aftype == AF_INET ? "IPv4" : "?"), vhoststr);
|
||||||
|
|
Loading…
Reference in New Issue