- for (int count = 0; count < Config->ConfValueEnum(Config->config_data, "bind"); count++)
- {
- Config->ConfValue(Config->config_data, "bind", "port", count, configToken, MAXBUF);
- Config->ConfValue(Config->config_data, "bind", "address", count, Addr, MAXBUF);
- Config->ConfValue(Config->config_data, "bind", "type", count, Type, MAXBUF);
-
- if (strncmp(Addr, "::ffff:", 7) == 0)
- this->Logs->Log("SOCKET",DEFAULT, "Using 4in6 (::ffff:) isn't recommended. You should bind IPv4 addresses directly instead.");
-
- if ((!*Type) || (!strcmp(Type,"clients")))
- {
- irc::portparser portrange(configToken, false);
- int portno = -1;
- while (0 != (portno = portrange.GetToken()))
- {
- if (*Addr == '*')
- *Addr = 0;
+static void sa2cidr(irc::sockets::cidr_mask& cidr, const irc::sockets::sockaddrs& sa, unsigned char range)
+{
+ const unsigned char* base;
+ unsigned char target_byte;
+ cidr.type = sa.sa.sa_family;