]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
STABLE12-windows-loopback-adapter-support-20021126
authorScott D. Williams <sdw@email.unc.edu>
Wed, 4 Dec 2002 14:24:30 +0000 (14:24 +0000)
committerDerrick Brashear <shadow@dementia.org>
Wed, 4 Dec 2002 14:24:30 +0000 (14:24 +0000)
try to bind to loopback on windows

(cherry picked from commit ed4cd74d47fc2253539aef64c95c1cb9ebab97cc)

src/WINNT/afsd/smb.c

index e32a57d47772b145252c0d800e4974de457f690a..b2a95af7229a5a835846fa5ef955882003fb16a7 100644 (file)
@@ -6087,11 +6087,34 @@ void smb_NetbiosInit()
            sprintf(s, "Netbios NCBRESET lana %d error code %d", lana_list.lana[i], code);
            afsi_log(s);
            lana_list.lana[i] = 255;  /* invalid lana */
-        }
-        else {
+        } else {
             sprintf(s, "Netbios NCBRESET lana %d succeeded", lana_list.lana[i]);
             afsi_log(s);
-        }
+           /* check to see if this is the "Microsoft Loopback Adapter"        */
+           memset( ncbp, 0, sizeof (*ncbp) );
+           ncbp->ncb_command = NCBASTAT;
+           ncbp->ncb_lana_num = lana_list.lana[i];
+           strcpy( ncbp->ncb_callname,  "*               " );
+           ncbp->ncb_buffer = (char *) &Adapter;
+           ncbp->ncb_length = sizeof(Adapter);
+           code = Netbios( ncbp );
+           
+           if ( code == 0 ) {
+               wla_found = TRUE;
+               for (j=0; wla_found && (j<6); j++)
+                   wla_found = ( Adapter.status.adapter_address[j] == kWLA_MAC[j] );
+               
+               if ( wla_found ) {
+                   sprintf(s, "Windows Loopback Adapter detected lana %d", lana_list.lana[i]);
+                   afsi_log(s);
+                   
+                   /* select this lana; no need to continue */
+                   lana_list.length = 1;
+                   lana_list.lana[0] = lana_list.lana[i];
+                   break;
+               }
+           }
+       }
     }
 #else
     /* for DJGPP, there is no NCBENUM and NCBRESET is a real reset.  so