All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net 0/2] IPv6: reply ICMP error with fragment doesn't contain all headers
@ 2020-10-07  3:55 Hangbin Liu
  2020-10-07  3:55 ` [PATCH net 1/2] ICMPv6: Add ICMPv6 Parameter Problem, code 3 definition Hangbin Liu
                   ` (2 more replies)
  0 siblings, 3 replies; 37+ messages in thread
From: Hangbin Liu @ 2020-10-07  3:55 UTC (permalink / raw)
  To: netdev
  Cc: David S . Miller, Alexey Kuznetsov, Hideaki YOSHIFUJI,
	Jakub Kicinski, Willem de Bruijn, Hangbin Liu


When our Engineer run latest IPv6 Core Conformance test, test v6LC.1.3.6:
First Fragment Doesn’t Contain All Headers[1] failed. The test purpose is to
verify that the node(Linux for example) should properly process IPv6 packets
that don’t include all the headers through the Upper-Layer header.

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.

The first patch add a definition for ICMPv6 Parameter Problem, code 3.
The second patch add a check for the 1st fragment packet to make sure
Upper-Layer header exist.

[1] Page 68, v6LC.1.3.6: First Fragment Doesn’t Contain All Headers part A, B,
C and D at https://ipv6ready.org/docs/Core_Conformance_5_0_0.pdf
[2] My reproducer:
#!/usr/bin/env python3

import sys, os
from scapy.all import *

# Test v6LC.1.3.6: First Fragment Doesn’t Contain All Headers
def send_frag_dst_opt(src_ip6, dst_ip6):
    ip6 = IPv6(src = src_ip6, dst = dst_ip6, nh = 44)

    frag_1 = IPv6ExtHdrFragment(nh = 60, m = 1)
    dst_opt = IPv6ExtHdrDestOpt(nh = 58)

    frag_2 = IPv6ExtHdrFragment(nh = 58, offset = 4, m = 1)
    icmp_echo = ICMPv6EchoRequest(seq = 1)

    pkt_1 = ip6/frag_1/dst_opt
    pkt_2 = ip6/frag_2/icmp_echo

    send(pkt_1)
    send(pkt_2)

def send_frag_route_opt(src_ip6, dst_ip6):
    ip6 = IPv6(src = src_ip6, dst = dst_ip6, nh = 44)

    frag_1 = IPv6ExtHdrFragment(nh = 43, m = 1)
    route_opt = IPv6ExtHdrRouting(nh = 58)

    frag_2 = IPv6ExtHdrFragment(nh = 58, offset = 4, m = 1)
    icmp_echo = ICMPv6EchoRequest(seq = 2)

    pkt_1 = ip6/frag_1/route_opt
    pkt_2 = ip6/frag_2/icmp_echo

    send(pkt_1)
    send(pkt_2)

if __name__ == '__main__':
    src = sys.argv[1]
    dst = sys.argv[2]
    conf.iface = sys.argv[3]
    send_frag_dst_opt(src, dst)
    send_frag_route_opt(src, dst)

Hangbin Liu (2):
  ICMPv6: Add ICMPv6 Parameter Problem, code 3 definition
  IPv6: reply ICMP error if the first fragment don't include all headers

 include/uapi/linux/icmpv6.h |  1 +
 net/ipv6/icmp.c             | 13 ++++++++++++-
 net/ipv6/ip6_input.c        | 20 +++++++++++++++++++-
 3 files changed, 32 insertions(+), 2 deletions(-)

-- 
2.25.4


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

end of thread, other threads:[~2020-10-31 21:12 UTC | newest]

Thread overview: 37+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-07  3:55 [PATCH net 0/2] IPv6: reply ICMP error with fragment doesn't contain all headers Hangbin Liu
2020-10-07  3:55 ` [PATCH net 1/2] ICMPv6: Add ICMPv6 Parameter Problem, code 3 definition Hangbin Liu
2020-10-07  3:55 ` [PATCH net 2/2] IPv6: reply ICMP error if the first fragment don't include all headers Hangbin Liu
2020-10-07  9:35   ` Eric Dumazet
2020-10-08  8:30     ` Hangbin Liu
2020-10-08  9:47       ` Eric Dumazet
2020-10-09 10:07         ` Hangbin Liu
2020-10-07 14:58   ` Jakub Kicinski
2020-10-08  8:36     ` Hangbin Liu
2020-10-21  4:20 ` [PATCHv2 net 0/2] IPv6: reply ICMP error with fragment doesn't contain " Hangbin Liu
2020-10-21  4:20   ` [PATCHv2 net 1/2] ICMPv6: Add ICMPv6 Parameter Problem, code 3 definition Hangbin Liu
2020-10-21  4:20   ` [PATCHv2 net 2/2] IPv6: reply ICMP error if the first fragment don't include all headers Hangbin Liu
2020-10-21 14:02     ` Willem de Bruijn
2020-10-22  9:12       ` Hangbin Liu
2020-10-22 15:46         ` Willem de Bruijn
2020-10-23  6:43   ` [PATCHv3 net 0/2] IPv6: reply ICMP error if fragment doesn't contain " Hangbin Liu
2020-10-23  6:43     ` [PATCHv3 net 1/2] ICMPv6: Add ICMPv6 Parameter Problem, code 3 definition Hangbin Liu
2020-10-23  6:43     ` [PATCHv3 net 2/2] IPv6: reply ICMP error if the first fragment doesn't include all headers Hangbin Liu
2020-10-23 18:18       ` Jakub Kicinski
2020-10-26  7:29     ` [PATCHv4 net 0/2] IPv6: reply ICMP error if fragment doesn't contain " Hangbin Liu
2020-10-26  7:29       ` [PATCHv4 net 1/2] ICMPv6: Add ICMPv6 Parameter Problem, code 3 definition Hangbin Liu
2020-10-26  7:29       ` [PATCHv4 net 2/2] IPv6: reply ICMP error if the first fragment don't include all headers Hangbin Liu
2020-10-26  8:09         ` Georg Kohmann (geokohma)
2020-10-26 12:55           ` Hangbin Liu
2020-10-26 14:49             ` Georg Kohmann (geokohma)
2020-10-27  2:28       ` [PATCHv5 net 0/2] IPv6: reply ICMP error if fragment doesn't contain " Hangbin Liu
2020-10-27  2:28         ` [PATCHv5 net 1/2] ICMPv6: Add ICMPv6 Parameter Problem, code 3 definition Hangbin Liu
2020-10-27  2:28         ` [PATCHv5 net 2/2] IPv6: reply ICMP error if the first fragment don't include all headers Hangbin Liu
2020-10-27  7:57           ` Georg Kohmann (geokohma)
2020-10-27  9:57             ` Hangbin Liu
2020-10-27 10:20               ` Georg Kohmann (geokohma)
2020-10-30 15:31               ` Willem de Bruijn
2020-10-30 18:39                 ` Georg Kohmann (geokohma)
2020-10-27 12:33         ` [PATCHv6 net 0/2] IPv6: reply ICMP error if fragment doesn't contain " Hangbin Liu
2020-10-27 12:33           ` [PATCHv6 net 1/2] ICMPv6: Add ICMPv6 Parameter Problem, code 3 definition Hangbin Liu
2020-10-27 12:33           ` [PATCHv6 net 2/2] IPv6: reply ICMP error if the first fragment don't include all headers Hangbin Liu
2020-10-31 21:12           ` [PATCHv6 net 0/2] IPv6: reply ICMP error if fragment doesn't contain " Jakub Kicinski

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.