summaryrefslogtreecommitdiff
path: root/source4/torture/rpc
diff options
context:
space:
mode:
authorMatthias Dieter Wallnöfer <mdw@samba.org>2010-06-17 09:33:10 +0200
committerMatthias Dieter Wallnöfer <mdw@samba.org>2010-06-18 10:03:07 +0200
commit01e9d090f1f9f340d9bdb597341b445544cf7a7d (patch)
treefd3b45e7cbe600d6cf09db236fb4ba1f46367816 /source4/torture/rpc
parent917f6015a6292a5b9b88607060dc5f87dc78fb9b (diff)
downloadsamba-01e9d090f1f9f340d9bdb597341b445544cf7a7d.tar.gz
samba-01e9d090f1f9f340d9bdb597341b445544cf7a7d.tar.bz2
samba-01e9d090f1f9f340d9bdb597341b445544cf7a7d.zip
s4:torture/rpc/netlogon.c - make sure that the address family is set in little endian in the "AddressToSitenames" tests
Diffstat (limited to 'source4/torture/rpc')
-rw-r--r--source4/torture/rpc/netlogon.c36
1 files changed, 18 insertions, 18 deletions
diff --git a/source4/torture/rpc/netlogon.c b/source4/torture/rpc/netlogon.c
index dddad61d25..09b28828c3 100644
--- a/source4/torture/rpc/netlogon.c
+++ b/source4/torture/rpc/netlogon.c
@@ -2393,21 +2393,21 @@ static bool test_netr_DsRAddressToSitenamesW(struct torture_context *tctx,
addrs[0].size = sizeof(struct sockaddr_in);
addrs[0].buffer = talloc_zero_array(tctx, uint8_t, addrs[0].size);
addr = (struct sockaddr_in *) addrs[0].buffer;
- addr->sin_family = AF_INET;
+ addrs[0].buffer[0] = AF_INET;
ret = inet_pton(AF_INET, "127.0.0.1", &addr->sin_addr);
torture_assert(tctx, ret > 0, "inet_pton failed");
addrs[1].size = sizeof(struct sockaddr_in);
addrs[1].buffer = talloc_zero_array(tctx, uint8_t, addrs[1].size);
addr = (struct sockaddr_in *) addrs[1].buffer;
- addr->sin_family = AF_INET;
+ addrs[1].buffer[0] = AF_INET;
ret = inet_pton(AF_INET, "0.0.0.0", &addr->sin_addr);
torture_assert(tctx, ret > 0, "inet_pton failed");
addrs[2].size = sizeof(struct sockaddr_in);
addrs[2].buffer = talloc_zero_array(tctx, uint8_t, addrs[2].size);
addr = (struct sockaddr_in *) addrs[2].buffer;
- addr->sin_family = AF_INET;
+ addrs[2].buffer[0] = AF_INET;
ret = inet_pton(AF_INET, "255.255.255.255", &addr->sin_addr);
torture_assert(tctx, ret > 0, "inet_pton failed");
@@ -2415,21 +2415,21 @@ static bool test_netr_DsRAddressToSitenamesW(struct torture_context *tctx,
addrs[3].size = sizeof(struct sockaddr_in6);
addrs[3].buffer = talloc_zero_array(tctx, uint8_t, addrs[3].size);
addr6 = (struct sockaddr_in6 *) addrs[3].buffer;
- addr6->sin6_family = AF_INET6;
+ addrs[3].buffer[0] = AF_INET6;
ret = inet_pton(AF_INET6, "::1", &addr6->sin6_addr);
torture_assert(tctx, ret > 0, "inet_pton failed");
addrs[4].size = sizeof(struct sockaddr_in6);
addrs[4].buffer = talloc_zero_array(tctx, uint8_t, addrs[4].size);
addr6 = (struct sockaddr_in6 *) addrs[4].buffer;
- addr6->sin6_family = AF_INET6;
+ addrs[4].buffer[0] = AF_INET6;
ret = inet_pton(AF_INET6, "::", &addr6->sin6_addr);
torture_assert(tctx, ret > 0, "inet_pton failed");
addrs[5].size = sizeof(struct sockaddr_in6);
addrs[5].buffer = talloc_zero_array(tctx, uint8_t, addrs[5].size);
addr6 = (struct sockaddr_in6 *) addrs[5].buffer;
- addr6->sin6_family = AF_INET6;
+ addrs[5].buffer[0] = AF_INET6;
ret = inet_pton(AF_INET6, "ff02::1", &addr6->sin6_addr);
torture_assert(tctx, ret > 0, "inet_pton failed");
#else
@@ -2438,21 +2438,21 @@ static bool test_netr_DsRAddressToSitenamesW(struct torture_context *tctx,
addrs[3].size = sizeof(struct sockaddr_in);
addrs[3].buffer = talloc_zero_array(tctx, uint8_t, addrs[3].size);
addr = (struct sockaddr_in *) addrs[3].buffer;
- addr->sin_family = AF_INET;
+ addrs[3].buffer[0] = AF_INET;
ret = inet_pton(AF_INET, "127.0.0.1", &addr->sin_addr);
torture_assert(tctx, ret > 0, "inet_pton failed");
addrs[4].size = sizeof(struct sockaddr_in);
addrs[4].buffer = talloc_zero_array(tctx, uint8_t, addrs[4].size);
addr = (struct sockaddr_in *) addrs[4].buffer;
- addr->sin_family = AF_INET;
+ addrs[4].buffer[0] = AF_INET;
ret = inet_pton(AF_INET, "0.0.0.0", &addr->sin_addr);
torture_assert(tctx, ret > 0, "inet_pton failed");
addrs[5].size = sizeof(struct sockaddr_in);
addrs[5].buffer = talloc_zero_array(tctx, uint8_t, addrs[5].size);
addr = (struct sockaddr_in *) addrs[5].buffer;
- addr->sin_family = AF_INET;
+ addrs[5].buffer[0] = AF_INET;
ret = inet_pton(AF_INET, "255.255.255.255", &addr->sin_addr);
torture_assert(tctx, ret > 0, "inet_pton failed");
#endif
@@ -2570,21 +2570,21 @@ static bool test_netr_DsRAddressToSitenamesExW(struct torture_context *tctx,
addrs[0].size = sizeof(struct sockaddr_in);
addrs[0].buffer = talloc_zero_array(tctx, uint8_t, addrs[0].size);
addr = (struct sockaddr_in *) addrs[0].buffer;
- addr->sin_family = AF_INET;
+ addrs[0].buffer[0] = AF_INET;
ret = inet_pton(AF_INET, "127.0.0.1", &addr->sin_addr);
torture_assert(tctx, ret > 0, "inet_pton failed");
addrs[1].size = sizeof(struct sockaddr_in);
addrs[1].buffer = talloc_zero_array(tctx, uint8_t, addrs[1].size);
addr = (struct sockaddr_in *) addrs[1].buffer;
- addr->sin_family = AF_INET;
+ addrs[1].buffer[0] = AF_INET;
ret = inet_pton(AF_INET, "0.0.0.0", &addr->sin_addr);
torture_assert(tctx, ret > 0, "inet_pton failed");
addrs[2].size = sizeof(struct sockaddr_in);
addrs[2].buffer = talloc_zero_array(tctx, uint8_t, addrs[2].size);
addr = (struct sockaddr_in *) addrs[2].buffer;
- addr->sin_family = AF_INET;
+ addrs[2].buffer[0] = AF_INET;
ret = inet_pton(AF_INET, "255.255.255.255", &addr->sin_addr);
torture_assert(tctx, ret > 0, "inet_pton failed");
@@ -2592,21 +2592,21 @@ static bool test_netr_DsRAddressToSitenamesExW(struct torture_context *tctx,
addrs[3].size = sizeof(struct sockaddr_in6);
addrs[3].buffer = talloc_zero_array(tctx, uint8_t, addrs[3].size);
addr6 = (struct sockaddr_in6 *) addrs[3].buffer;
- addr6->sin6_family = AF_INET6;
+ addrs[3].buffer[0] = AF_INET6;
ret = inet_pton(AF_INET6, "::1", &addr6->sin6_addr);
torture_assert(tctx, ret > 0, "inet_pton failed");
addrs[4].size = sizeof(struct sockaddr_in6);
addrs[4].buffer = talloc_zero_array(tctx, uint8_t, addrs[4].size);
addr6 = (struct sockaddr_in6 *) addrs[4].buffer;
- addr6->sin6_family = AF_INET6;
+ addrs[4].buffer[0] = AF_INET6;
ret = inet_pton(AF_INET6, "::", &addr6->sin6_addr);
torture_assert(tctx, ret > 0, "inet_pton failed");
addrs[5].size = sizeof(struct sockaddr_in6);
addrs[5].buffer = talloc_zero_array(tctx, uint8_t, addrs[5].size);
addr6 = (struct sockaddr_in6 *) addrs[5].buffer;
- addr6->sin6_family = AF_INET6;
+ addrs[5].buffer[0] = AF_INET6;
ret = inet_pton(AF_INET6, "ff02::1", &addr6->sin6_addr);
torture_assert(tctx, ret > 0, "inet_pton failed");
#else
@@ -2615,21 +2615,21 @@ static bool test_netr_DsRAddressToSitenamesExW(struct torture_context *tctx,
addrs[3].size = sizeof(struct sockaddr_in);
addrs[3].buffer = talloc_zero_array(tctx, uint8_t, addrs[3].size);
addr = (struct sockaddr_in *) addrs[3].buffer;
- addr->sin_family = AF_INET;
+ addrs[3].buffer[0] = AF_INET;
ret = inet_pton(AF_INET, "127.0.0.1", &addr->sin_addr);
torture_assert(tctx, ret > 0, "inet_pton failed");
addrs[4].size = sizeof(struct sockaddr_in);
addrs[4].buffer = talloc_zero_array(tctx, uint8_t, addrs[4].size);
addr = (struct sockaddr_in *) addrs[4].buffer;
- addr->sin_family = AF_INET;
+ addrs[4].buffer[0] = AF_INET;
ret = inet_pton(AF_INET, "0.0.0.0", &addr->sin_addr);
torture_assert(tctx, ret > 0, "inet_pton failed");
addrs[5].size = sizeof(struct sockaddr_in);
addrs[5].buffer = talloc_zero_array(tctx, uint8_t, addrs[5].size);
addr = (struct sockaddr_in *) addrs[5].buffer;
- addr->sin_family = AF_INET;
+ addrs[5].buffer[0] = AF_INET;
ret = inet_pton(AF_INET, "255.255.255.255", &addr->sin_addr);
torture_assert(tctx, ret > 0, "inet_pton failed");
#endif