From a93baf3cc51391d92627df3709cf87a68d79e310 Mon Sep 17 00:00:00 2001 From: teodor Date: Thu, 29 Nov 2007 17:52:39 +0000 Subject: [PATCH] Allow use * for bindings --- tcp.c | 2 +- udp.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tcp.c b/tcp.c index 1616dc2..fe59586 100644 --- a/tcp.c +++ b/tcp.c @@ -159,7 +159,7 @@ TC_fillConnection(TC_Connection *sc, char *name, u_int32_t port) { sc = (TC_Connection *)tmalloc(sizeof(TC_Connection)); memset(sc, 0, sizeof(TC_Connection)); sc->serv_addr.sin_family = AF_INET; - sc->serv_addr.sin_addr.s_addr = (name) ? inet_addr(name) : htonl(INADDR_ANY); + sc->serv_addr.sin_addr.s_addr = (name && *name != '*' ) ? inet_addr(name) : htonl(INADDR_ANY); if ( sc->serv_addr.sin_addr.s_addr == INADDR_NONE ) { struct hostent *host; diff --git a/udp.c b/udp.c index 53f6c12..6e127da 100644 --- a/udp.c +++ b/udp.c @@ -57,7 +57,7 @@ TC_AcceptUdp(char *host, int port) { memset(&serv_addr, 0, sizeof(serv_addr)); serv_addr.sin_family = AF_INET; - serv_addr.sin_addr.s_addr = inet_addr(host); + serv_addr.sin_addr.s_addr = (host && *host!='*') ? inet_addr(host) : htonl(INADDR_ANY); if ( serv_addr.sin_addr.s_addr == INADDR_NONE ) { struct hostent *ip_host; -- 2.46.1