diff options
author | Andrew Tridgell <tridge@samba.org> | 1996-08-16 13:03:26 +0000 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 1996-08-16 13:03:26 +0000 |
commit | be2b67940302b2e63890cb865fe3948c2206ea91 (patch) | |
tree | 9da57397a767604da87e19b7addf4b2bd149e4d2 /source/lib | |
parent | b2ca1f0c6148bf5a95bef0e71f32df0de3d6fbc2 (diff) | |
download | samba-be2b67940302b2e63890cb865fe3948c2206ea91.tar.gz samba-be2b67940302b2e63890cb865fe3948c2206ea91.tar.xz samba-be2b67940302b2e63890cb865fe3948c2206ea91.zip |
- added the "remote announce" option
- made the lp_string() code able to handle any length string
- got rid of the obsolete lmhosts code, instead users should use
"interfaces" and "remote announce". lmhosts now is just used as a IP
to netbios name map
- cleanup the inet_address() code
Diffstat (limited to 'source/lib')
-rw-r--r-- | source/lib/util.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/source/lib/util.c b/source/lib/util.c index 5b765e0ac6f..aeaac29ae12 100644 --- a/source/lib/util.c +++ b/source/lib/util.c @@ -2889,15 +2889,22 @@ uint32 interpret_addr(char *str) { struct hostent *hp; uint32 res; + int i; + BOOL pure_address = True; if (strcmp(str,"0.0.0.0") == 0) return(0); if (strcmp(str,"255.255.255.255") == 0) return(0xFFFFFFFF); + for (i=0; pure_address && str[i]; i++) + if (!(isdigit(str[i]) || str[i] == '.')) + pure_address = False; + /* if it's in the form of an IP address then get the lib to interpret it */ - if (isdigit(str[0])) { + if (pure_address) { res = inet_addr(str); } else { - /* otherwise assume it's a network name of some sort and use Get_Hostbyname */ + /* otherwise assume it's a network name of some sort and use + Get_Hostbyname */ if ((hp = Get_Hostbyname(str)) == 0) { DEBUG(3,("Get_Hostbyname: Unknown host. %s\n",str)); return 0; |