[BZ #9881]
[glibc/pb-stable.git] / inet / tst-inet6_rth.c
blob454a13f6b64c2ebe1eacc8b5b1834a27182fefd6
1 #include <stdio.h>
2 #include <netinet/ip6.h>
4 static int
5 do_test (void)
7 int res = 0;
8 char buf[1000];
9 void *p = inet6_rth_init (buf, 24, IPV6_RTHDR_TYPE_0, 0);
10 if (p == NULL)
12 puts ("first inet6_rth_init failed");
13 res = 1;
15 else if (inet6_rth_add (p, &in6addr_any) == 0)
17 puts ("first inet6_rth_add succeeded");
18 res = 1;
21 p = inet6_rth_init (buf, 24, IPV6_RTHDR_TYPE_0, 1);
22 if (p == NULL)
24 puts ("second inet6_rth_init failed");
25 res = 1;
27 else if (inet6_rth_add (p, &in6addr_any) != 0)
29 puts ("second inet6_rth_add failed");
30 res = 1;
32 return res;
35 #define TEST_FUNCTION do_test ()
36 #include "../test-skeleton.c"