[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lwip-devel] [bug #56708] ip6_debug_print is called in ip6_input at the
From: |
Gunar Schorcht |
Subject: |
[lwip-devel] [bug #56708] ip6_debug_print is called in ip6_input at the wrong place |
Date: |
Fri, 2 Aug 2019 08:19:40 -0400 (EDT) |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/75.0.3770.90 Chrome/75.0.3770.90 Safari/537.36 |
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] [bug #56708] ip6_debug_print is called in ip6_input at the wrong place,
Gunar Schorcht <=