summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Dieter Wallnöfer <mdw@samba.org>2010-06-16 21:47:22 +0200
committerMatthias Dieter Wallnöfer <mdw@samba.org>2010-06-16 21:47:22 +0200
commitd9c81e3ea54fabc30121872a56bf3a393f26983b (patch)
tree0b1e855e28ee5d0c2ce9eadaf81e96a3da4bb8f4
parentad7859dfff3598d351aa91b025e4afba7ab46382 (diff)
downloadsamba-d9c81e3ea54fabc30121872a56bf3a393f26983b.tar.gz
samba-d9c81e3ea54fabc30121872a56bf3a393f26983b.tar.bz2
samba-d9c81e3ea54fabc30121872a56bf3a393f26983b.zip
s4:dcesrv_netr_DsRAddressToSitenamesExW - fix the read of the IP packet version
This should make it clearer by the use of the standardised "sa_family_t" type and hopefully fixes the problems on platforms other than Linux (NetBSD in the buildfarm for example).
-rw-r--r--source4/rpc_server/netlogon/dcerpc_netlogon.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/source4/rpc_server/netlogon/dcerpc_netlogon.c b/source4/rpc_server/netlogon/dcerpc_netlogon.c
index 8bfa44988e..b1ac5836f3 100644
--- a/source4/rpc_server/netlogon/dcerpc_netlogon.c
+++ b/source4/rpc_server/netlogon/dcerpc_netlogon.c
@@ -1659,7 +1659,7 @@ static WERROR dcesrv_netr_DsRAddressToSitenamesExW(struct dcesrv_call_state *dce
struct ldb_context *sam_ctx;
struct netr_DsRAddressToSitenamesExWCtr *ctr;
struct loadparm_context *lp_ctx = dce_call->conn->dce_ctx->lp_ctx;
- uint16_t sin_family;
+ sa_family_t sin_family;
struct sockaddr_in *addr;
#ifdef HAVE_IPV6
struct sockaddr_in6 *addr6;
@@ -1692,10 +1692,11 @@ static WERROR dcesrv_netr_DsRAddressToSitenamesExW(struct dcesrv_call_state *dce
ctr->sitename[i].string = NULL;
ctr->subnetname[i].string = NULL;
- if (r->in.addresses[i].size < sizeof(sin_family)) {
+ if (r->in.addresses[i].size < sizeof(sa_family_t)) {
continue;
}
- sin_family = SVAL(r->in.addresses[i].buffer, 0);
+ /* the first two byte of the buffer are the "sin_family" */
+ sin_family = (sa_family_t) *r->in.addresses[i].buffer;
switch (sin_family) {
case AF_INET: