projects
/
tedtools.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
1da8d08
)
Allow use * for bindings
author
teodor
<teodor>
Thu, 29 Nov 2007 17:52:39 +0000
(17:52 +0000)
committer
teodor
<teodor>
Thu, 29 Nov 2007 17:52:39 +0000
(17:52 +0000)
tcp.c
patch
|
blob
|
history
udp.c
patch
|
blob
|
history
diff --git
a/tcp.c
b/tcp.c
index
1616dc2
..
fe59586
100644
(file)
--- 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 = (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;
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
(file)
--- 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;
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;
if ( serv_addr.sin_addr.s_addr == INADDR_NONE ) {
struct hostent *ip_host;