[2/2] nss: Use shared prefix in IPv4 address in tst-reload1

Message ID dd8d1a60722612e363ebcfe69d2b1affedda41cf.1663931559.git.fweimer@redhat.com
State Committed
Commit c02e29a0ba47d636281e1a026444a1a0a254aa12
Headers
Series [1/2] nss: Enhance tst-reload1 coverage and logging |

Checks

Context Check Description
dj/TryBot-apply_patch success Patch applied to master at the time it was sent
dj/TryBot-32bit success Build for i686

Commit Message

Florian Weimer Sept. 23, 2022, 11:13 a.m. UTC
  Otherwise, sorting based on the longest-matching prefix in
getaddrinfo can reorder the addresses in ways the test does not
expect, depending on the IPv4 address of the host.
---
 nss/tst-reload1.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
  

Comments

Siddhesh Poyarekar Sept. 23, 2022, 1:34 p.m. UTC | #1
On 2022-09-23 07:13, Florian Weimer via Libc-alpha wrote:
> Otherwise, sorting based on the longest-matching prefix in
> getaddrinfo can reorder the addresses in ways the test does not
> expect, depending on the IPv4 address of the host.
> ---

LGTM.

Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>

>   nss/tst-reload1.c | 8 ++++----
>   1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/nss/tst-reload1.c b/nss/tst-reload1.c
> index 9cc6115c96..c9db197d55 100644
> --- a/nss/tst-reload1.c
> +++ b/nss/tst-reload1.c
> @@ -43,12 +43,12 @@ static struct passwd pwd_table_1[] = {
>   
>   static const char *hostaddr_5[] =
>     {
> -   "ABCD", "abcd", "1234", NULL
> +   "ABCd", "ABCD", "ABC4", NULL
>     };
>   
>   static const char *hostaddr_15[] =
>     {
> -   "4321", "ghij", NULL
> +   "4321", "4322", NULL
>     };
>   
>   static const char *hostaddr_25[] =
> @@ -86,12 +86,12 @@ static const char *hostaddr_6[] =
>   
>   static const char *hostaddr_16[] =
>     {
> -   "7890", "a1b2", NULL
> +   "7890", "7891", NULL
>     };
>   
>   static const char *hostaddr_26[] =
>     {
> -   "qwer", "tyui", NULL
> +   "qwer", "qweR", NULL
>     };
>   
>   static struct hostent host_table_2[] = {
  

Patch

diff --git a/nss/tst-reload1.c b/nss/tst-reload1.c
index 9cc6115c96..c9db197d55 100644
--- a/nss/tst-reload1.c
+++ b/nss/tst-reload1.c
@@ -43,12 +43,12 @@  static struct passwd pwd_table_1[] = {
 
 static const char *hostaddr_5[] =
   {
-   "ABCD", "abcd", "1234", NULL
+   "ABCd", "ABCD", "ABC4", NULL
   };
 
 static const char *hostaddr_15[] =
   {
-   "4321", "ghij", NULL
+   "4321", "4322", NULL
   };
 
 static const char *hostaddr_25[] =
@@ -86,12 +86,12 @@  static const char *hostaddr_6[] =
 
 static const char *hostaddr_16[] =
   {
-   "7890", "a1b2", NULL
+   "7890", "7891", NULL
   };
 
 static const char *hostaddr_26[] =
   {
-   "qwer", "tyui", NULL
+   "qwer", "qweR", NULL
   };
 
 static struct hostent host_table_2[] = {