From: Matthias Dieter Wallnöfer Date: Thu, 17 Jun 2010 07:42:17 +0000 (+0200) Subject: s4:dcesrv_netr_DsRAddressToSitenamesExW - fix the detection of the address family... X-Git-Url: http://git.samba.org/?p=kamenim%2Fsamba.git;a=commitdiff_plain;h=56e4822566743a42a3e20cc9dc969826969ba156 s4:dcesrv_netr_DsRAddressToSitenamesExW - fix the detection of the address family in a better way Obviously the last attempt wasn't enough. Now we do really only read the first byte in the address buffer which on little endian transmission does always contain the address family (MS-NRPC 2.2.1.2.4.1). This should now be working platform-independently. --- diff --git a/source4/rpc_server/netlogon/dcerpc_netlogon.c b/source4/rpc_server/netlogon/dcerpc_netlogon.c index b1ac5836f3..28e517f0c9 100644 --- a/source4/rpc_server/netlogon/dcerpc_netlogon.c +++ b/source4/rpc_server/netlogon/dcerpc_netlogon.c @@ -1695,8 +1695,9 @@ static WERROR dcesrv_netr_DsRAddressToSitenamesExW(struct dcesrv_call_state *dce if (r->in.addresses[i].size < sizeof(sa_family_t)) { continue; } - /* the first two byte of the buffer are the "sin_family" */ - sin_family = (sa_family_t) *r->in.addresses[i].buffer; + /* The first two byte of the buffer are reserved for the + * "sin_family" but for now only the first one is used. */ + sin_family = r->in.addresses[i].buffer[0]; switch (sin_family) { case AF_INET: