summaryrefslogtreecommitdiff
path: root/source3/lib
diff options
context:
space:
mode:
authorHerb Lewis <herb@samba.org>2001-02-15 19:50:34 +0000
committerHerb Lewis <herb@samba.org>2001-02-15 19:50:34 +0000
commita82df9c67367e0828afcc65b0635187c73e2813a (patch)
tree11817619922e152488fbb082917f89446e18b05c /source3/lib
parentc237db1c11d59c9715c65dc808817483e04903e2 (diff)
downloadsamba-a82df9c67367e0828afcc65b0635187c73e2813a.tar.gz
samba-a82df9c67367e0828afcc65b0635187c73e2813a.tar.bz2
samba-a82df9c67367e0828afcc65b0635187c73e2813a.zip
samba/source/nmbd/nmbd.c change remote_machine name to nmbd instead
of nmb so we write to same log file that was originally created as log.nmbd samba/source/smbd/server.c change remote_machine name to smbd instead of smb so we write to same log file that was originally created as log.smbd samba/source/lib/interface.c allow binding to all interface IP addresses even if on same subnet. This allows you to specify which IP's you want in interfaces line and use bind interfaces only (This used to be commit 01dfd59712f3730498784d7632da8fe0113d55b6)
Diffstat (limited to 'source3/lib')
-rw-r--r--source3/lib/interface.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/source3/lib/interface.c b/source3/lib/interface.c
index 31ec846fdc..3e45d627d3 100644
--- a/source3/lib/interface.c
+++ b/source3/lib/interface.c
@@ -41,13 +41,15 @@ static struct interface *local_interfaces = NULL;
/****************************************************************************
Try and find an interface that matches an ip. If we cannot, return NULL
**************************************************************************/
-static struct interface *iface_find(struct in_addr ip)
+static struct interface *iface_find(struct in_addr ip, BOOL CheckMask)
{
struct interface *i;
if (zero_ip(ip)) return local_interfaces;
for (i=local_interfaces;i;i=i->next)
- if (same_net(i->ip,ip,i->nmask)) return i;
+ if (CheckMask) {
+ if (same_net(i->ip,ip,i->nmask)) return i;
+ } else if ((i->ip).s_addr == ip.s_addr) return i;
return NULL;
}
@@ -59,7 +61,7 @@ add an interface to the linked list of interfaces
static void add_interface(struct in_addr ip, struct in_addr nmask)
{
struct interface *iface;
- if (iface_find(ip)) {
+ if (iface_find(ip, False)) {
DEBUG(3,("not adding duplicate interface %s\n",inet_ntoa(ip)));
return;
}
@@ -365,12 +367,12 @@ unsigned iface_hash(void)
struct in_addr *iface_bcast(struct in_addr ip)
{
- struct interface *i = iface_find(ip);
+ struct interface *i = iface_find(ip, True);
return(i ? &i->bcast : &local_interfaces->bcast);
}
struct in_addr *iface_ip(struct in_addr ip)
{
- struct interface *i = iface_find(ip);
+ struct interface *i = iface_find(ip, True);
return(i ? &i->ip : &local_interfaces->ip);
}