Patrick Williams | b48b7b4 | 2016-08-17 15:04:38 -0500 | [diff] [blame^] | 1 | Upstream: http://www.mail-archive.com/bug-inetutils@gnu.org/msg02103.html |
| 2 | |
| 3 | Upstream-Status: Pending |
| 4 | |
| 5 | diff -ur inetutils-1.8.orig/ping/ping_common.h inetutils-1.8/ping/ping_common.h |
| 6 | --- inetutils-1.8.orig/ping/ping_common.h 2010-05-15 20:55:47.000000000 +0930 |
| 7 | +++ inetutils-1.8/ping/ping_common.h 2010-12-01 12:19:08.000000000 +1030 |
| 8 | @@ -17,10 +17,14 @@ |
| 9 | You should have received a copy of the GNU General Public License |
| 10 | along with this program. If not, see `http://www.gnu.org/licenses/'. */ |
| 11 | |
| 12 | +#include <config.h> |
| 13 | + |
| 14 | #include <netinet/in_systm.h> |
| 15 | #include <netinet/in.h> |
| 16 | #include <netinet/ip.h> |
| 17 | +#ifdef HAVE_IPV6 |
| 18 | #include <netinet/icmp6.h> |
| 19 | +#endif |
| 20 | #include <icmp.h> |
| 21 | #include <error.h> |
| 22 | #include <progname.h> |
| 23 | @@ -66,13 +70,19 @@ |
| 24 | (t).tv_usec = ((i)%PING_PRECISION)*(1000000/PING_PRECISION) ;\ |
| 25 | } while (0) |
| 26 | |
| 27 | +#ifdef HAVE_IPV6 |
| 28 | /* Not sure about this step*/ |
| 29 | #define _PING_BUFLEN(p, USE_IPV6) ((USE_IPV6)? ((p)->ping_datalen + sizeof (struct icmp6_hdr)) : \ |
| 30 | ((p)->ping_datalen + sizeof (icmphdr_t))) |
| 31 | +#else |
| 32 | +#define _PING_BUFLEN(p, USE_IPV6) ((p)->ping_datalen + sizeof (icmphdr_t)) |
| 33 | +#endif |
| 34 | |
| 35 | +#ifdef HAVE_IPV6 |
| 36 | typedef int (*ping_efp6) (int code, void *closure, struct sockaddr_in6 * dest, |
| 37 | struct sockaddr_in6 * from, struct icmp6_hdr * icmp, |
| 38 | int datalen); |
| 39 | +#endif |
| 40 | |
| 41 | typedef int (*ping_efp) (int code, |
| 42 | void *closure, |
| 43 | @@ -81,13 +91,17 @@ |
| 44 | struct ip * ip, icmphdr_t * icmp, int datalen); |
| 45 | |
| 46 | union event { |
| 47 | +#ifdef HAVE_IPV6 |
| 48 | ping_efp6 handler6; |
| 49 | +#endif |
| 50 | ping_efp handler; |
| 51 | }; |
| 52 | |
| 53 | union ping_address { |
| 54 | struct sockaddr_in ping_sockaddr; |
| 55 | +#ifdef HAVE_IPV6 |
| 56 | struct sockaddr_in6 ping_sockaddr6; |
| 57 | +#endif |
| 58 | }; |
| 59 | |
| 60 | typedef struct ping_data PING; |