0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-11-26 08:42:34 +01:00

Branch merge.

This commit is contained in:
Jilles Tjoelker 2008-04-05 21:20:15 +02:00
commit 17050f2433
25 changed files with 110 additions and 261 deletions

27
.hgignore Normal file
View file

@ -0,0 +1,27 @@
syntax: glob
Makefile
*.o
*.so
*.lo
*.la
.deps
.libs
autom4te.cache
config.log
config.status
include/setup.h
include/serno.h
libratbox/include/libratbox_config.h
libratbox/include/librb-config.h
libratbox/include/stamp-h1
libratbox/libtool
servlink/servlink
src/ircd
src/lex.yy.c
src/version.c.last
src/y.tab.h
src/y.tab.c
tools/convertilines
tools/convertklines
tools/mkpasswd
tools/viconf

130
configure vendored
View file

@ -7292,135 +7292,6 @@ else
fi
if test $ipv6 != yes; then
have_v6="no"
else
{ echo "$as_me:$LINENO: checking for core IPv6 support" >&5
echo $ECHO_N "checking for core IPv6 support... $ECHO_C" >&6; }
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
#define IN_AUTOCONF
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
int
main ()
{
struct sockaddr_in6 s;
s.sin6_family = 0;
;
return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (ac_try="$ac_compile"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
(eval "$ac_compile") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
} && test -s conftest.$ac_objext; then
if test "$CYGWIN" = "yes"; then
{ echo "$as_me:$LINENO: result: no, Cygwin's IPv6 is incomplete" >&5
echo "${ECHO_T}no, Cygwin's IPv6 is incomplete" >&6; }
have_v6=no
else
have_v6=yes
cat >>confdefs.h <<\_ACEOF
#define IPV6 1
_ACEOF
{ echo "$as_me:$LINENO: result: yes" >&5
echo "${ECHO_T}yes" >&6; }
{ echo "$as_me:$LINENO: checking for struct in6addr_any" >&5
echo $ECHO_N "checking for struct in6addr_any... $ECHO_C" >&6; }
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
#define IN_AUTOCONF
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
int
main ()
{
struct in6_addr a = in6addr_any;
;
return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (ac_try="$ac_compile"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
(eval "$ac_compile") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
} && test -s conftest.$ac_objext; then
{ echo "$as_me:$LINENO: result: yes" >&5
echo "${ECHO_T}yes" >&6; }
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
{ echo "$as_me:$LINENO: result: no" >&5
echo "${ECHO_T}no" >&6; }
cat >>confdefs.h <<\_ACEOF
#define NO_IN6ADDR_ANY 1
_ACEOF
inet_misc=1
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
{ echo "$as_me:$LINENO: result: no" >&5
echo "${ECHO_T}no" >&6; }
have_v6="no"
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
{ echo "$as_me:$LINENO: checking for library containing crypt" >&5
echo $ECHO_N "checking for library containing crypt... $ECHO_C" >&6; }
if test "${ac_cv_search_crypt+set}" = set; then
@ -15540,7 +15411,6 @@ Configuration:
Ziplinks : $zlib
OpenSSL : $openssl
IPv6 support : $have_v6
Socket Engine : $SELECT_TYPE
Small network : $small_net
Block allocator : $balloc

View file

@ -317,50 +317,6 @@ AC_CHECK_TYPE(socklen_t, ,
AC_ARG_ENABLE(ipv6,
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],,)
CRYPT_LIB=$ac_cv_search_crypt
@ -1267,7 +1223,6 @@ Configuration:
Ziplinks : $zlib
OpenSSL : $openssl
IPv6 support : $have_v6
Socket Engine : $SELECT_TYPE
Small network : $small_net
Block allocator : $balloc

View file

@ -31,7 +31,7 @@ enum
{
HM_HOST,
HM_IPV4
#ifdef IPV6
#ifdef RB_IPV6
, HM_IPV6
#endif
};
@ -64,7 +64,7 @@ struct ConfItem *find_dline(struct sockaddr *, int);
void report_Klines(struct Client *);
void report_auth(struct Client *);
#ifdef IPV6
#ifdef RB_IPV6
int match_ipv6(struct sockaddr *, struct sockaddr *, int);
#endif
int match_ipv4(struct sockaddr *, struct sockaddr *, int);

View file

@ -139,20 +139,20 @@
#define CLIENT_PARSE_ERROR -1
#define CLIENT_OK 1
#ifdef IPV6
#ifdef RB_IPV6
#ifndef AF_INET6
#error "AF_INET6 not defined"
#endif
#else /* #ifdef IPV6 */
#else /* #ifdef RB_IPV6 */
#ifndef AF_INET6
#define AF_INET6 AF_MAX /* Dummy AF_INET6 declaration */
#endif
#endif /* #ifdef IPV6 */
#endif /* #ifdef RB_IPV6 */
#ifdef IPV6
#ifdef RB_IPV6
#define PATRICIA_BITS 128
#else
#define PATRICIA_BITS 32

View file

@ -84,7 +84,7 @@ Info MyInformation[] = {
"Maximum Queue Length of Pending Connections"},
#endif /* SOMAXCONN */
#ifdef IPV6
#ifdef RB_IPV6
{"IPV6", "ON", 0, "IPv6 Support"},
#else
{"IPV6", "OFF", 0, "IPv6 Support"},

View file

@ -47,7 +47,7 @@ struct AuthRequest
unsigned int flags; /* current state of request */
rb_fde_t *F; /* file descriptor for auth queries */
time_t timeout; /* time when query expires */
#ifdef IPV6
#ifdef RB_IPV6
int ip6_int;
#endif
};

View file

@ -271,11 +271,11 @@ struct server_info
char *network_desc;
int hub;
struct sockaddr_in ip;
#ifdef IPV6
#ifdef RB_IPV6
struct sockaddr_in6 ip6;
#endif
int specific_ipv4_vhost;
#ifdef IPV6
#ifdef RB_IPV6
int specific_ipv6_vhost;
#endif

View file

@ -154,7 +154,7 @@ mo_dline(struct Client *client_p, struct Client *source_p,
const char *creason;
int t = AF_INET, ty, b;
ty = parse_netmask(dlhost, (struct sockaddr *)&daddr, &b);
#ifdef IPV6
#ifdef RB_IPV6
if(ty == HM_IPV6)
t = AF_INET6;
else

View file

@ -91,7 +91,7 @@ mo_etrace(struct Client *client_p, struct Client *source_p, int parc, const char
{
if(!irccmp(parv[1], "-full"))
do_etrace_full(source_p);
#ifdef IPV6
#ifdef RB_IPV6
else if(!irccmp(parv[1], "-v6"))
do_etrace(source_p, 0, 1);
else if(!irccmp(parv[1], "-v4"))
@ -151,7 +151,7 @@ do_etrace(struct Client *source_p, int ipv4, int ipv6)
{
target_p = ptr->data;
#ifdef IPV6
#ifdef RB_IPV6
if((!ipv4 && target_p->localClient->ip.ss_family == AF_INET) ||
(!ipv6 && target_p->localClient->ip.ss_family == AF_INET6))
continue;

View file

@ -701,7 +701,7 @@ already_placed_kline(struct Client *source_p, const char *luser, const char *lho
bits = 0;
if((t = parse_netmask(lhost, (struct sockaddr *)&iphost, &bits)) != HM_HOST)
{
#ifdef IPV6
#ifdef RB_IPV6
if(t == HM_IPV6)
t = AF_INET6;
else

View file

@ -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 */
if((type = parse_netmask(host, (struct sockaddr *)&ip, &host_mask)) != HM_HOST)
{
#ifdef IPV6
#ifdef RB_IPV6
if(type == HM_IPV6)
aconf = find_dline((struct sockaddr *)&ip, AF_INET6);
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,
(type != HM_HOST) ? (struct sockaddr *)&ip : NULL,
(type != HM_HOST) ? (
#ifdef IPV6
#ifdef RB_IPV6
(type == HM_IPV6) ? AF_INET6 :
#endif
AF_INET) : 0)))

View file

@ -149,7 +149,7 @@ confopts(struct Client *source_p)
*p++ = 'Z';
#endif
#ifdef IPV6
#ifdef RB_IPV6
*p++ = '6';
#endif

View file

@ -33,7 +33,7 @@
#include "send.h"
#include "irc_string.h"
#ifdef IPV6
#ifdef RB_IPV6
static unsigned long hash_ipv6(struct sockaddr *, int);
#endif
static unsigned long hash_ipv4(struct sockaddr *, int);
@ -63,7 +63,7 @@ parse_netmask(const char *text, struct sockaddr *naddr, int *nb)
else
addr = (struct rb_sockaddr_storage *)naddr;
#ifdef IPV6
#ifdef RB_IPV6
if(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.
* Side effects: None
*/
#ifdef IPV6
#ifdef RB_IPV6
static unsigned long
hash_ipv6(struct sockaddr *saddr, int bits)
{
@ -221,7 +221,7 @@ find_conf_by_address(const char *name, const char *sockhost,
if(addr)
{
/* Check for IPV6 matches... */
#ifdef IPV6
#ifdef RB_IPV6
if(fam == AF_INET6)
{
@ -448,7 +448,7 @@ find_exact_conf_by_address(const char *address, int type, const char *username)
address = "/NOMATCH!/";
arec = rb_malloc(sizeof(struct AddressRec));
masktype = parse_netmask(address, (struct sockaddr *)&addr, &bits);
#ifdef IPV6
#ifdef RB_IPV6
if(masktype == HM_IPV6)
{
/* 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);
arec->Mask.ipa.bits = bits;
arec->masktype = masktype;
#ifdef IPV6
#ifdef RB_IPV6
if(masktype == HM_IPV6)
{
/* 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 rb_sockaddr_storage addr;
masktype = parse_netmask(address, (struct sockaddr *)&addr, &bits);
#ifdef IPV6
#ifdef RB_IPV6
if(masktype == HM_IPV6)
{
/* We have to do this, since we do not re-hash for every bit -A1kmm. */

View file

@ -34,7 +34,7 @@
#define INADDRSZ 4
#endif
#ifdef IPV6
#ifdef RB_IPV6
#ifndef IN6ADDRSZ
#define IN6ADDRSZ 16
#endif
@ -398,7 +398,7 @@ inetntoa(const char *in)
*/
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);
#endif
@ -427,7 +427,7 @@ inet_ntop4(const unsigned char *src, char *dst, unsigned int size)
* author:
* Paul Vixie, 1996.
*/
#ifdef IPV6
#ifdef RB_IPV6
static const char *
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));
return 1;
}
#ifdef IPV6
#ifdef RB_IPV6
else if(inetpton(AF_INET6, src, &((struct sockaddr_in6 *) dst)->sin6_addr))
{
((struct sockaddr_in6 *) dst)->sin6_port = 0;
@ -562,7 +562,7 @@ inetntop_sock(struct sockaddr *src, char *dst, unsigned int size)
case AF_INET:
return (inetntop(AF_INET, &((struct sockaddr_in *) src)->sin_addr, dst, size));
break;
#ifdef IPV6
#ifdef RB_IPV6
case AF_INET6:
return (inetntop(AF_INET6, &((struct sockaddr_in6 *) src)->sin6_addr, dst, size));
break;
@ -588,7 +588,7 @@ inetntop(int af, const void *src, char *dst, unsigned int size)
{
case AF_INET:
return (inet_ntop4(src, dst, size));
#ifdef IPV6
#ifdef RB_IPV6
case AF_INET6:
if(IN6_IS_ADDR_V4MAPPED((const struct in6_addr *) src) ||
IN6_IS_ADDR_V4COMPAT((const struct in6_addr *) src))
@ -677,7 +677,7 @@ inet_pton4(src, dst)
return (1);
}
#ifdef IPV6
#ifdef RB_IPV6
/* int
* inet_pton6(src, dst)
* convert presentation level address to network order binary form.
@ -803,7 +803,7 @@ inetpton(af, src, dst)
{
case AF_INET:
return (inet_pton4(src, dst));
#ifdef IPV6
#ifdef RB_IPV6
case AF_INET6:
/* Somebody might have passed as an IPv4 address this is sick but it works */
if(inet_pton4(src, dst))

View file

@ -24,10 +24,10 @@
* $Id: ircd.c 3380 2007-04-03 22:25:11Z jilles $
*/
#include "ratbox_lib.h"
#include "stdinc.h"
#include "setup.h"
#include "config.h"
#include "ircd.h"
#include "channel.h"
#include "class.h"
@ -66,8 +66,6 @@
#include "patchlevel.h"
#include "serno.h"
#include "ratbox_lib.h"
/*
* Try and find the correct name to use with getrlimit() for setting the max.
* number of files allowed to be open by this process.
@ -80,6 +78,17 @@ extern char **myargv;
int maxconnections; /* XXX */
/* /quote set variables */
struct SetOptions GlobalSetOptions;
/* configuration set from ircd.conf */
struct config_file_entry ConfigFileEntry;
/* server info set from ircd.conf */
struct server_info ServerInfo;
/* admin info set from ircd.conf */
struct admin_info AdminInfo;
struct Counter Count;
struct ServerStatistics ServerStats;
/*
@ -450,10 +459,10 @@ main(int argc, char *argv[])
rb_dlinkAddTail(&me, &me.node, &global_client_list);
memset((void *) &Count, 0, sizeof(Count));
memset((void *) &ServerInfo, 0, sizeof(ServerInfo));
memset((void *) &AdminInfo, 0, sizeof(AdminInfo));
memset((void *) &ServerStats, 0, sizeof(struct ServerStatistics));
memset(&Count, 0, sizeof(Count));
memset(&ServerInfo, 0, sizeof(ServerInfo));
memset(&AdminInfo, 0, sizeof(AdminInfo));
memset(&ServerStats, 0, sizeof(struct ServerStatistics));
/* Initialise the channel capability usage counts... */
init_chcap_usage_counts();

View file

@ -85,18 +85,6 @@ rb_dlink_list global_serv_list; /* global servers on the network */
rb_dlink_list local_oper_list; /* our opers, duplicated in lclient_list */
rb_dlink_list oper_list; /* network opers */
/* /quote set variables */
struct SetOptions GlobalSetOptions;
/* configuration set from ircd.conf */
struct config_file_entry ConfigFileEntry;
/* server info set from ircd.conf */
struct server_info ServerInfo;
/* admin info set from ircd.conf */
struct admin_info AdminInfo;
struct Counter Count;
struct timeval SystemTime;
int ServerRunning; /* GLOBAL - server execution state */
struct Client me; /* That's me */

View file

@ -46,7 +46,7 @@
#define INADDR_NONE ((unsigned int) 0xffffffff)
#endif
#if defined(NO_IN6ADDR_ANY) && defined(IPV6)
#if defined(NO_IN6ADDR_ANY) && defined(RB_IPV6)
static const struct in6_addr in6addr_any =
{ { { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 } } };
#endif
@ -112,7 +112,7 @@ get_listener_name(const listener_t *listener)
if(listener == NULL)
return NULL;
#ifdef IPV6
#ifdef RB_IPV6
if(listener->addr.ss_family == AF_INET6)
port = ntohs(((const struct sockaddr_in6 *)&listener->addr)->sin6_port);
else
@ -138,7 +138,7 @@ show_ports(struct Client *source_p)
{
sendto_one_numeric(source_p, RPL_STATSPLINE,
form_str(RPL_STATSPLINE), 'P',
#ifdef IPV6
#ifdef RB_IPV6
ntohs(listener->addr.ss_family == AF_INET ? ((struct sockaddr_in *)&listener->addr)->sin_port :
((struct sockaddr_in6 *)&listener->addr)->sin6_port),
#else
@ -175,7 +175,7 @@ inetport(listener_t *listener)
F = rb_socket(GET_SS_FAMILY(&listener->addr), SOCK_STREAM, 0, "Listener socket");
#ifdef IPV6
#ifdef RB_IPV6
if(listener->addr.ss_family == AF_INET6)
{
struct sockaddr_in6 *in6 = (struct sockaddr_in6 *)&listener->addr;
@ -270,7 +270,7 @@ find_listener(struct rb_sockaddr_storage *addr)
}
break;
}
#ifdef IPV6
#ifdef RB_IPV6
case AF_INET6:
{
struct sockaddr_in6 *in6 = (struct sockaddr_in6 *)addr;
@ -323,7 +323,7 @@ add_listener(int port, const char *vhost_ip, int family)
if(inetpton(family, vhost_ip, &((struct sockaddr_in *)&vaddr)->sin_addr) <= 0)
return;
}
#ifdef IPV6
#ifdef RB_IPV6
else
{
if(inetpton(family, vhost_ip, &((struct sockaddr_in6 *)&vaddr)->sin6_addr) <= 0)
@ -338,7 +338,7 @@ add_listener(int port, const char *vhost_ip, int family)
case AF_INET:
((struct sockaddr_in *)&vaddr)->sin_addr.s_addr = INADDR_ANY;
break;
#ifdef IPV6
#ifdef RB_IPV6
case AF_INET6:
memcpy(&((struct sockaddr_in6 *)&vaddr)->sin6_addr, &in6addr_any, sizeof(struct in6_addr));
break;
@ -353,7 +353,7 @@ add_listener(int port, const char *vhost_ip, int family)
SET_SS_LEN(&vaddr, sizeof(struct sockaddr_in));
((struct sockaddr_in *)&vaddr)->sin_port = htons(port);
break;
#ifdef IPV6
#ifdef RB_IPV6
case AF_INET6:
SET_SS_LEN(&vaddr, sizeof(struct sockaddr_in6));
((struct sockaddr_in6 *)&vaddr)->sin6_port = htons(port);

View file

@ -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;
idest = &((struct sockaddr_in *)dest)->sin_addr;
}
#ifdef IPV6
#ifdef RB_IPV6
else
{
iaddr = &((struct sockaddr_in6 *)addr)->sin6_addr;
@ -346,7 +346,7 @@ int match_ips(const char *s1, const char *s2)
if (cidrlen == 0)
return 0;
#ifdef IPV6
#ifdef RB_IPV6
if (strchr(mask, ':') && strchr(address, ':'))
{
aftype = AF_INET6;
@ -414,7 +414,7 @@ int match_cidr(const char *s1, const char *s2)
if (cidrlen == 0)
return 0;
#ifdef IPV6
#ifdef RB_IPV6
if (strchr(ip, ':') && strchr(ipmask, ':'))
{
aftype = AF_INET6;

View file

@ -241,7 +241,7 @@ conf_set_serverinfo_vhost(void *data)
static void
conf_set_serverinfo_vhost6(void *data)
{
#ifdef IPV6
#ifdef RB_IPV6
if(inetpton(AF_INET6, (char *) data, &ServerInfo.ip6.sin6_addr) <= 0)
{
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
conf_set_class_cidr_bitlen(void *data)
{
#ifdef IPV6
#ifdef RB_IPV6
unsigned int maxsize = 128;
#else
unsigned int maxsize = 32;
@ -759,14 +759,14 @@ conf_set_listen_port(void *data)
if(listener_address == NULL)
{
add_listener(args->v.number, listener_address, AF_INET);
#ifdef IPV6
#ifdef RB_IPV6
add_listener(args->v.number, listener_address, AF_INET6);
#endif
}
else
{
int family;
#ifdef IPV6
#ifdef RB_IPV6
if(strchr(listener_address, ':') != NULL)
family = AF_INET6;
else
@ -1221,7 +1221,7 @@ conf_set_connect_aftype(void *data)
if(strcasecmp(aft, "ipv4") == 0)
yy_server->aftype = AF_INET;
#ifdef IPV6
#ifdef RB_IPV6
else if(strcasecmp(aft, "ipv6") == 0)
yy_server->aftype = AF_INET6;
#endif

View file

@ -142,7 +142,7 @@ add_reject(struct Client *client_p, const char *mask1, const char *mask2)
else
{
int bitlen = 32;
#ifdef IPV6
#ifdef RB_IPV6
if(client_p->localClient->ip.ss_family == AF_INET6)
bitlen = 128;
#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)
{
int bitlen = 32;
#ifdef IPV6
#ifdef RB_IPV6
if(client_p->localClient->ip.ss_family == AF_INET6)
bitlen = 128;
#endif

View file

@ -118,7 +118,7 @@ extern char irc_domain[HOSTLEN + 1];
*/
static int res_ourserver(const struct rb_sockaddr_storage *inp)
{
#ifdef IPV6
#ifdef RB_IPV6
struct sockaddr_in6 *v6;
struct sockaddr_in6 *v6in = (struct sockaddr_in6 *)inp;
#endif
@ -129,7 +129,7 @@ static int res_ourserver(const struct rb_sockaddr_storage *inp)
for (ns = 0; ns < irc_nscount; ns++)
{
const struct rb_sockaddr_storage *srv = &irc_nsaddr_list[ns];
#ifdef IPV6
#ifdef RB_IPV6
v6 = (struct sockaddr_in6 *)srv;
#endif
v4 = (struct sockaddr_in *)srv;
@ -139,7 +139,7 @@ static int res_ourserver(const struct rb_sockaddr_storage *inp)
*/
switch (srv->ss_family)
{
#ifdef IPV6
#ifdef RB_IPV6
case AF_INET6:
if (srv->ss_family == inp->ss_family)
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]),
(unsigned int)(cp[2]), (unsigned int)(cp[1]), (unsigned int)(cp[0]));
}
#ifdef IPV6
#ifdef RB_IPV6
else if (addr->ss_family == AF_INET6)
{
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);
break;
case T_A:
#ifdef IPV6
#ifdef RB_IPV6
case T_AAAA:
#endif
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 rd_length;
struct sockaddr_in *v4; /* conversion */
#ifdef IPV6
#ifdef RB_IPV6
struct sockaddr_in6 *v6;
#endif
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));
return (1);
break;
#ifdef IPV6
#ifdef RB_IPV6
case T_AAAA:
if (request->type != T_AAAA)
return (0);
@ -818,7 +818,7 @@ static void res_readreply(rb_fde_t *F, void *data)
* ip#.
*
*/
#ifdef IPV6
#ifdef RB_IPV6
if (request->addr.ss_family == AF_INET6)
gethost_byname_type(request->name, request->query, T_AAAA);
else

View file

@ -199,7 +199,7 @@ auth_dns_callback(void *vptr, struct DNSReply *reply)
good = 0;
}
}
#ifdef IPV6
#ifdef RB_IPV6
else if(auth->client->localClient->ip.ss_family == AF_INET6)
{
struct sockaddr_in6 *ip, *ip_fwd;
@ -304,7 +304,7 @@ start_auth_query(struct AuthRequest *auth)
(struct sockaddr *) &localaddr, &locallen);
/* XXX mangle_mapped_sockaddr((struct sockaddr *)&localaddr); */
#ifdef IPV6
#ifdef RB_IPV6
if(localaddr.ss_family == AF_INET6)
{
((struct sockaddr_in6 *)&localaddr)->sin6_port = 0;
@ -313,7 +313,7 @@ start_auth_query(struct AuthRequest *auth)
((struct sockaddr_in *)&localaddr)->sin_port = 0;
destaddr = auth->client->localClient->ip;
#ifdef IPV6
#ifdef RB_IPV6
if(localaddr.ss_family == AF_INET6)
{
((struct sockaddr_in6 *)&destaddr)->sin6_port = htons(113);

View file

@ -245,7 +245,7 @@ check_client(struct Client *client_p, struct Client *source_p, const char *usern
case NOT_AUTHORISED:
{
int port = -1;
#ifdef IPV6
#ifdef RB_IPV6
if(source_p->localClient->ip.ss_family == AF_INET6)
port = ntohs(((struct sockaddr_in6 *)&source_p->localClient->listener->addr)->sin6_port);
else
@ -721,7 +721,7 @@ set_default_conf(void)
memset(&ServerInfo.ip, 0, sizeof(ServerInfo.ip));
ServerInfo.specific_ipv4_vhost = 0;
#ifdef IPV6
#ifdef RB_IPV6
memset(&ServerInfo.ip6, 0, sizeof(ServerInfo.ip6));
ServerInfo.specific_ipv6_vhost = 0;
#endif

View file

@ -1498,7 +1498,7 @@ serv_connect(struct server_conf *server_p, struct Client *by)
return 0;
}
#ifdef IPV6
#ifdef RB_IPV6
if(theiripnum.ss_family == AF_INET6)
((struct sockaddr_in6 *)&theiripnum)->sin6_port = htons(server_p->port);
else
@ -1586,7 +1586,7 @@ serv_connect(struct server_conf *server_p, struct Client *by)
SET_SS_LEN(&myipnum, sizeof(struct sockaddr_in));
}
#ifdef IPV6
#ifdef RB_IPV6
else if((server_p->aftype == AF_INET6) && ServerInfo.specific_ipv6_vhost)
{
memcpy(&myipnum, &ServerInfo.ip6, sizeof(myipnum));
@ -1599,7 +1599,7 @@ serv_connect(struct server_conf *server_p, struct Client *by)
{
/* log */
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" :
#endif
(server_p->aftype == AF_INET ? "IPv4" : "?"));
@ -1615,7 +1615,7 @@ serv_connect(struct server_conf *server_p, struct Client *by)
/* log */
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,
#ifdef IPV6
#ifdef RB_IPV6
server_p->aftype == AF_INET6 ? "IPv6" :
#endif
(server_p->aftype == AF_INET ? "IPv4" : "?"), vhoststr);