25 Jul, 2020

1 commit

  • The RFC 4884 spec is largely the same between IPv4 and IPv6.
    Factor out the IPv4 specific parts in preparation for IPv6 support:

    - icmp types supported

    - icmp header size, and thus offset to original datagram start

    - datagram length field offset in icmp(6)hdr.

    - datagram length field word size: 4B for IPv4, 8B for IPv6.

    Signed-off-by: Willem de Bruijn
    Signed-off-by: David S. Miller

    Willem de Bruijn
     

20 Jul, 2020

1 commit

  • Add setsockopt SOL_IP/IP_RECVERR_4884 to return the offset to an
    extension struct if present.

    ICMP messages may include an extension structure after the original
    datagram. RFC 4884 standardized this behavior. It stores the offset
    in words to the extension header in u8 icmphdr.un.reserved[1].

    The field is valid only for ICMP types destination unreachable, time
    exceeded and parameter problem, if length is at least 128 bytes and
    entire packet does not exceed 576 bytes.

    Return the offset to the start of the extension struct when reading an
    ICMP error from the error queue, if it matches the above constraints.

    Do not return the raw u8 field. Return the offset from the start of
    the user buffer, in bytes. The kernel does not return the network and
    transport headers, so subtract those.

    Also validate the headers. Return the offset regardless of validation,
    as an invalid extension must still not be misinterpreted as part of
    the original datagram. Note that !invalid does not imply valid. If
    the extension version does not match, no validation can take place,
    for instance.

    For backward compatibility, make this optional, set by setsockopt
    SOL_IP/IP_RECVERR_RFC4884. For API example and feature test, see
    github.com/wdebruij/kerneltools/blob/master/tests/recv_icmp_v2.c

    For forward compatibility, reserve only setsockopt value 1, leaving
    other bits for additional icmp extensions.

    Changes
    v1->v2:
    - convert word offset to byte offset from start of user buffer
    - return in ee_data as u8 may be insufficient
    - define extension struct and object header structs
    - return len only if constraints met
    - if returning len, also validate

    Signed-off-by: Willem de Bruijn
    Signed-off-by: David S. Miller

    Willem de Bruijn
     

06 Nov, 2019

1 commit

  • Add two helper functions, one for IPv4 and one for IPv6, to recognize
    the ICMP packets which are error responses.
    This packets are special because they have as payload the original
    header of the packet which generated it (RFC 792 says at least 8 bytes,
    but Linux actually includes much more than that).

    Signed-off-by: Matteo Croce
    Signed-off-by: David S. Miller

    Matteo Croce
     

31 May, 2019

1 commit

  • Based on 1 normalized pattern(s):

    this program is free software you can redistribute it and or modify
    it under the terms of the gnu general public license as published by
    the free software foundation either version 2 of the license or at
    your option any later version

    extracted by the scancode license scanner the SPDX license identifier

    GPL-2.0-or-later

    has been chosen to replace the boilerplate/reference in 3029 file(s).

    Signed-off-by: Thomas Gleixner
    Reviewed-by: Allison Randal
    Cc: linux-spdx@vger.kernel.org
    Link: https://lkml.kernel.org/r/20190527070032.746973796@linutronix.de
    Signed-off-by: Greg Kroah-Hartman

    Thomas Gleixner
     

13 Oct, 2012

1 commit


26 Apr, 2007

2 commits


03 Dec, 2006

1 commit


29 Sep, 2006

1 commit


17 Apr, 2005

1 commit

  • Initial git repository build. I'm not bothering with the full history,
    even though we have it. We can create a separate "historical" git
    archive of that later if we want to, and in the meantime it's about
    3.2GB when imported into git - space that would just make the early
    git days unnecessarily complicated, when we don't have a lot of good
    infrastructure for it.

    Let it rip!

    Linus Torvalds