Thread (37 messages) 37 messages, 5 authors, 2020-10-31

Re: [PATCH net 2/2] IPv6: reply ICMP error if the first fragment don't include all headers

From: Hangbin Liu <hidden>
Date: 2020-10-08 08:36:51

On Wed, Oct 07, 2020 at 07:58:07AM -0700, Jakub Kicinski wrote:
On Wed,  7 Oct 2020 11:55:02 +0800 Hangbin Liu wrote:
quoted
Based on RFC 8200, Section 4.5 Fragment Header:

  -  If the first fragment does not include all headers through an
     Upper-Layer header, then that fragment should be discarded and
     an ICMP Parameter Problem, Code 3, message should be sent to
     the source of the fragment, with the Pointer field set to zero.

As the packet may be any kind of L4 protocol, I only checked if there
has Upper-Layer header by pskb_may_pull(skb, offset + 1).

As the 1st truncated fragment may also be ICMP message, I also add
a check in ICMP code is_ineligible() to let fragment packet with nexthdr
ICMP but no ICMP header return false.

Signed-off-by: Hangbin Liu <redacted>
net/ipv6/icmp.c:159:65: warning: incorrect type in argument 4 (different base types)
net/ipv6/icmp.c:159:65:    expected unsigned short *fragoff
net/ipv6/icmp.c:159:65:    got restricted __be16 *
Ah, Thanks for pointing out this error, I will fix it.

Regards
Hangbin
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help