Re: [PATCH] iputils ping: add (non-raw) ICMP socket support

Salvatore Mesoraca
2015-04-09T09:07:35Z

Lorenzo Colitti wrote:
> On Wed, Apr 8, 2015 at 10:05 PM, Salvatore Mesoraca <s.mesoraca16@gmail.com>
> wrote:
> > > And, would you provide patch for ping6 as well?
> >
> > I was planning to work on ping6 as well If this patch get accepted.
>
> Yoshifuji-san,
>
> I sent you a patch that works for both IPv4 and IPv6 a couple of years ago:
>
> http://marc.info/?l=linux-netdev&m=137026384215378
> http://marc.info/?l=linux-netdev&m=137026384815379
>
> This code has been running on Android since then:
>
> https://android-review.googlesource.com/#/c/61948/
>
> Perhaps we can start from that patchset?
>
> Cheers,
> Lorenzo

Hi Lorenzo,
Thank you for bringing this up,
it seems that you have a better understanding than mine on the original patch.

Anyway I'm wondering why you didn't include this change:

> - if (!working_recverr) {
> + if (!using_ping_socket && !working_recverr) {

inside receive_error_msg()
The code in the if block try to execute a setsockopt(icmp_sock, SOL_RAW,
ICMP_FILTER, ...) which is only possible on a raw socket.
What am I missing?
Thank you for your patience,
I hope this time your patch get accepted,

Salvatore Mesoraca