Print this page
NEX-20555 idmap fall-back to DC discovery is broken
Reviewed by: Evan Layton <evan.layton@nexenta.com>
Reviewed by: Matt Barden <matt.barden@nexenta.com>
NEX-2892 NexentaStor losing connectivity to multihomed AD servers
Reviewed by: Bayard Bell <bayard.bell@nexenta.com>
Reviewed by: Kevin Crowe <kevin.crowe@nexenta.com>
NEX-1638 Updated DC Locator
 Includes work by: matt.barden@nexenta.com, kevin.crowe@nexenta.com
        
@@ -8,11 +8,11 @@
  * source.  A copy of the CDDL is also available via the Internet at
  * http://www.illumos.org/license/CDDL.
  */
 
 /*
- * Copyright 2014 Nexenta Systems, Inc.  All rights reserved.
+ * Copyright 2019 Nexenta Systems, Inc.  All rights reserved.
  */
 
 
 #include <sys/note.h>
 #include <stdarg.h>
@@ -21,10 +21,11 @@
 #include <netinet/in.h>
 #include <arpa/inet.h>
 
 int debug;
 char *domainname = NULL;
+char *sitename = NULL;
 
 void print_ds(ad_disc_ds_t *);
 void mylogger(int pri, const char *format, ...);
 
 int
@@ -46,20 +47,24 @@
                         break;
                 }
         }
 
         if (optind < argc)
-                domainname = argv[optind];
+                domainname = argv[optind++];
+        if (optind < argc)
+                sitename = argv[optind++];
 
         adutils_set_logger(mylogger);
         adutils_set_debug(AD_DEBUG_ALL, debug);
 
         ad_ctx = ad_disc_init();
         ad_disc_set_StatusFP(ad_ctx, stdout);
 
         if (domainname)
                 (void) ad_disc_set_DomainName(ad_ctx, domainname);
+        if (sitename)
+                (void) ad_disc_set_SiteName(ad_ctx, sitename);
 
         ad_disc_refresh(ad_ctx);
 
         dc = ad_disc_get_DomainController(ad_ctx,
             AD_DISC_PREFER_SITE, &autodisc);