From 906dd40db380c58794d252a112bd079b5d5f4dc6 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Sun, 15 Mar 2009 19:16:16 +0000 Subject: [BZ #9881] * inet/inet6_rth.c (inet6_rth_add): Add some error checking. Patch mostly by Yang Hongyang . * inet/Makefile (tests): Add tst-inet6_rth. * inet/tst-inet6_rth.c: New file. alignment of La_x86_64_regs. Store xmm parameters. --- inet/tst-inet6_rth.c | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 inet/tst-inet6_rth.c (limited to 'inet/tst-inet6_rth.c') diff --git a/inet/tst-inet6_rth.c b/inet/tst-inet6_rth.c new file mode 100644 index 0000000000..454a13f6b6 --- /dev/null +++ b/inet/tst-inet6_rth.c @@ -0,0 +1,36 @@ +#include +#include + +static int +do_test (void) +{ + int res = 0; + char buf[1000]; + void *p = inet6_rth_init (buf, 24, IPV6_RTHDR_TYPE_0, 0); + if (p == NULL) + { + puts ("first inet6_rth_init failed"); + res = 1; + } + else if (inet6_rth_add (p, &in6addr_any) == 0) + { + puts ("first inet6_rth_add succeeded"); + res = 1; + } + + p = inet6_rth_init (buf, 24, IPV6_RTHDR_TYPE_0, 1); + if (p == NULL) + { + puts ("second inet6_rth_init failed"); + res = 1; + } + else if (inet6_rth_add (p, &in6addr_any) != 0) + { + puts ("second inet6_rth_add failed"); + res = 1; + } + return res; +} + +#define TEST_FUNCTION do_test () +#include "../test-skeleton.c" -- cgit 1.4.1