Просмотр исходного кода

* In config/-C, the ip field for bots can now be either ipv4 or ipv6. (ipv6 field still present)

svn: 2159
Bryan Drewery 21 лет назад
Родитель
Сommit
98204093e3
2 измененных файлов с 9 добавлено и 2 удалено
  1. 1 0
      doc/UPDATES
  2. 8 2
      src/conf.c

+ 1 - 0
doc/UPDATES

@@ -144,6 +144,7 @@ Lines prefixed with '-' were disabled before release and are not finished, or ar
 * Fixed cmd_[ch]handle saving userfile when changes weren't actually made.
 * Fixed cmd_quit working over botcmd. (#108)
 * Fixed 'bots' not showing up in help, and a typo in 'botpart'.
+* In config/-C, the ip field for bots can now be either ipv4 or ipv6. (ipv6 field still present)
 
 1.2.2
 * Don't sanity check flags for users on DCC CHAT if they are on the bot via .botcmd.

+ 8 - 2
src/conf.c

@@ -447,8 +447,14 @@ conf_addbot(char *nick, char *ip, char *host, char *ip6)
     bot->net.host = strdup(host);
   }
 
-  if (ip && strcmp(ip, ".") && is_dotted_ip(ip) == AF_INET)
-    bot->net.ip = strdup(ip);
+  if (ip && strcmp(ip, ".")) {
+    int aftype = is_dotted_ip(ip);
+
+    if (aftype == AF_INET)
+      bot->net.ip = strdup(ip);
+    else if (aftype == AF_INET6)
+      bot->net.ip6 = strdup(ip);
+  }
   if (ip6 && strcmp(ip6, ".") && is_dotted_ip(ip6) == AF_INET6)
     bot->net.ip6 = strdup(ip6);