Add an additional test to resolv/tst-resolv-network.c
diff mbox series

Message ID 20181107114458.8514-1-ahajkova@redhat.com
State New
Headers show
Series
  • Add an additional test to resolv/tst-resolv-network.c
Related show

Commit Message

Alexandra Hájková Nov. 7, 2018, 11:44 a.m. UTC
From: Alexandra Hájková <ahajkova@redhat.com>

Test for the infinite loop in getnebyname, bug #17630.

ChangeLog:

2018-11-06  Alexandra Hájková  <ahajkova@redhat.com>

        [BZ #17630]
        * resolv/tst-resolv-network.c: Add test for getnetbyname.

---
 resolv/tst-resolv-network.c | 6 ++++++
 1 file changed, 6 insertions(+)

Comments

Florian Weimer Nov. 7, 2018, 1:23 p.m. UTC | #1
* Alexandra Hájková:

> From: Alexandra Hájková <ahajkova@redhat.com>
>
> Test for the infinite loop in getnebyname, bug #17630.

‘getnetbyname’.

Looks good otherwise.

Please also create an wiki account on
<https://sourceware.org/glibc/wiki/>.

Thanks,
Florian

Patch
diff mbox series

diff --git a/resolv/tst-resolv-network.c b/resolv/tst-resolv-network.c
index 4b862d57e6..735e38d0f8 100644
--- a/resolv/tst-resolv-network.c
+++ b/resolv/tst-resolv-network.c
@@ -149,6 +149,9 @@  handle_code (const struct resolv_response_context *ctx,
           resolv_response_add_data (b, &rrtype, sizeof (rrtype));
         }
       break;
+    case 104:
+      send_ptr (b, qname, qclass, qtype, "host.example");
+      break;
     default:
       FAIL_EXIT1 ("invalid QNAME: %s (code %d)", qname, code);
     }
@@ -257,6 +260,9 @@  do_test (void)
                 "error: TRY_AGAIN\n");
   check_netent ("code103.example", getnetbyname ("code103.example"),
                 "error: NO_RECOVERY\n");
+  /* Test bug #17630.  */
+  check_netent ("code104.example", getnetbyname ("code104.example"),
+                "error: TRY_AGAIN\n");
 
   /* Lookup by address, success cases.  */
   check_reverse (1,