]> jfr.im git - solanum.git/commitdiff
Replacing legacy IPV6 define with RB_IPV6 (which is included in libratbox's config.h).
authorValery Yatsko <redacted>
Sat, 5 Apr 2008 16:57:30 +0000 (20:57 +0400)
committerValery Yatsko <redacted>
Sat, 5 Apr 2008 16:57:30 +0000 (20:57 +0400)
16 files changed:
configure.ac
include/ircd_defs.h
include/s_auth.h
modules/m_etrace.c
modules/m_kline.c
modules/m_testline.c
modules/m_version.c
src/hostmask.c
src/irc_string.c
src/match.c
src/newconf.c
src/reject.c
src/res.c
src/s_auth.c
src/s_conf.c
src/s_serv.c

index d68f1470c96a66d5213c6bc24a4f6de75dc810f7..954a0642ea6624b7a5933afbce7543128aed3cba 100644 (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
index f9fb55dc5c4873eeebf0874996f49e3a9e4659cc..cea2978a52a8ca75638414f439fa740394e61824 100644 (file)
 #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
index a02950ac03f31fd25e3d78bf252ac2018715dd8e..85b8358512af719b1d6c50b883f21ffd9dbcde70 100644 (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
 };
index 219926e3576eca085fcd3e051a0980aff1a59b9e..b9bf4c1304a32a03e0de1c9cae3c29e8a16bb334 100644 (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;
index 7e6631a3d316e7db6e2760ad2bae54443d1ea224..04a936c771fec80e030bdcfd2dc01619f67fca90 100644 (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
index a261d415dc3544cc799916aa2925d1fd30b9a003..3a9bb436ebd87efd882ac47bed9333456c959704 100644 (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)))
index e94460760df3b33b9d635133a65ca9ac1db14542..34002f836557c470fc4c159d012e30062bc2b604 100644 (file)
@@ -149,7 +149,7 @@ confopts(struct Client *source_p)
        *p++ = 'Z';
 #endif
 
-#ifdef IPV6
+#ifdef RB_IPV6
        *p++ = '6';
 #endif
 
index 273f1169d2c3f94473e4be9c80fae1a026e29f82..0b2b1605d0ba5383fdbb00025f6e2e81960e6613 100644 (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. */
index f5f1187a8ca2f6810afc68f0dd35bed235966522..5951dd65862a18a026ce9fa20f91f4ec9b17d487 100644 (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))
index 12e4c01eb7a12c06fee33275b2ba76c67a53545b..5d9e8fe3fcbf0e5bd539245c42fae25bd5284e72 100644 (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;
index 4981e44b72ce5159d62dc8241380cbde4034552d..ce3fe84487ce615c41854aec1bf9db6cdeac73ab 100644 (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
index a01b5a0537a6a73513531cdba3953a7704b3a62a..9dacd40152643658df69967e83def2d1c2f1d74c 100644 (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
index 2a3677642ea1c091f97bbc15bdb1ea1f155085eb..67b3811a65071d3947f5c98bd037b29b4f9743a4 100644 (file)
--- a/src/res.c
+++ b/src/res.c
@@ -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
index 4a39c1ac44b9f8c0560095af9dc3132e049c59dd..21236b44343d323088d08120cc690447ab441fd4 100644 (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);
index 28aabff64e396f496a72f704d5bb358ec6bd8383..c0033d192a73ad5d8fdd9e7a76e72dc1ef27a2f7 100644 (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
index a866755100c9004bcef99fec303045ae7bf80bc7..0b417680c73043d24b8df2802d0d9d1103815119 100644 (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);