projects
/
silc.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
de2bb84
)
Check for IP address in silc_net_gethostbyname.
author
Pekka Riikonen
<priikone@silcnet.org>
Thu, 10 May 2007 15:27:19 +0000
(15:27 +0000)
committer
Pekka Riikonen
<priikone@silcnet.org>
Thu, 10 May 2007 15:27:19 +0000
(15:27 +0000)
lib/silcutil/silcnet.c
patch
|
blob
|
history
diff --git
a/lib/silcutil/silcnet.c
b/lib/silcutil/silcnet.c
index 7fd76a4a3088db1a5a54e2021ccce8214f0253a1..17c17d83201ddb20df6b18c607fa2e223e7101eb 100644
(file)
--- a/
lib/silcutil/silcnet.c
+++ b/
lib/silcutil/silcnet.c
@@
-276,6
+276,14
@@
SilcBool silc_net_gethostbyname(const char *name,
struct in_addr ip;
char *tmp;
+ if (silc_net_is_ip4(name)) {
+ memset(address, 0, address_len);
+ if (address_len < strlen(name))
+ return FALSE;
+ strncpy(address, name, strlen(name));
+ return TRUE;
+ }
+
hp = gethostbyname(name);
if (!hp)
return FALSE;