Hello all. I am using IRCServices 5.0.57 on UltimateIRCd(Tsunami)-3.0(01), though this problem occurs regardless of what IRCd is used. (Services never makes it to the IRCd)<br><br>Following are a C&P of services' log, followed by the contents of
socktest.c, which is a socket testing program my buddy wrote (so he says) for me, followed by the output of ./socktest.<br> <br>I hope I've provided enough information, if anyone needs more information or needs me to take any additional steps for further troubleshooting, that's no problem at all.
<br><br>Any help would be appreciated, thanks in advance.<br><br>Dave<br><br>Logs:<br>[Feb 14 20:12:25.677031 2006] IRC Services 5.0.57 starting up (options: debug)<br>[Feb 14 20:12:25.722001 2006] debug: Loading language 0 from file `languages/en_us'
<br>[Feb 14 20:12:25.728089 2006] debug: Loading language 10 from file `languages/nl'<br>[Feb 14 20:12:25.734271 2006] debug: Loading language 6 from file `languages/fr'<br>[Feb 14 20:12:25.740649 2006] debug: Loading language 9 from file `languages/de'
<br>[Feb 14 20:12:25.747259 2006] debug: Loading language 11 from file `languages/hu'<br>[Feb 14 20:12:25.753610 2006] debug: Loading language 8 from file `languages/it'<br>[Feb 14 20:12:25.758795 2006] debug: Loading language 2 from file `languages/ja_euc'
<br>[Feb 14 20:12:25.764741 2006] debug: Loading language 3 from file `languages/ja_sjis'<br>[Feb 14 20:12:25.770444 2006] debug: Loading language 5 from file `languages/pt'<br>[Feb 14 20:12:25.779258 2006] debug: Loading language 12 from file `languages/ru'
<br>[Feb 14 20:12:25.785985 2006] debug: Loading language 4 from file `languages/es'<br>[Feb 14 20:12:25.792501 2006] debug: Loading language 7 from file `languages/tr'<br>[Feb 14 20:12:25.798826 2006] debug: Loaded languages
<br>[Feb 14 20:12:25.802596 2006] debug: Loading module `protocol/bahamut'<br>[Feb 14 20:12:25.809033 2006] debug: Successfully loaded module `protocol/bahamut'<br>[Feb 14 20:12:25.812829 2006] debug: Loading module `database/version4'
<br>[Feb 14 20:12:25.821537 2006] debug: Successfully loaded module `database/version4'<br>[Feb 14 20:12:25.825316 2006] debug: Loading module `mail/main'<br>[Feb 14 20:12:25.830547 2006] debug: Successfully loaded module `mail/main'
<br>[Feb 14 20:12:25.834844 2006] debug: Loading module `mail/smtp'<br>[Feb 14 20:12:25.841417 2006] debug: Successfully loaded module `mail/smtp'<br>[Feb 14 20:12:25.844974 2006] debug: Loading module `operserv/main'<br>
[Feb 14 20:12:25.852625 2006] debug: Successfully loaded module `operserv/main'<br>[Feb 14 20:12:25.856821 2006] debug: Loading module `operserv/akill'<br>[Feb 14 20:12:25.862871 2006] debug: Successfully loaded module `operserv/akill'
<br>[Feb 14 20:12:25.866979 2006] debug: Loading module `operserv/news'<br>[Feb 14 20:12:25.872761 2006] debug: Successfully loaded module `operserv/news'<br>[Feb 14 20:12:25.876803 2006] debug: Loading module `operserv/sessions'
<br>[Feb 14 20:12:25.883016 2006] debug: Successfully loaded module `operserv/sessions'<br>[Feb 14 20:12:25.888510 2006] debug: Loading module `operserv/sline'<br>[Feb 14 20:12:25.894708 2006] debug: Successfully loaded module `operserv/sline'
<br>[Feb 14 20:12:25.898628 2006] debug: Loading module `nickserv/main'<br>[Feb 14 20:12:25.910032 2006] debug: Successfully loaded module `nickserv/main'<br>[Feb 14 20:12:25.913969 2006] debug: Loading module `nickserv/access'
<br>[Feb 14 20:12:25.920316 2006] debug: Successfully loaded module `nickserv/access'<br>[Feb 14 20:12:25.924218 2006] debug: Loading module `nickserv/link'<br>[Feb 14 20:12:25.930096 2006] debug: Successfully loaded module `nickserv/link'
<br>[Feb 14 20:12:25.933580 2006] debug: Loading module `nickserv/mail-auth'<br>[Feb 14 20:12:25.940245 2006] debug: Successfully loaded module `nickserv/mail-auth'<br>[Feb 14 20:12:25.944046 2006] debug: Loading module `nickserv/sendpass'
<br>[Feb 14 20:12:25.951050 2006] debug: Successfully loaded module `nickserv/sendpass'<br>[Feb 14 20:12:25.954684 2006] debug: Loading module `chanserv/main'<br>[Feb 14 20:12:25.963185 2006] debug: Successfully loaded module `chanserv/main'
<br>[Feb 14 20:12:25.967062 2006] debug: Loading module `chanserv/access-levels'<br>[Feb 14 20:12:25.974581 2006] debug: Successfully loaded module `chanserv/access-levels'<br>[Feb 14 20:12:25.978429 2006] debug: Loading module `chanserv/sendpass'
<br>[Feb 14 20:12:25.984940 2006] debug: Successfully loaded module `chanserv/sendpass'<br>[Feb 14 20:12:25.989298 2006] debug: Loading module `memoserv/main'<br>[Feb 14 20:12:25.996230 2006] debug: Successfully loaded module `memoserv/main'
<br>[Feb 14 20:12:25.999969 2006] debug: Loading module `memoserv/forward'<br>[Feb 14 20:12:26.006549 2006] debug: Successfully loaded module `memoserv/forward'<br>[Feb 14 20:12:26.010419 2006] debug: Loading module `memoserv/ignore'
<br>[Feb 14 20:12:26.014360 2006] debug: Successfully loaded module `memoserv/ignore'<br>[Feb 14 20:12:26.015657 2006] debug: Loading module `statserv/main'<br>[Feb 14 20:12:26.020414 2006] debug: Successfully loaded module `statserv/main'
<br>[Feb 14 20:12:26.021535 2006] debug: Loading module `misc/helpserv'<br>[Feb 14 20:12:26.025979 2006] debug: Successfully loaded module `misc/helpserv'<br>[Feb 14 20:12:26.026995 2006] debug: Loading module `httpd/main'
<br>[Feb 14 20:12:26.031818 2006] httpd/main: Listening on <a href="http://72.20.8.98:5347">72.20.8.98:5347</a><br>[Feb 14 20:12:26.033102 2006] debug: Successfully loaded module `httpd/main'<br>[Feb 14 20:12:26.034463 2006] debug: Loading module `httpd/auth-ip'
<br>[Feb 14 20:12:26.039295 2006] debug: Successfully loaded module `httpd/auth-ip'<br>[Feb 14 20:12:26.040407 2006] debug: Loading module `httpd/auth-password'<br>[Feb 14 20:12:26.044648 2006] debug: Successfully loaded module `httpd/auth-password'
<br>[Feb 14 20:12:26.045835 2006] debug: Loading module `misc/xml-export'<br>[Feb 14 20:12:26.050744 2006] debug: Successfully loaded module `misc/xml-export'<br>[Feb 14 20:12:26.051928 2006] debug: Loading module `misc/xml-import'
<br>[Feb 14 20:12:26.057501 2006] debug: Successfully loaded module `misc/xml-import'<br>[Feb 14 20:12:26.058620 2006] debug: Loaded modules<br>[Feb 14 20:12:26.068373 2006] FATAL: Can't connect to server (<a href="http://72.20.8.98:8899">
72.20.8.98:8899</a>): Invalid argument<br><br>--END LOG--<br><br>Code from socktest.c:<br>#include <stdarg.h><br>#include <stdio.h><br>#include <stdlib.h><br>#include <string.h><br>#include <unistd.h
><br>#include <signal.h><br>#include <time.h><br>#include <errno.h><br>#include <grp.h><br>#include <limits.h><br>#include <netdb.h><br>#include <netinet/in.h><br>#include <sys/socket.h>
<br>#include <sys/stat.h>        /* for umask() on some systems */<br>#include <sys/types.h><br>#include <sys/time.h><br><br>int conn(const char *host, int port, const char *lhost, int lport);<br>void disconn(int s);
<br><br>int conn(const char *host, int port, const char *lhost, int lport)<br>{<br> struct hostent *hp;<br> struct sockaddr_in sa, lsa;<br> int sock;<br><br> printf("Conn() called\n");<br><br> memset(&lsa, 0, sizeof(lsa));
<br> if (lhost) {<br> if ((hp = gethostbyname(lhost)) != NULL) {<br> memcpy((char *) &lsa.sin_addr, hp->h_addr, hp->h_length);<br> lsa.sin_family = hp->h_addrtype;<br> } else {
<br> lhost = NULL;<br> }<br> }<br> if (lport)<br> lsa.sin_port = htons((unsigned short) lport);<br><br> printf("Conn() LocalHost stuff setup\n");<br><br> memset(&sa, 0, sizeof(sa));
<br> if (!(hp = gethostbyname(host))) {<br> printf("Error during gethostbyname\n");<br> return -1;<br> }<br> printf("Conn() gethostbyname successful\n");<br><br> memcpy((char *) &sa.sin_addr, hp->h_addr, hp->h_length);
<br> sa.sin_family = hp->h_addrtype;<br> sa.sin_port = htons((unsigned short) port);<br><br> printf("Conn() before socket call\n");<br><br> printf("Check sa family %d AF_INET %d\n", sa.sin_family
, AF_INET);<br> printf("Check sa port %d %d htons check %d\n", port, sa.sin_port, htons((unsigned short) port));<br> printf("Check sa address %s\n", inet_ntoa(sa.sin_addr));<br><br> if ((sock = socket(
sa.sin_family, SOCK_STREAM, 0)) < 0) {<br> printf("Error during socket\n");<br> return -1;<br> }<br> printf("Conn() sock %d\n", sock);<br><br> if ((lhost || lport)<br> && bind(sock, (struct sockaddr *) &lsa, sizeof(lsa)) < 0) {
<br> close(sock);<br> printf("Error during bind\n");<br> return -1;<br> }<br><br> if (connect(sock, (struct sockaddr *) &sa, sizeof(sa)) < 0) {<br> printf("Error during connect\n");
<br> printf("Errno is %d\n", errno);<br> printf("strerror says %s\n", strerror(errno));<br> printf("Check sizeof(sa) %ld\n", sizeof(sa));<br> printf("Check socket %d\n", sock);
<br> printf("Check sa family %d AF_INET %d\n", sa.sin_family, AF_INET);<br> printf("Check sa port %d\n", sa.sin_port);<br> printf("Check sa address %s\n", inet_ntoa(sa.sin_addr
));<br><br> close(sock);<br> return -1;<br> }<br> printf("Successful sock value %d", sock);<br> return sock;<br>}<br><br>/*************************************************************************/
<br><br>void disconn(int s)<br>{<br> shutdown(s, 2);<br> close(s);<br>}<br><br>int main(int ac, char **av, char **envp)<br>{<br> int s;<br> printf("Calling conn()\n");<br> s = conn("<a href="http://72.20.8.98">
72.20.8.98</a>", 8899, "<a href="http://72.20.8.98">72.20.8.98</a>", 8891);<br> printf("after conn()\n");<br> disconn(s);<br> printf("exit\n");<br> return 0;<br>}<br><br><br>--END OF
socktest.c--<br><br><br>And, finally, the output from socktest.c:<br><br>Calling conn()<br>Conn() called<br>Conn() LocalHost stuff setup<br>Conn() gethostbyname successful<br>Conn() before socket call<br>Check sa family 2 AF_INET 2
<br>Check sa port 8899 49954 htons check 49954<br>Check sa address <a href="http://72.20.8.98">72.20.8.98</a><br>Conn() sock 3<br>Error during connect<br>Errno is 22<br>strerror says Invalid argument<br>Check sizeof(sa) 16
<br>Check socket 3<br>Check sa family 2 AF_INET 2<br>Check sa port 49954<br>Check sa address <a href="http://72.20.8.98">72.20.8.98</a><br>after conn()<br>exit<br><br>--END OF socktest output--<br>