1 diff -ru iputils/include-glibc/netinet/in.h iputils-clean/include-glibc/netinet/in.h
2 --- iputils/include-glibc/netinet/in.h 2000-06-18 14:57:25.000000000 -0400
3 +++ iputils-clean/include-glibc/netinet/in.h 2003-09-03 11:21:55.000000000 -0400
8 -#endif /* netinet/in.h */
9 +/* Functions to convert between host and network byte order.
11 + Please note that these functions normally take `unsigned long int' or
12 + `unsigned short int' values as arguments and also return them. But
13 + this was a short-sighted decision since on different systems the types
14 + may have different representations but the values are always the same. */
16 +extern u_int32_t ntohl (u_int32_t __netlong) __THROW __attribute__ ((__const__));
17 +extern u_int16_t ntohs (u_int16_t __netshort)
18 + __THROW __attribute__ ((__const__));
19 +extern u_int32_t htonl (u_int32_t __hostlong)
20 + __THROW __attribute__ ((__const__));
21 +extern u_int16_t htons (u_int16_t __hostshort)
22 + __THROW __attribute__ ((__const__));
26 +/* Get machine dependent optimized versions of byte swapping functions. */
27 +#include <bits/byteswap.h>
30 +/* We can optimize calls to the conversion functions. Either nothing has
31 + to be done or we are using directly the byte-swapping functions which
32 + often can be inlined. */
33 +# if __BYTE_ORDER == __BIG_ENDIAN
34 +/* The host byte order is the same as network byte order,
35 + so these functions are all just identity. */
36 +# define ntohl(x) (x)
37 +# define ntohs(x) (x)
38 +# define htonl(x) (x)
39 +# define htons(x) (x)
41 +# if __BYTE_ORDER == __LITTLE_ENDIAN
42 +# define ntohl(x) __bswap_32 (x)
43 +# define ntohs(x) __bswap_16 (x)
44 +# define htonl(x) __bswap_32 (x)
45 +# define htons(x) __bswap_16 (x)
50 +#endif /* netinet/in.h */
51 diff -ru iputils/ping6.c iputils-clean/ping6.c
52 --- iputils/ping6.c 2003-09-03 11:22:46.000000000 -0400
53 +++ iputils-clean/ping6.c 2003-09-03 11:15:42.000000000 -0400
57 /* Patch bpflet for current identifier. */
58 - insns[1] = (struct sock_filter)BPF_JUMP(BPF_JMP|BPF_JEQ|BPF_K, __constant_htons(ident), 0, 1);
59 + insns[1] = (struct sock_filter)BPF_JUMP(BPF_JMP|BPF_JEQ|BPF_K, htons(ident), 0, 1);
61 if (setsockopt(icmp_sock, SOL_SOCKET, SO_ATTACH_FILTER, &filter, sizeof(filter)))
62 perror("WARNING: failed to install socket filter\n");
63 diff -ru iputils/ping.c iputils-clean/ping.c
64 --- iputils/ping.c 2003-09-03 11:22:46.000000000 -0400
65 +++ iputils-clean/ping.c 2003-09-03 11:15:26.000000000 -0400
69 /* Patch bpflet for current identifier. */
70 - insns[2] = (struct sock_filter)BPF_JUMP(BPF_JMP|BPF_JEQ|BPF_K, __constant_htons(ident), 0, 1);
71 + insns[2] = (struct sock_filter)BPF_JUMP(BPF_JMP|BPF_JEQ|BPF_K, htons(ident), 0, 1);
73 if (setsockopt(icmp_sock, SOL_SOCKET, SO_ATTACH_FILTER, &filter, sizeof(filter)))
74 perror("WARNING: failed to install socket filter\n");