From bd8e916cb520d89a14a1cd13b2b261253729ac9b Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Wed, 28 Nov 2001 21:51:11 +0000 Subject: merge from APPLIANCE_HEAD (This used to be commit c60aa6c06f376684b6d6d9a2c14305ca9f4657ef) --- source3/lib/interface.c | 2 -- source3/lib/util.c | 41 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 41 insertions(+), 2 deletions(-) (limited to 'source3/lib') diff --git a/source3/lib/interface.c b/source3/lib/interface.c index a93390e643..08636fa306 100644 --- a/source3/lib/interface.c +++ b/source3/lib/interface.c @@ -21,8 +21,6 @@ #include "includes.h" -#define MAX_INTERFACES 128 - static struct iface_struct *probed_ifaces; static int total_probed; diff --git a/source3/lib/util.c b/source3/lib/util.c index 7bd2ed8441..ca99f985ed 100644 --- a/source3/lib/util.c +++ b/source3/lib/util.c @@ -1391,6 +1391,47 @@ BOOL is_myname(char *s) return(ret); } +BOOL is_myname_or_ipaddr(char *s) +{ + char **ptr; + + /* optimize for the common case */ + if (strequal(s, global_myname)) + return True; + + /* maybe its an IP address? */ + if (is_ipaddress(s)) + { + struct iface_struct nics[MAX_INTERFACES]; + int i, n; + uint32 ip; + + ip = interpret_addr(s); + if ((ip==0) || (ip==0xffffffff)) + return False; + + n = get_interfaces(nics, MAX_INTERFACES); + for (i=0; i