[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: B-lines broken



On May 31, Michael Neumayer wrote:
| I suppose irc2.9.3b17/ircd/s_conf.c lines 1425 to 1428 are wrong, but
| wasn't able to fix ist.

yeah, code was pretty ugly.. try the attached diff. (I
didn't test it.)

| Anyway while testing I got annoyed because ircd lacked a "/stats b"
| and hacked it in. See attachment. 

Oh, I did that last week already.
diff -u -r1.7 s_conf.c
--- s_conf.c	1997/05/14 19:52:48	1.7
+++ s_conf.c	1997/06/01 18:26:41
@@ -1414,33 +1414,43 @@
 	    {
 		if (aconf->status != CONF_BOUNCE)
 			continue;
-		/* early rejection, connection class is unknown */
-		if (cptr == NULL && atoi(aconf->host) == -1)
-			continue;
+
+		if (cptr == NULL)
+			/*
+			** early rejection,
+			** connection class and hostname are unknown
+			*/
+			if (atoi(aconf->host) == -1)
+			    {
+				char rpl[BUFSIZE];
+				
+				irc_sprintf(rpl, rpl_str(RPL_BOUNCE,"unknown"),
+					    aconf->name,
+					    (aconf->port) ? aconf->port :6667);
+				strcat(rpl, "\r\n");
+				send(class, rpl, strlen(rpl), 0);
+				return;
+			    }
+			else
+				continue;
+
+		/* cptr != NULL */
 		/*
 		** "too many" type rejection, class is known.
 		** check if B line is for a class #,
 		** and if it is for a hostname.
 		*/
-		if (cptr && isdigit(*aconf->host) &&
-		    class != atoi(aconf->host) &&
-		    match(aconf->host, cptr->sockhost))
-			continue;
-
-		if (cptr)
-			sendto_one(cptr, rpl_str(RPL_BOUNCE, cptr->name),
-				   aconf->name,
-				   (aconf->port) ? aconf->port : 6667);
-		else
+		if (isdigit(*aconf->host))
 		    {
-			char rpl[BUFSIZE];
-
-			irc_sprintf(rpl, rpl_str(RPL_BOUNCE, "unknown"),
-				    aconf->name,
-				    (aconf->port) ? aconf->port : 6667);
-			strcat(rpl, "\r\n");
-			send(class, rpl, strlen(rpl), 0);
+			if (class != atoi(aconf->host))
+				continue;
 		    }
+		else
+			if (match(aconf->host, cptr->sockhost))
+				continue;
+
+		sendto_one(cptr, rpl_str(RPL_BOUNCE, cptr->name), aconf->name,
+			   (aconf->port) ? aconf->port : 6667);
 		return;
 	    }