Author: Kev <klmitch@mit.edu>
[ircu2.10.12-pk.git] / ircd / s_bsd.c
index 9d1564830371681a862c2c73625d35f2fead27c8..049691cb52abf6027b36c5128c4fdaaaf163e4ae 100644 (file)
@@ -31,6 +31,7 @@
 #include "ircd_features.h"
 #include "ircd_osdep.h"
 #include "ircd_reply.h"
+#include "ircd_snprintf.h"
 #include "ircd_string.h"
 #include "ircd.h"
 #include "list.h"
@@ -49,7 +50,6 @@
 #include "s_misc.h"
 #include "s_user.h"
 #include "send.h"
-#include "sprintf_irc.h"
 #include "struct.h"
 #include "support.h"
 #include "sys.h"
@@ -460,9 +460,10 @@ static int completed_connection(struct Client* cptr)
   cli_lasttime(cptr) = CurrentTime;
   cli_flags(cptr) |= FLAGS_PINGSENT;
 
-  sendrawto_one(cptr, MSG_SERVER " %s 1 %Tu %Tu J%s %s%s :%s",
-                cli_name(&me), cli_serv(&me)->timestamp, newts, MAJOR_PROTOCOL, 
-                NumServCap(&me), cli_info(&me));
+  sendrawto_one(cptr, MSG_SERVER " %s 1 %Tu %Tu J%s %s%s +%s :%s",
+                cli_name(&me), cli_serv(&me)->timestamp, newts,
+               MAJOR_PROTOCOL, NumServCap(&me),
+               feature_bool(FEAT_HUB) ? "h" : "", cli_info(&me));
 
   return (IsDead(cptr)) ? 0 : 1;
 }
@@ -627,6 +628,7 @@ void add_connection(struct Listener* listener, int fd) {
    * Copy ascii address to 'sockhost' just in case. Then we have something
    * valid to put into error messages...  
    */
+  SetIPChecked(new_client);
   ircd_ntoa_r(cli_sock_ip(new_client), (const char*) &addr.sin_addr);   
   strcpy(cli_sockhost(new_client), cli_sock_ip(new_client));
   (cli_ip(new_client)).s_addr = addr.sin_addr.s_addr;
@@ -889,7 +891,8 @@ int connect_server(struct ConfItem* aconf, struct Client* by,
    */
   make_server(cptr);
   if (by && IsUser(by)) {
-    sprintf_irc(cli_serv(cptr)->by, "%s%s", NumNick(by));
+    ircd_snprintf(0, cli_serv(cptr)->by, sizeof(cli_serv(cptr)->by), "%s%s",
+                 NumNick(by));
     assert(0 == cli_serv(cptr)->user);
     cli_serv(cptr)->user = cli_user(by);
     cli_user(by)->refcnt++;