lwIP - A Lightweight TCP/IP stack - Bugs: bug #63312, sockets bug? Port endianness
You are not allowed to post comments on this tracker with your current authentication level.
bug #63312: sockets bug? Port endianness
Submitter: | bmcdonnell_npm | ||
Submitted: | Thu 03 Nov 2022 08:04:25 PM UTC | ||
Category: | sockets/netconn | Severity: | 3 - Normal |
Item Group: | Faulty Behaviour | Status: | Invalid |
Privacy: | Public | Assigned to: | None |
Open/Closed: | Closed | Planned Release: | None |
lwIP version: | Other |
Fri 04 Nov 2022 09:19:16 PM UTC, comment #2: |
bmcdonnell_npm |
Thu 03 Nov 2022 08:12:49 PM UTC, comment #1: Apparently this forum won't let me attach a zip file. I used the "lwip_dhcp_freertos_cm7" example. |
bmcdonnell_npm |
Thu 03 Nov 2022 08:04:25 PM UTC, original submission:
My socket-based IPv4 only program doesn't work with lwIP. It seems that there is an endian issue with the UDP/TCP ports. As shown in the attached screenshot, I have to modify lwIP's IP4ADDR_PORT_TO_SOCKADDR() and SOCKADDR4_TO_IP4ADDR_PORT() macros by removing the byte swaps on the ports (i.e. removing lwip_htons() and lwip_ntohs()), to make my program work, and for the TCP/UDP ports to show as expected in Wireshark. Is this an lwIP bug, or is there somehow something wrong with my configuration?
|
bmcdonnell_npm |
Depends on the following items: None found
Items that depend on this one: None found
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 |
---|---|---|---|---|---|
2022-11-07 | yarrick | Status | None | Invalid | |
Open/Closed | Open | Closed | |||
2022-11-03 | bmcdonnell_npm | Attached File | - | Added lwip-git-diff.png, #53926 |
Powered by Savane 3.13-02a9.
Corresponding source code
It seems I was mistaken; it is conventional to use htons on the port passed to bind. Please close this bug report.