samba/source/nmbd/nmbd.c change remote_machine name to nmbd instead
authorHerb Lewis <herb@samba.org>
Thu, 15 Feb 2001 19:50:34 +0000 (19:50 +0000)
committerHerb Lewis <herb@samba.org>
Thu, 15 Feb 2001 19:50:34 +0000 (19:50 +0000)
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

source/lib/interface.c
source/nmbd/nmbd.c
source/smbd/server.c

index 31ec846fdcae642fd90f35aa1290d64f5a0bf0aa..3e45d627d371ca0c31d0a8cd8dae3024a9f29ecb 100644 (file)
@@ -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);
 }
index f772788341e283152c954f199e0af10da7061db5..32d66d39fd528f9846a6abd7062cc4ad4b0afe8f 100644 (file)
@@ -272,7 +272,7 @@ static BOOL reload_nmbd_services(BOOL test)
   BOOL ret;
   extern fstring remote_machine;
 
-  fstrcpy( remote_machine, "nmb" );
+  fstrcpy( remote_machine, "nmbd" );
 
   if ( lp_loaded() )
   {
index 8eacd4ed58a0ae1699f09fb97be58356497eca4f..6457dd6295e0c9fc1fde2ea4ae0138365691bdf8 100644 (file)
@@ -636,7 +636,7 @@ static void usage(char *pname)
                slprintf(debugf, sizeof(debugf), "%s/log.smbd", LOGFILEBASE);
        }
 
-       pstrcpy(remote_machine, "smb");
+       pstrcpy(remote_machine, "smbd");
 
        setup_logging(argv[0],False);