summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Dieter Wallnöfer <mdw@samba.org>2010-06-17 09:42:17 +0200
committerMatthias Dieter Wallnöfer <mdw@samba.org>2010-06-18 10:03:08 +0200
commit56e4822566743a42a3e20cc9dc969826969ba156 (patch)
tree36ef80e1a3bd112ceeb5023194ed1a758ce95160
parent01e9d090f1f9f340d9bdb597341b445544cf7a7d (diff)
downloadsamba-56e4822566743a42a3e20cc9dc969826969ba156.tar.gz
samba-56e4822566743a42a3e20cc9dc969826969ba156.tar.bz2
samba-56e4822566743a42a3e20cc9dc969826969ba156.zip
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.
-rw-r--r--source4/rpc_server/netlogon/dcerpc_netlogon.c5
1 files changed, 3 insertions, 2 deletions
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: