1 diff --git a/ping6.c b/ping6.c
2 index c5ff881..ef2243f 100644
5 @@ -71,9 +71,11 @@ char copyright[] =
6 #include <linux/filter.h>
7 #include <netinet/ip6.h>
8 #include <netinet/icmp6.h>
12 #include "ping6_niquery.h"
13 +#endif /* __UCLIBC__ */
16 #define SOL_IPV6 IPPROTO_IPV6
17 @@ -154,6 +156,7 @@ int pmtudisc=-1;
22 #include <openssl/md5.h>
24 /* Node Information query */
25 @@ -165,6 +168,7 @@ int ni_subject_type = 0;
29 +#endif /* __UCLIBC__ */
31 static struct in6_addr in6_anyaddr;
32 static __inline__ int ipv6_addr_any(struct in6_addr *addr)
33 @@ -223,6 +227,7 @@ unsigned int if_name2index(const char *ifname)
38 struct niquery_option {
41 @@ -512,6 +517,7 @@ char *ni_groupaddr(const char *name)
42 strcat(nigroup_buf, q);
45 +#endif /* __UCLIBC__ */
47 int main(int argc, char *argv[])
49 @@ -595,12 +601,14 @@ int main(int argc, char *argv[])
51 printf("ping6 utility, iputils-ss%s\n", SNAPSHOT);
55 if (niquery_option_handler(optarg) < 0) {
60 +#endif /* __UCLIBC__ */
64 @@ -663,6 +671,7 @@ int main(int argc, char *argv[])
71 for (i = 0; i < 8; i++)
72 @@ -674,15 +683,20 @@ int main(int argc, char *argv[])
73 ni_subject_type = NI_SUBJ_IPV6;
76 +#endif /* __UCLIBC__ */
84 if (ni_query < 0 && ni_subject_type != NI_SUBJ_NAME)
85 +#endif /* __UCLIBC__ */
89 +#endif /* __UCLIBC__ */
92 memset(&hints, 0, sizeof(hints));
93 @@ -817,7 +831,11 @@ int main(int argc, char *argv[])
98 if (datalen >= sizeof(struct timeval) && (ni_query < 0)) {
100 + if (datalen >= sizeof(struct timeval)) {
101 +#endif /* __UCLIBC__ */
102 /* can we time transfer */
105 @@ -866,9 +884,11 @@ int main(int argc, char *argv[])
106 ICMP6_FILTER_SETPASS(ICMP6_PARAM_PROB, &filter);
111 ICMP6_FILTER_SETPASS(ICMPV6_NI_REPLY, &filter);
113 +#endif /* __UCLIBC__ */
114 ICMP6_FILTER_SETPASS(ICMP6_ECHO_REPLY, &filter);
116 err = setsockopt(icmp_sock, IPPROTO_ICMPV6, ICMP6_FILTER, &filter,
117 @@ -1100,6 +1120,7 @@ int build_echo(__u8 *_icmph)
122 int build_niquery(__u8 *_nih)
125 @@ -1125,6 +1146,7 @@ int build_niquery(__u8 *_nih)
129 +#endif /* __UCLIBC__ */
133 @@ -1132,9 +1154,11 @@ int send_probe(void)
135 CLR((ntransmitted+1) % mx_dup_ck);
139 len = build_niquery(outpack);
141 +#endif /* __UCLIBC__ */
142 len = build_echo(outpack);
145 @@ -1176,6 +1200,7 @@ static void putchar_safe(char c)
150 void pr_niquery_reply_name(struct ni_hdr *nih, int len)
152 __u8 *h = (__u8 *)(nih + 1);
153 @@ -1304,6 +1329,7 @@ void pr_niquery_reply(__u8 *_nih, int len)
157 +#endif /* __UCLIBC__ */
161 @@ -1353,6 +1379,7 @@ parse_reply(struct msghdr *msg, int cc, void *addr, struct timeval *tv)
162 hops, 0, tv, pr_addr(&from->sin6_addr),
166 } else if (icmph->icmp6_type == ICMPV6_NI_REPLY) {
167 struct ni_hdr *nih = (struct ni_hdr *)icmph;
168 __u16 seq = ntohs(*(__u16 *)nih->ni_nonce);
169 @@ -1363,6 +1390,7 @@ parse_reply(struct msghdr *msg, int cc, void *addr, struct timeval *tv)
170 hops, 0, tv, pr_addr(&from->sin6_addr),
173 +#endif /* __UCLIBC__ */
176 struct ip6_hdr *iph1 = (struct ip6_hdr*)(icmph+1);
177 @@ -1557,7 +1585,9 @@ void usage(void)
178 "Usage: ping6 [-LUdfnqrvVaAD] [-c count] [-i interval] [-w deadline]\n"
179 " [-p pattern] [-s packetsize] [-t ttl] [-I interface]\n"
180 " [-M pmtudisc-hint] [-S sndbuf] [-F flowlabel] [-Q tclass]\n"
182 " [[-N nodeinfo-option] ...]\n"
183 +#endif /* __UCLIBC__ */
184 " [hop1 ...] destination\n");
187 diff --git a/ping6_niquery.h b/ping6_niquery.h
188 index 61a5cfa..34c31f8 100644
189 --- a/ping6_niquery.h
190 +++ b/ping6_niquery.h
193 #include <asm/byteorder.h>
195 /* Node Information Query */
196 @@ -45,3 +46,4 @@ struct ni_hdr {
197 #define NI_IPV4ADDR_F_TRUNCATE NI_IPV6ADDR_F_TRUNCATE
198 #define NI_IPV4ADDR_F_ALL NI_IPV6ADDR_F_ALL
200 +#endif /* __UCLIBC__ */