X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=Usermode%2FApplications%2Firc_src%2Fmain.c;h=3f46d1587feac7b026e6e444c736a45c6a4d0722;hb=2da16f7b05b8c3f17ac136128a849db332b067ad;hp=2bc0ee2389fd2191ea476aba143e191cc4afd339;hpb=51ab5f489bc356940c95cc936fd0508e8f07ea97;p=tpg%2Facess2.git diff --git a/Usermode/Applications/irc_src/main.c b/Usermode/Applications/irc_src/main.c index 2bc0ee23..3f46d158 100644 --- a/Usermode/Applications/irc_src/main.c +++ b/Usermode/Applications/irc_src/main.c @@ -706,38 +706,21 @@ int writef(int FD, const char *Format, ...) int OpenTCP(const char *AddressString, short PortNumber) { int fd, addrType; - char *iface; char addrBuffer[8]; // Parse IP Address addrType = Net_ParseAddress(AddressString, addrBuffer); if( addrType == 0 ) { fprintf(stderr, "Unable to parse '%s' as an IP address\n", AddressString); + _SysDebug("Unable to parse '%s' as an IP address\n", AddressString); return -1; } // Finds the interface for the destination address - iface = Net_GetInterface(addrType, addrBuffer); - if( iface == NULL ) { - fprintf(stderr, "Unable to find a route to '%s'\n", AddressString); - return -1; - } - -// printf("iface = '%s'\n", iface); - - // Open client socket - // TODO: Move this out to libnet? - { - int len = snprintf(NULL, 100, "/Devices/ip/%s/tcpc", iface); - char path[len+1]; - snprintf(path, 100, "/Devices/ip/%s/tcpc", iface); - fd = open(path, OPENFLAG_READ|OPENFLAG_WRITE); - } - - free(iface); - + fd = Net_OpenSocket(addrType, addrBuffer, "tcpc"); if( fd == -1 ) { - fprintf(stderr, "Unable to open TCP Client for reading\n"); + fprintf(stderr, "Unable to open TCP Client to '%s'\n", AddressString); + _SysDebug("Unable to open TCP client to '%s'\n", AddressString); return -1; }