[bug #56708] ip6_debug_print is called in ip6_input at the wrong place

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

[bug #56708] ip6_debug_print is called in ip6_input at the wrong place

David GIRAULT-2
URL:
  <https://savannah.nongnu.org/bugs/?56708>

                 Summary: ip6_debug_print is called in ip6_input at the wrong
place
                 Project: lwIP - A Lightweight TCP/IP stack
            Submitted by: gschorcht
            Submitted on: Fri 02 Aug 2019 12:19:38 PM UTC
                Category: IPv6
                Severity: 3 - Normal
              Item Group: Faulty Behaviour
                  Status: None
                 Privacy: Public
             Assigned to: None
             Open/Closed: Open
         Discussion Lock: Any
         Planned Release: None
            lwIP version: git head

    _______________________________________________________

Details:

The call of function `ip6_debug_print` to print the header of a received IPv6
packet is at the wrong place in function `ip6_input`.

In current source, function `ip6_debug_print` is called in [line 1044 in
ip6.c](http://git.savannah.nongnu.org/cgit/lwip.git/tree/src/core/ipv6/ip6.c#n1044).
However, this is after the header has been already removed with

<code>
`pbuf_remove_header(p, IP6_HLEN)`;

</code>

in [line 704 in
ipv6](http://git.savannah.nongnu.org/cgit/lwip.git/tree/src/core/ipv6/ip6.c#n1044).
Therefore, the call results into an output that makes no sense, for example:

<code>
IPv6 header:
+-------------------------------+
|  3 |    3  |       638977     | (ver, class, flow)
+-------------------------------+
|     39724     |  127  |   45  | (plen, nexth, hopl)
+-------------------------------+
|     0 |  196e |  6012 |  7080 | (src)
|  f128 |     0 |   204 |   5a0 |
+-------------------------------+
|   7d0 |   101 |  6ad3 |  9b1a | (dest)
|   7d1 |  5425 |  7c22 |     0 |
+-------------------------------+
ip6_input: p->len 24 p->tot_len 24
</code>

In this example, the payload (TCP Header) is interpreted as IPv6 Header. Also
the given length of `*p` is less than the minimum size of 40 byte of an IPv6
header.

From my point of view, the debug output should be placed at [line 697 in
ip6.c](http://git.savannah.nongnu.org/cgit/lwip.git/tree/src/core/ipv6/ip6.c#n697).




    _______________________________________________________

Reply to this item at:

  <https://savannah.nongnu.org/bugs/?56708>

_______________________________________________
  Message sent via Savannah
  https://savannah.nongnu.org/


_______________________________________________
lwip-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/lwip-devel
Reply | Threaded
Open this post in threaded view
|

[bug #56708] ip6_debug_print is called in ip6_input at the wrong place

David GIRAULT-2
Follow-up Comment #1, bug #56708 (project lwip):


[comment #0 original submission:]
> The call of function `ip6_debug_print` to print the header of a received
IPv6 packet is at the wrong place in function `ip6_input`.
>
> In current source, function `ip6_debug_print` is called in [line 1044 in
ip6.c](http://git.savannah.nongnu.org/cgit/lwip.git/tree/src/core/ipv6/ip6.c#n1044).
However, this is after the header has been already removed with
>
> <code>
> `pbuf_remove_header(p, IP6_HLEN)`;
>
> </code>
>
> in [line 704 in
ipv6](http://git.savannah.nongnu.org/cgit/lwip.git/tree/src/core/ipv6/ip6.c#n1044).
Therefore, the call results into an output that makes no sense, for example:

>
> <code>
> IPv6 header:
> +-------------------------------+
> |  3 |    3  |       638977     | (ver, class, flow)
> +-------------------------------+
> |     39724     |  127  |   45  | (plen, nexth, hopl)
> +-------------------------------+
> |     0 |  196e |  6012 |  7080 | (src)
> |  f128 |     0 |   204 |   5a0 |
> +-------------------------------+
> |   7d0 |   101 |  6ad3 |  9b1a | (dest)
> |   7d1 |  5425 |  7c22 |     0 |
> +-------------------------------+
> ip6_input: p->len 24 p->tot_len 24
> </code>
>
> In this example, the payload (TCP Header) is interpreted as IPv6 Header.
Also the given length of `*p` is less than the minimum size of 40 byte of an
IPv6 header.
>
> From my point of view, the debug output should be placed at [line 697 in
ip6.c](http://git.savannah.nongnu.org/cgit/lwip.git/tree/src/core/ipv6/ip6.c#n697).

    _______________________________________________________

Reply to this item at:

  <https://savannah.nongnu.org/bugs/?56708>

_______________________________________________
  Message sent via Savannah
  https://savannah.nongnu.org/


_______________________________________________
lwip-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/lwip-devel
Reply | Threaded
Open this post in threaded view
|

[bug #56708] ip6_debug_print is called in ip6_input at the wrong place

David GIRAULT-2
Follow-up Comment #2, bug #56708 (project lwip):

What's this comment #1 about?

"A patch says more than 1000 words", would you care to upload a patch to
exactly show what you mean? Thanks.

    _______________________________________________________

Reply to this item at:

  <https://savannah.nongnu.org/bugs/?56708>

_______________________________________________
  Message sent via Savannah
  https://savannah.nongnu.org/


_______________________________________________
lwip-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/lwip-devel
Reply | Threaded
Open this post in threaded view
|

[bug #56708] ip6_debug_print is called in ip6_input at the wrong place

David GIRAULT-2
Follow-up Comment #3, bug #56708 (project lwip):

[comment #2 comment #2:]
> What's this comment #1 about?
>
> "A patch says more than 1000 words", would you care to upload a patch to
exactly show what you mean? Thanks.

Sorry, comment #1 is just a quoted version of the original submission I
provided accidentially when I tried to correct a mistake in the original
submission. Original submission describes the problem.

How should I upload a patch, inline as diff text or as attached file?



    _______________________________________________________

Reply to this item at:

  <https://savannah.nongnu.org/bugs/?56708>

_______________________________________________
  Message sent via Savannah
  https://savannah.nongnu.org/


_______________________________________________
lwip-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/lwip-devel