netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next] icmp: pass RFC 8335 reply messages to ping_rcv
@ 2021-04-12 19:08 Andreas Roeseler
  2021-04-12 19:28 ` Willem de Bruijn
  0 siblings, 1 reply; 4+ messages in thread
From: Andreas Roeseler @ 2021-04-12 19:08 UTC (permalink / raw)
  To: netdev; +Cc: davem, yoshfuji, dsahern, kuba, Andreas Roeseler

The current icmp_rcv function drops all unknown ICMP types, including
ICMP_EXT_ECHOREPLY (type 43). In order to parse Extended Echo Reply messages, we have
to pass these packets to the ping_rcv function, which does not do any
other filtering and passes the packet to the designated socket.

Pass incoming RFC 8335 ICMP Extended Echo Reply packets to the ping_rcv
handler instead of discarding the packet.

Signed-off-by: Andreas Roeseler <andreas.a.roeseler@gmail.com>
---
 net/ipv4/icmp.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/net/ipv4/icmp.c b/net/ipv4/icmp.c
index 76990e13a2f9..8bd988fbcb31 100644
--- a/net/ipv4/icmp.c
+++ b/net/ipv4/icmp.c
@@ -1196,6 +1196,11 @@ int icmp_rcv(struct sk_buff *skb)
 		goto success_check;
 	}
 
+	if (icmph->type == ICMP_EXT_ECHOREPLY) {
+		success = ping_rcv(skb);
+		goto success_check;
+	}
+
 	/*
 	 *	18 is the highest 'known' ICMP type. Anything else is a mystery
 	 *
-- 
2.30.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH net-next] icmp: pass RFC 8335 reply messages to ping_rcv
  2021-04-12 19:08 [PATCH net-next] icmp: pass RFC 8335 reply messages to ping_rcv Andreas Roeseler
@ 2021-04-12 19:28 ` Willem de Bruijn
  2021-04-12 19:40   ` Andreas Roeseler
  0 siblings, 1 reply; 4+ messages in thread
From: Willem de Bruijn @ 2021-04-12 19:28 UTC (permalink / raw)
  To: Andreas Roeseler
  Cc: Network Development, David Miller, Hideaki YOSHIFUJI, David Ahern,
	Jakub Kicinski

On Mon, Apr 12, 2021 at 3:09 PM Andreas Roeseler
<andreas.a.roeseler@gmail.com> wrote:
>
> The current icmp_rcv function drops all unknown ICMP types, including
> ICMP_EXT_ECHOREPLY (type 43). In order to parse Extended Echo Reply messages, we have
> to pass these packets to the ping_rcv function, which does not do any
> other filtering and passes the packet to the designated socket.
>
> Pass incoming RFC 8335 ICMP Extended Echo Reply packets to the ping_rcv
> handler instead of discarding the packet.
>
> Signed-off-by: Andreas Roeseler <andreas.a.roeseler@gmail.com>
> ---
>  net/ipv4/icmp.c | 5 +++++
>  1 file changed, 5 insertions(+)
>
> diff --git a/net/ipv4/icmp.c b/net/ipv4/icmp.c
> index 76990e13a2f9..8bd988fbcb31 100644
> --- a/net/ipv4/icmp.c
> +++ b/net/ipv4/icmp.c
> @@ -1196,6 +1196,11 @@ int icmp_rcv(struct sk_buff *skb)
>                 goto success_check;
>         }
>
> +       if (icmph->type == ICMP_EXT_ECHOREPLY) {
> +               success = ping_rcv(skb);
> +               goto success_check;
> +       }
> +

Do you need the same for ICMPV6_EXT_ECHO_REPLY ?

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH net-next] icmp: pass RFC 8335 reply messages to ping_rcv
  2021-04-12 19:28 ` Willem de Bruijn
@ 2021-04-12 19:40   ` Andreas Roeseler
  2021-04-12 19:52     ` Willem de Bruijn
  0 siblings, 1 reply; 4+ messages in thread
From: Andreas Roeseler @ 2021-04-12 19:40 UTC (permalink / raw)
  To: Willem de Bruijn
  Cc: Network Development, David Miller, Hideaki YOSHIFUJI, David Ahern,
	Jakub Kicinski

On Mon, 2021-04-12 at 15:28 -0400, Willem de Bruijn wrote:
> On Mon, Apr 12, 2021 at 3:09 PM Andreas Roeseler
> <andreas.a.roeseler@gmail.com> wrote:
> > 
> > The current icmp_rcv function drops all unknown ICMP types,
> > including
> > ICMP_EXT_ECHOREPLY (type 43). In order to parse Extended Echo Reply
> > messages, we have
> > to pass these packets to the ping_rcv function, which does not do
> > any
> > other filtering and passes the packet to the designated socket.
> > 
> > Pass incoming RFC 8335 ICMP Extended Echo Reply packets to the
> > ping_rcv
> > handler instead of discarding the packet.
> > 
> > Signed-off-by: Andreas Roeseler <andreas.a.roeseler@gmail.com>
> > ---
> >  net/ipv4/icmp.c | 5 +++++
> >  1 file changed, 5 insertions(+)
> > 
> > diff --git a/net/ipv4/icmp.c b/net/ipv4/icmp.c
> > index 76990e13a2f9..8bd988fbcb31 100644
> > --- a/net/ipv4/icmp.c
> > +++ b/net/ipv4/icmp.c
> > @@ -1196,6 +1196,11 @@ int icmp_rcv(struct sk_buff *skb)
> >                 goto success_check;
> >         }
> > 
> > +       if (icmph->type == ICMP_EXT_ECHOREPLY) {
> > +               success = ping_rcv(skb);
> > +               goto success_check;
> > +       }
> > +
> 
> Do you need the same for ICMPV6_EXT_ECHO_REPLY ?

Yes, but this should be handled in icmpv6_rcv in net/ipv6/icmp.c and
we're thinking of including all icmpv6 support for RFC 8335 (replying
and parsing replies) in a separate patch.



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH net-next] icmp: pass RFC 8335 reply messages to ping_rcv
  2021-04-12 19:40   ` Andreas Roeseler
@ 2021-04-12 19:52     ` Willem de Bruijn
  0 siblings, 0 replies; 4+ messages in thread
From: Willem de Bruijn @ 2021-04-12 19:52 UTC (permalink / raw)
  To: Andreas Roeseler
  Cc: Willem de Bruijn, Network Development, David Miller,
	Hideaki YOSHIFUJI, David Ahern, Jakub Kicinski

On Mon, Apr 12, 2021 at 3:41 PM Andreas Roeseler
<andreas.a.roeseler@gmail.com> wrote:
>
> On Mon, 2021-04-12 at 15:28 -0400, Willem de Bruijn wrote:
> > On Mon, Apr 12, 2021 at 3:09 PM Andreas Roeseler
> > <andreas.a.roeseler@gmail.com> wrote:
> > >
> > > The current icmp_rcv function drops all unknown ICMP types,
> > > including
> > > ICMP_EXT_ECHOREPLY (type 43). In order to parse Extended Echo Reply
> > > messages, we have
> > > to pass these packets to the ping_rcv function, which does not do
> > > any
> > > other filtering and passes the packet to the designated socket.
> > >
> > > Pass incoming RFC 8335 ICMP Extended Echo Reply packets to the
> > > ping_rcv
> > > handler instead of discarding the packet.
> > >
> > > Signed-off-by: Andreas Roeseler <andreas.a.roeseler@gmail.com>
> > > ---
> > >  net/ipv4/icmp.c | 5 +++++
> > >  1 file changed, 5 insertions(+)
> > >
> > > diff --git a/net/ipv4/icmp.c b/net/ipv4/icmp.c
> > > index 76990e13a2f9..8bd988fbcb31 100644
> > > --- a/net/ipv4/icmp.c
> > > +++ b/net/ipv4/icmp.c
> > > @@ -1196,6 +1196,11 @@ int icmp_rcv(struct sk_buff *skb)
> > >                 goto success_check;
> > >         }
> > >
> > > +       if (icmph->type == ICMP_EXT_ECHOREPLY) {
> > > +               success = ping_rcv(skb);
> > > +               goto success_check;
> > > +       }
> > > +
> >
> > Do you need the same for ICMPV6_EXT_ECHO_REPLY ?
>
> Yes, but this should be handled in icmpv6_rcv in net/ipv6/icmp.c and
> we're thinking of including all icmpv6 support for RFC 8335 (replying
> and parsing replies) in a separate patch.

Please send them together in the same patchset.

Sending ipv4 and ipv6 separately can lead to missing or subtly
differently implemented features. It's preferable to be able to review
both at the same time.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-04-12 19:53 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-04-12 19:08 [PATCH net-next] icmp: pass RFC 8335 reply messages to ping_rcv Andreas Roeseler
2021-04-12 19:28 ` Willem de Bruijn
2021-04-12 19:40   ` Andreas Roeseler
2021-04-12 19:52     ` Willem de Bruijn

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).