From d463c0f7c62472b699c89ae406e7a622ff81092d Mon Sep 17 00:00:00 2001 From: Jeffrey Altman Date: Sat, 22 Apr 2006 04:45:47 +0000 Subject: [PATCH] windows-vista-20060421 Vista has a bug in the Netbios ADAPTER_STATUS output in which the first four bytes of the MAC address with 127.0.0.1. We must check for that when searching for the Loopback Adapter. --- src/WINNT/afsd/lanahelper.cpp | 4 +++- src/WINNT/afsd/smb3.c | 8 ++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/WINNT/afsd/lanahelper.cpp b/src/WINNT/afsd/lanahelper.cpp index 148a0c49cc..c4495e9c88 100644 --- a/src/WINNT/afsd/lanahelper.cpp +++ b/src/WINNT/afsd/lanahelper.cpp @@ -435,6 +435,7 @@ extern "C" BOOL lana_IsLoopback(lana_number_t lana) NAME_BUFFER names[MAX_LANA+1]; } astat; unsigned char kWLA_MAC[6] = { 0x02, 0x00, 0x4c, 0x4f, 0x4f, 0x50 }; + unsigned char kVista_WLA_MAC[6] = { 0x7F, 0x00, 0x00, 0x01, 0x4f, 0x50 }; int status; HKEY hkConfig; LONG rv; @@ -483,7 +484,8 @@ extern "C" BOOL lana_IsLoopback(lana_number_t lana) #endif return FALSE; } - return (memcmp(astat.status.adapter_address, kWLA_MAC, 6) == 0); + return (memcmp(astat.status.adapter_address, kWLA_MAC, 6) == 0 || + memcmp(astat.status.adapter_address, kVista_WLA_MAC, 6) == 0); } // Get the netbios named used/to-be-used by the AFS SMB server. diff --git a/src/WINNT/afsd/smb3.c b/src/WINNT/afsd/smb3.c index 090ff853f7..f7dad97b36 100644 --- a/src/WINNT/afsd/smb3.c +++ b/src/WINNT/afsd/smb3.c @@ -1481,10 +1481,10 @@ long smb_ReceiveRAPNetShareEnum(smb_vc_t *vcp, smb_tran2Packet_t *p, smb_packet_ int outDataTotal; /* total data bytes */ int code = 0; DWORD rv; - DWORD allSubmount; - USHORT nShares; - DWORD nRegShares; - DWORD nSharesRet; + DWORD allSubmount = 0; + USHORT nShares = 0; + DWORD nRegShares = 0; + DWORD nSharesRet = 0; HKEY hkParam; HKEY hkSubmount = NULL; smb_rap_share_info_1_t * shares;