mirror of
https://github.com/samba-team/samba.git
synced 2024-12-23 17:34:34 +03:00
s4:torture/rpc/netlogon.c - make sure that the address family is set in little endian in the "AddressToSitenames" tests
This commit is contained in:
parent
917f6015a6
commit
01e9d090f1
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user