buglwIP - A Lightweight TCP/IP stack - Bugs: bug #56708, ip6_debug_print is called in...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

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

Submitter:  Gunar Schorcht <gschorcht>
Submitted:  Fri 02 Aug 2019 12:19:38 PM UTC
   
 
Category:  IPv6 Severity:  3 - Normal
Item Group:  Faulty Behaviour Status:  Fixed
Privacy:  Public Assigned to:  goldsimon
Open/Closed:  Closed Planned Release:  None
lwIP version:  git head

Fri 10 Jan 2020 10:11:18 PM UTC, comment #4: 

Got it. And fixed.

Simon Goldschmidt <goldsimon>
Group administrator
Sat 03 Aug 2019 07:54:33 AM UTC, comment #3: 

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?


Gunar Schorcht <gschorcht>
Fri 02 Aug 2019 06:31:58 PM UTC, 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.

Simon Goldschmidt <goldsimon>
Group administrator
Fri 02 Aug 2019 12:21:04 PM UTC, comment #1: 


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).

Gunar Schorcht <gschorcht>
Fri 02 Aug 2019 12:19:38 PM UTC, 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).

Gunar Schorcht <gschorcht>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by goldsimon (Posted a comment)
  • -email is unavailable- added by gschorcht (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

     

    Follow 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2020-01-10 goldsimon StatusNone Fixed
        Assigned toNone goldsimon
        Open/ClosedOpen Closed

    Back to the top

    Powered by Savane 3.13-f8d8.
    Corresponding source code