All of lore.kernel.org
 help / color / mirror / Atom feed
* Questions on sk_no_check implemenation
@ 2014-05-06  2:34 Tom Herbert
  2014-05-07 20:15 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Tom Herbert @ 2014-05-06  2:34 UTC (permalink / raw)
  To: Linux Netdev List

Hi, I'm looking at sk_no_check implementation and am hoping to get
clarification on a couple of use cases.

1) In l2tp_core.c, if sk_no_check is set it looks like this will
completely bypass UDP checksum verification on RX even for packets
with nonzero checksums.

d2cf33616 (Benjamin LaHaise 2012-04-27 08:24:18 +0000 505) if
(sk->sk_no_check || skb_csum_unnecessary(skb))

I don't believe this is standards compliant and seems pretty risky
otherwise. What is the requirement here? Is this still needed?

2) The constant UDP_CSUM_NORCV was introduced for sunrpc and in fact
this looks like the only code that sets it. AFAICT the only effect
this would have would be to disable receive checksum verification in
L2TP as described above. What was the intent of UDP_CSUM_NORCV and why
was using this specific to sunrpc?

Thanks for  your help,
Tom

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

* Re: Questions on sk_no_check implemenation
  2014-05-06  2:34 Questions on sk_no_check implemenation Tom Herbert
@ 2014-05-07 20:15 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2014-05-07 20:15 UTC (permalink / raw)
  To: therbert; +Cc: netdev

From: Tom Herbert <therbert@google.com>
Date: Mon, 5 May 2014 19:34:40 -0700

> Hi, I'm looking at sk_no_check implementation and am hoping to get
> clarification on a couple of use cases.
> 
> 1) In l2tp_core.c, if sk_no_check is set it looks like this will
> completely bypass UDP checksum verification on RX even for packets
> with nonzero checksums.
> 
> d2cf33616 (Benjamin LaHaise 2012-04-27 08:24:18 +0000 505) if
> (sk->sk_no_check || skb_csum_unnecessary(skb))
> 
> I don't believe this is standards compliant and seems pretty risky
> otherwise. What is the requirement here? Is this still needed?

I think this is simply a thinko and the code should be checking non-zero
csums.

> 2) The constant UDP_CSUM_NORCV was introduced for sunrpc and in fact
> this looks like the only code that sets it. AFAICT the only effect
> this would have would be to disable receive checksum verification in
> L2TP as described above. What was the intent of UDP_CSUM_NORCV and why
> was using this specific to sunrpc?

I have no idea about this case.

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

end of thread, other threads:[~2014-05-07 20:27 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-05-06  2:34 Questions on sk_no_check implemenation Tom Herbert
2014-05-07 20:15 ` David Miller

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.