Skip to content
This repository has been archived by the owner on Apr 17, 2020. It is now read-only.

multiple entries for local IP in /etc/hosts prevents connecting #167

Closed
irssibot opened this issue Jan 2, 2005 · 3 comments
Closed

multiple entries for local IP in /etc/hosts prevents connecting #167

irssibot opened this issue Jan 2, 2005 · 3 comments

Comments

@irssibot
Copy link
Collaborator

irssibot commented Jan 2, 2005

@irssibot
Copy link
Collaborator Author

irssibot commented Jan 2, 2005

irssi-hosts.patch

Patch to fix bug

diff -u irssi-2005.2.1/src/irc/core/irc-servers.c irssi-mod/src/irc/core/irc-servers.c
--- irssi-2005.2.1/src/irc/core/irc-servers.c	Tue Oct 12 13:10:02 2004
+++ irssi-mod/src/irc/core/irc-servers.c	Sun Jan  2 13:19:33 2005
@@ -142,8 +142,11 @@
 	}
 
 	/* Replace ':' with '_' in our own hostname (the same IPv6 problem) */
+	/* Replace '\n' and '\r' with '\0' in our own hostname to fix multiple PTR addreses */
 	for (ptr = hostname; *ptr != '\0'; ptr++) {
 		if (*ptr == ':') *ptr = '_';
+		if (*ptr == '\n') *ptr = '\0';
+		if (*ptr == '\r') *ptr = '\0';
 	}
 
 	/* don't allow hostname to begin with number or '+', '-'. those

@irssibot
Copy link
Collaborator Author

irssibot commented Jan 2, 2005

Forgot to mention, this starts where if gethostname() returns multiple lines. This causes the USER command to fail.

@irssibot
Copy link
Collaborator Author

irssibot commented Jan 3, 2005

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Development

No branches or pull requests

1 participant