bug-inetutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [bug-inetutils] regarding ping6 -c Segmentation fault


From: Debarshi Ray
Subject: Re: [bug-inetutils] regarding ping6 -c Segmentation fault
Date: Wed, 20 Aug 2008 20:57:26 +0530

> Index: ping/ping6.h
> ===================================================================
> RCS file: /sources/inetutils/inetutils/ping/ping6.h,v
> retrieving revision 1.4
> diff -u -r1.4 ping6.h
> --- ping/ping6.h        29 Jun 2007 16:29:30 -0000      1.4
> +++ ping/ping6.h        20 Aug 2008 04:49:38 -0000
> [...]
> @@ -80,6 +48,7 @@
>  #define PING_DATALEN   (64 - PING_HEADER_LEN)  /* default data length */
>  #define PING_MAX_DATALEN (65535 - sizeof (struct icmp6_hdr))
>
> +#undef _PING_BUFLEN
>  #define _PING_BUFLEN(p) ((p)->ping_datalen + sizeof (struct icmp6_hdr))
>
>  #define _C_BIT(p,bit)    (p)->ping_cktab[(bit)>>3]     /* byte in ck array */

This #undef and #define looks a bit ugly to me. One alternative would
be to pass a second argument and then conditionally add sizeof (struct
icmp_hdr) or sizeof (struct icmp6_hdr).

Also write up a nice ChangeLog entry and split up the changes into
small, coherent units. :-)

Happy hacking,
Debarshi




reply via email to

[Prev in Thread] Current Thread [Next in Thread]