From MAILER-DAEMON Wed Nov 02 08:21:32 2022 Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1oqCkN-0000l8-SQ for mharc-lwip-devel@gnu.org; Wed, 02 Nov 2022 08:21:32 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oqCkM-0000ij-79; Wed, 02 Nov 2022 08:21:30 -0400 Received: from frontend1.savannah.gnu.org ([209.51.188.72]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oqCkL-0007Wg-V3; Wed, 02 Nov 2022 08:21:29 -0400 Received: by frontend1.savannah.gnu.org (Postfix, from userid 33) id 9B09C20238; Wed, 2 Nov 2022 08:21:29 -0400 (EDT) To: jiangheng <853048484@qq.com>, lwip-devel@nongnu.org, lwip-members@nongnu.org From: jiangheng X-Savane-Server: savannah.nongnu.org:443 [209.51.188.72] MIME-Version: 1.0 Content-Type: text/plain;charset=UTF-8 X-Savane-Project: lwip X-Savane-Tracker: bugs X-Savane-Item-ID: 63305 X-Apparently-From: Savane authenticated user jinag12345 Message-Id: <20221102-122127.sv333441.25149@savannah.nongnu.org> References: In-Reply-To: Date: Wed, 2 Nov 2022 08:21:29 -0400 (EDT) Subject: [lwip-devel] [bug #63305] pbuf memory leak occurs when tcp packets are out of order. X-BeenThere: lwip-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: lwip-devel List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Nov 2022 12:21:30 -0000 URL: Summary: pbuf memory leak occurs when tcp packets are out of order. Project: lwIP - A Lightweight TCP/IP stack Submitter: jinag12345 Submitted: Wed 02 Nov 2022 12:21:27 PM UTC Category: TCP Severity: 3 - Normal Item Group: Crash Error Status: None Privacy: Public Assigned to: None Open/Closed: Open Discussion Lock: Any Planned Release: None lwIP version: 2.1.3 _______________________________________________________ Follow-up Comments: ------------------------------------------------------- Date: Wed 02 Nov 2022 12:21:27 PM UTC By: jiangheng according to code review: 1. tcp packets are out of sequence, lwip will create segment(tcp_seg_copy), pbuf->ref will add 1 (Assume that pbuf->ref sent by driver is 1),pbuf->ref now is 2. https://git.savannah.nongnu.org/cgit/lwip.git/tree/src/core/tcp_in.c#n1656 2. then in “Received in-sequence data, adjust ooseq data” code branch: https://git.savannah.nongnu.org/cgit/lwip.git/tree/src/core/tcp_in.c#n1524 https://git.savannah.nongnu.org/cgit/lwip.git/tree/src/core/tcp_in.c#n1506 If the new TCP data can completely overwrite the old pcb->ooseq, lwip call tcp_free_seg, pbuf->ref increase 1 and then no one increase it again. In this case, the PBUF memory leaks. Note: In the normal process, lwip call tcp_free_seg, pbuf->ref increase 1. then lwip translate data to the upper layer. The upper-layer app call pbuf_free to release the pbuf. _______________________________________________________ Reply to this item at: _______________________________________________ Message sent via Savannah https://savannah.nongnu.org/ From MAILER-DAEMON Wed Nov 02 08:35:23 2022 Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1oqCxn-0004nv-K3 for mharc-lwip-devel@gnu.org; Wed, 02 Nov 2022 08:35:23 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oqCxi-0004nM-Lq; Wed, 02 Nov 2022 08:35:19 -0400 Received: from frontend1.savannah.gnu.org ([209.51.188.72]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oqCxi-0006dW-AV; Wed, 02 Nov 2022 08:35:18 -0400 Received: by frontend1.savannah.gnu.org (Postfix, from userid 33) id DE27120238; Wed, 2 Nov 2022 08:35:16 -0400 (EDT) To: jiangheng <853048484@qq.com>, lwip-devel@nongnu.org, lwip-members@nongnu.org From: jiangheng X-Savane-Server: savannah.nongnu.org:443 [209.51.188.72] MIME-Version: 1.0 Content-Type: text/plain;charset=UTF-8 X-Savane-Project: lwip X-Savane-Tracker: bugs X-Savane-Item-ID: 63306 X-Apparently-From: Savane authenticated user jinag12345 Message-Id: <20221102-123514.sv333441.91194@savannah.nongnu.org> References: In-Reply-To: Date: Wed, 2 Nov 2022 08:35:16 -0400 (EDT) Subject: [lwip-devel] [bug #63306] Is it possible that pcb->lastack is greater than seg->tcphdr->seqno? X-BeenThere: lwip-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: lwip-devel List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Nov 2022 12:35:19 -0000 URL: Summary: Is it possible that pcb->lastack is greater than seg->tcphdr->seqno? Project: lwIP - A Lightweight TCP/IP stack Submitter: jinag12345 Submitted: Wed 02 Nov 2022 12:35:14 PM UTC Category: TCP Severity: 3 - Normal Item Group: Crash Error Status: None Privacy: Public Assigned to: None Open/Closed: Open Discussion Lock: Any Planned Release: None lwIP version: 2.1.3 _______________________________________________________ Follow-up Comments: ------------------------------------------------------- Date: Wed 02 Nov 2022 12:35:14 PM UTC By: jiangheng in tcp_output function: https://git.savannah.nongnu.org/cgit/lwip.git/tree/src/core/tcp_out.c#n1309 if the seg is a retransmit segment,The peer client confirms only part of the data of the segment. The value of pcb->lastack will be greater than that of seg->tcphdr->seqno. line 1309 will be a bug. because segment that part of data be confirmed will be retransmited whole segment. https://git.savannah.nongnu.org/cgit/lwip.git/tree/src/core/tcp_in.c#n1111 _______________________________________________________ Reply to this item at: _______________________________________________ Message sent via Savannah https://savannah.nongnu.org/ From MAILER-DAEMON Wed Nov 02 08:53:21 2022 Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1oqDFA-0006tm-J4 for mharc-lwip-devel@gnu.org; Wed, 02 Nov 2022 08:53:20 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oqDF9-0006ta-AS; Wed, 02 Nov 2022 08:53:19 -0400 Received: from frontend1.savannah.gnu.org ([209.51.188.72]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oqDF9-0007AJ-19; Wed, 02 Nov 2022 08:53:19 -0400 Received: by frontend1.savannah.gnu.org (Postfix, from userid 33) id D535720238; Wed, 2 Nov 2022 08:53:18 -0400 (EDT) To: jiangheng <853048484@qq.com>, lwip-devel@nongnu.org, lwip-members@nongnu.org From: jiangheng X-Savane-Server: savannah.nongnu.org:443 [209.51.188.72] MIME-Version: 1.0 Content-Type: text/plain;charset=UTF-8 X-Savane-Project: lwip X-Savane-Tracker: bugs X-Savane-Item-ID: 63306 X-Apparently-From: Savane authenticated user jinag12345 Message-Id: <20221102-125318.sv333441.31011@savannah.nongnu.org> References: <20221102-123514.sv333441.91194@savannah.nongnu.org> In-Reply-To: <20221102-123514.sv333441.91194@savannah.nongnu.org> Date: Wed, 2 Nov 2022 08:53:18 -0400 (EDT) Subject: [lwip-devel] [bug #63306] Is it possible that pcb->lastack is greater than seg->tcphdr->seqno? X-BeenThere: lwip-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: lwip-devel List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Nov 2022 12:53:19 -0000 Follow-up Comment #1, bug #63306 (project lwip): by the way, how can I become a maintainer, lwip community is not active, many issues went unanswered,there are many possible bugfixes. i want to help community review and merge code, i am good at TCP/IP module _______________________________________________________ Reply to this item at: _______________________________________________ Message sent via Savannah https://savannah.nongnu.org/ From MAILER-DAEMON Thu Nov 03 16:04:31 2022 Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1oqgRz-0004V0-O4 for mharc-lwip-devel@gnu.org; Thu, 03 Nov 2022 16:04:31 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oqgRx-0004PV-S9; Thu, 03 Nov 2022 16:04:29 -0400 Received: from frontend1.savannah.gnu.org ([209.51.188.72]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oqgRx-0002HP-5R; Thu, 03 Nov 2022 16:04:29 -0400 Received: by frontend1.savannah.gnu.org (Postfix, from userid 33) id 6C59620238; Thu, 3 Nov 2022 16:04:27 -0400 (EDT) To: Brendan McDonnell , lwip-devel@nongnu.org, lwip-members@nongnu.org From: Brendan McDonnell X-Savane-Server: savannah.nongnu.org:443 [209.51.188.72] MIME-Version: 1.0 Content-Type: text/plain;charset=UTF-8 X-Savane-Project: lwip X-Savane-Tracker: bugs X-Savane-Item-ID: 63312 X-Apparently-From: Savane authenticated user bmcdonnell_npm Message-Id: <20221103-200425.sv336033.52289@savannah.nongnu.org> References: In-Reply-To: Date: Thu, 3 Nov 2022 16:04:27 -0400 (EDT) Subject: [lwip-devel] [bug #63312] sockets bug? Port endianness X-BeenThere: lwip-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: lwip-devel List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Nov 2022 20:04:30 -0000 URL: Summary: sockets bug? Port endianness Project: lwIP - A Lightweight TCP/IP stack Submitter: bmcdonnell_npm Submitted: Thu 03 Nov 2022 08:04:25 PM UTC Category: sockets/netconn 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: Other _______________________________________________________ Follow-up Comments: ------------------------------------------------------- Date: Thu 03 Nov 2022 08:04:25 PM UTC By: Brendan McDonnell 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? Details: The attached zip contains sample code from NXP for their i.MX RT1170 Evaluation Kit (board URL below). The included lwIP appears to be based on the 2.2.0 development branch. It does not include my sockets code, nor the patch to lwIP in my screenshot. https://www.nxp.com/design/development-boards/i-mx-evaluation-and-development-boards/i-mx-rt1170-evaluation-kit:MIMXRT1170-EVK I checked out the sample using MCUXpresso IDE v11.6.1 (Quickstart Panel -> Import SDK example(s)). Relevant lwipopts: #define LWIP_SOCKET 1 #define LWIP_IPV4 1 #define LWIP_IPV6 0 Via platform #defines / #ifdefs: BYTE_ORDER == _LITTLE_ENDIAN == 1234 _______________________________________________________ File Attachments: ------------------------------------------------------- Date: Thu 03 Nov 2022 08:04:25 PM UTC Name: lwip-git-diff.png Size: 36KiB By: bmcdonnell_npm _______________________________________________________ Reply to this item at: _______________________________________________ Message sent via Savannah https://savannah.nongnu.org/ From MAILER-DAEMON Thu Nov 03 16:12:54 2022 Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1oqga5-0008AH-El for mharc-lwip-devel@gnu.org; Thu, 03 Nov 2022 16:12:53 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oqga2-00089q-Gc; Thu, 03 Nov 2022 16:12:51 -0400 Received: from frontend1.savannah.gnu.org ([209.51.188.72]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oqga2-0003dJ-9E; Thu, 03 Nov 2022 16:12:50 -0400 Received: by frontend1.savannah.gnu.org (Postfix, from userid 33) id D6E5720238; Thu, 3 Nov 2022 16:12:49 -0400 (EDT) To: Brendan McDonnell , lwip-devel@nongnu.org, lwip-members@nongnu.org From: Brendan McDonnell X-Savane-Server: savannah.nongnu.org:443 [209.51.188.72] MIME-Version: 1.0 Content-Type: text/plain;charset=UTF-8 X-Savane-Project: lwip X-Savane-Tracker: bugs X-Savane-Item-ID: 63312 X-Apparently-From: Savane authenticated user bmcdonnell_npm Message-Id: <20221103-201249.sv336033.47836@savannah.nongnu.org> References: <20221103-200425.sv336033.52289@savannah.nongnu.org> In-Reply-To: <20221103-200425.sv336033.52289@savannah.nongnu.org> Date: Thu, 3 Nov 2022 16:12:49 -0400 (EDT) Subject: [lwip-devel] [bug #63312] sockets bug? Port endianness X-BeenThere: lwip-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: lwip-devel List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Nov 2022 20:12:52 -0000 Follow-up Comment #1, bug #63312 (project lwip): Apparently this forum won't let me attach a zip file. I used the "lwip_dhcp_freertos_cm7" example. _______________________________________________________ Reply to this item at: _______________________________________________ Message sent via Savannah https://savannah.nongnu.org/ From MAILER-DAEMON Fri Nov 04 17:19:22 2022 Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1or45x-00012m-Kp for mharc-lwip-devel@gnu.org; Fri, 04 Nov 2022 17:19:21 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1or45u-00012U-6K; Fri, 04 Nov 2022 17:19:18 -0400 Received: from frontend1.savannah.gnu.org ([209.51.188.72]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1or45t-0008VK-Tj; Fri, 04 Nov 2022 17:19:17 -0400 Received: by frontend1.savannah.gnu.org (Postfix, from userid 33) id 0CD7C20247; Fri, 4 Nov 2022 17:19:16 -0400 (EDT) To: Brendan McDonnell , lwip-devel@nongnu.org, lwip-members@nongnu.org From: Brendan McDonnell X-Savane-Server: savannah.nongnu.org:443 [209.51.188.72] MIME-Version: 1.0 Content-Type: text/plain;charset=UTF-8 X-Savane-Project: lwip X-Savane-Tracker: bugs X-Savane-Item-ID: 63312 X-Apparently-From: Savane authenticated user bmcdonnell_npm Message-Id: <20221104-211916.sv336033.57841@savannah.nongnu.org> References: <20221103-200425.sv336033.52289@savannah.nongnu.org> <20221103-201249.sv336033.47836@savannah.nongnu.org> In-Reply-To: <20221103-201249.sv336033.47836@savannah.nongnu.org> Date: Fri, 4 Nov 2022 17:19:16 -0400 (EDT) Subject: [lwip-devel] [bug #63312] sockets bug? Port endianness X-BeenThere: lwip-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: lwip-devel List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Nov 2022 21:19:18 -0000 Follow-up Comment #2, bug #63312 (project lwip): It seems I was mistaken; it is conventional to use htons on the port passed to bind. Please close this bug report. _______________________________________________________ Reply to this item at: _______________________________________________ Message sent via Savannah https://savannah.nongnu.org/ From MAILER-DAEMON Sun Nov 06 11:58:01 2022 Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1oriy9-0005DG-Nm for mharc-lwip-devel@gnu.org; Sun, 06 Nov 2022 11:58:01 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oriy7-0005Cv-7X; Sun, 06 Nov 2022 11:57:59 -0500 Received: from frontend1.savannah.gnu.org ([209.51.188.72]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oriy6-0003ca-6L; Sun, 06 Nov 2022 11:57:58 -0500 Received: by frontend1.savannah.gnu.org (Postfix, from userid 33) id E657D20238; Sun, 6 Nov 2022 11:57:57 -0500 (EST) To: Faidon Liambotis , lwip-devel@nongnu.org, lwip-members@nongnu.org From: Faidon Liambotis X-Savane-Server: savannah.nongnu.org:443 [209.51.188.72] MIME-Version: 1.0 Content-Type: text/plain;charset=UTF-8 X-Savane-Project: lwip X-Savane-Tracker: bugs X-Savane-Item-ID: 63322 X-Apparently-From: Savane authenticated user paravoid Message-Id: <20221106-165755.sv143144.87643@savannah.nongnu.org> References: In-Reply-To: Date: Sun, 6 Nov 2022 11:57:57 -0500 (EST) Subject: [lwip-devel] [bug #63322] Allow custom (non-libc) malloc implementations to be provided X-BeenThere: lwip-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: lwip-devel List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Nov 2022 16:57:59 -0000 URL: Summary: Allow custom (non-libc) malloc implementations to be provided Project: lwIP - A Lightweight TCP/IP stack Submitter: paravoid Submitted: Sun 06 Nov 2022 04:57:55 PM UTC Category: Platform ports Severity: 3 - Normal Item Group: Feature Request Status: None Privacy: Public Assigned to: None Open/Closed: Open Discussion Lock: Any Planned Release: None lwIP version: git head _______________________________________________________ Follow-up Comments: ------------------------------------------------------- Date: Sun 06 Nov 2022 04:57:55 PM UTC By: Faidon Liambotis In 2006 (commit a91374a9) MEM_LIBC_MALLOC was introduced, to allow one to use the libc's implementation of malloc/calloc/free. Unfortunately this does not allow one to plug a different, non-lwip, non-libc implementation. The code is not far from there: setting MEM_LIBC_MALLOC=1 and #defining mem_clib_free, mem_clib_malloc and mem_clib_calloc is enough to work around this. A spurious #include of happens in that case, though. Instead of this workaround, we can generalize this into MEM_CUSTOM_MALLOC/_CALLOC/_FREE definitions, and make MEM_LIBC_MALLOC a specialized case of it. I gave it a stab with the patch attached. Let me know what you think and please feel free to modify as necessary! _______________________________________________________ File Attachments: ------------------------------------------------------- Date: Sun 06 Nov 2022 04:57:55 PM UTC Name: 0001-Add-MEM_CUSTOM_ALLOCATOR-and-make-LIBC-a-subset-of-i.patch Size: 6KiB By: paravoid _______________________________________________________ Reply to this item at: _______________________________________________ Message sent via Savannah https://savannah.nongnu.org/ From MAILER-DAEMON Sun Nov 06 14:13:42 2022 Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1orl5S-0007ME-Ca for mharc-lwip-devel@gnu.org; Sun, 06 Nov 2022 14:13:42 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1orl5P-0007Lw-Tc; Sun, 06 Nov 2022 14:13:39 -0500 Received: from frontend1.savannah.gnu.org ([209.51.188.72]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1orl5P-0006KG-Hz; Sun, 06 Nov 2022 14:13:39 -0500 Received: by frontend1.savannah.gnu.org (Postfix, from userid 33) id 06B6520238; Sun, 6 Nov 2022 14:13:39 -0500 (EST) To: Faidon Liambotis , lwip-devel@nongnu.org, lwip-members@nongnu.org From: Faidon Liambotis X-Savane-Server: savannah.nongnu.org:443 [209.51.188.72] MIME-Version: 1.0 Content-Type: text/plain;charset=UTF-8 X-Savane-Project: lwip X-Savane-Tracker: bugs X-Savane-Item-ID: 63324 X-Apparently-From: Savane authenticated user paravoid Message-Id: <20221106-191337.sv143144.62370@savannah.nongnu.org> References: In-Reply-To: Date: Sun, 6 Nov 2022 14:13:39 -0500 (EST) Subject: [lwip-devel] [bug #63324] memcpy(), memmove() and other libc dependencies X-BeenThere: lwip-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: lwip-devel List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Nov 2022 19:13:40 -0000 URL: Summary: memcpy(), memmove() and other libc dependencies Project: lwIP - A Lightweight TCP/IP stack Submitter: paravoid Submitted: Sun 06 Nov 2022 07:13:37 PM UTC Category: Platform ports Severity: 3 - Normal Item Group: Feature Request Status: None Privacy: Public Assigned to: None Open/Closed: Open Discussion Lock: Any Planned Release: None lwIP version: git head _______________________________________________________ Follow-up Comments: ------------------------------------------------------- Date: Sun 06 Nov 2022 07:13:37 PM UTC By: Faidon Liambotis In 2007 (commit 255d5a74, v1.3.0) the MEMCPY and SMEMCPY macros were introduced with this description: 2007-05-09 Simon Goldschmidt * opt.h, *.c/*.h: Included patch #5920: Create define to override C-library memcpy. 2 Defines are created: MEMCPY() for normal memcpy, SMEMCPY() for situations where some compilers might inline the copy and save a function call. Also replaced all calls to memcpy() with calls to (S)MEMCPY(). In 2017 (commit 7cedf7ae) MEMMOVE was also added along the same lines. A few direct (lowercase) uses have creeped in since. I am working on a project with NO_SYS=1, that should build without a libc available, and I am defining MEMCPY and MEMMOVE to internal reimplementations of these functions. I hit on memcpy() being directly used in ip6addr_ntoa_r (ip6_addr.c) and memmove() in lwip_itoa (def.c). Grepping through the tree reveals a few more (but fortunately not too many). These should probably be replaced with the already existing MEMCPY and MEMMOVE macros. Additionally it would be good to define and use other string.h macros like MEMCMP and MEMSET. I ran into on memcmp() in eth_addr_cmp (ethernet.h), and memset() in netif_add (netif.c), tcp_alloc (tcp.c), udp_new (udp.c), ip_reass_enqueue_new_datagram (ipv4/ip4_frag.c), ip6_reass (ipv6/ip6_frag.c), dns_send (dns.c), plus a few uses in ipv4/dhcp.c. Finally, I also ran into strlen() and strncmp() in pbuf_strstr (pbuf.c), lwip_strnstr (def.c) as well as strlen() in dns_send (dns.c). It does feel a bit like a game of whack-a-mole, so I am curious how you feel this compares to the existing facilities (MEMCPY/MEMMOVE), and if there are other recommendations for systems where a libc is unavailable. In all of those cases, it looks like there is an #include in the source files. Given this exists solely for those functions above, it'd be nice to avoid it, especially in NO_SYS mode. For what it's worth, on a simple NO_SYS=1 configuration, these 6 (memcmp, memset, strlen, strncmp, plus memcpy/memmove) are enough to avoid string.h altogether. That, plus atoi() in stdlib.h are the only libc dependencies that I had to workaround for my build. (I wonder if I should file a separate bug for atoi?) Finally, I am also unsure why these macros live in lwipopts.h rather than cc.h? The distinction between the two feels somewhat blurry, but my understanding is that it may fit better in cc.h. _______________________________________________________ Reply to this item at: _______________________________________________ Message sent via Savannah https://savannah.nongnu.org/ From MAILER-DAEMON Mon Nov 07 10:38:44 2022 Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1os4Cy-0002vP-SG for mharc-lwip-devel@gnu.org; Mon, 07 Nov 2022 10:38:44 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1os3Rz-00033E-8k for lwip-devel@nongnu.org; Mon, 07 Nov 2022 09:50:11 -0500 Received: from mail-wr1-x42c.google.com ([2a00:1450:4864:20::42c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1os3Rx-0005QB-MS for lwip-devel@nongnu.org; Mon, 07 Nov 2022 09:50:11 -0500 Received: by mail-wr1-x42c.google.com with SMTP id o4so16591363wrq.6 for ; Mon, 07 Nov 2022 06:50:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=to:date:message-id:subject:mime-version:from:from:to:cc:subject :date:message-id:reply-to; bh=vNdRBIU5VgwYTeWPDEMkVusGTYi4rFS16hSpkRmsMuk=; b=qlB+AoqVPRHAGaUg6ZFZLF+7SrU3ean57cOcVEwCibMpfKhDyMiyH3NWsJj2716iLW yaF/Vd4W52ZSOirEAFArBsx2slWsN6yIdNz7+2R0uQc0nHxs/ukjtogzSlOm+C0RcDJp zVDhAtVP51zf6+hohFjZ5UV+3D1DDxQIMW7/wrSyP7wcxuFXDvT0sEykzk4F5MY+l9pt Te77loIs24wt9zjX1pigZYt+/PxDAF8sD2MOq1z8qsDqqPPeraznm91lUecsDn5khVXA UyETmh1hzEETHBl+6bAOkN4QjjNBNRwcBr4dYUOhffMfC+MYeVj30ZEM5uNpF2/yIzya ohJQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=to:date:message-id:subject:mime-version:from:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=vNdRBIU5VgwYTeWPDEMkVusGTYi4rFS16hSpkRmsMuk=; b=Rbs/p3sOl4XjWWm7BvkkFC7KxrIXa7r3qRjGoBwG8RpvRpw6xZoISWhzjRsTmXuQjB CmRENUhy2cbsOVzbuVipCQvyJRN9aGLOyQrxjyB/bECOh9iz9hVnFxPiAhNtvGrh8VSi dweh1iRwR1Mz5tbf9AUHUpJPLy1+5EILJ16rm50dhLgc0LlC9G7SmAXwLM16+wJ0JhES I1ypqcmv083jAHDZWonbdQ9LbIkgzax8auxlieM0rILsiSbiHtAg1F3xNgmTNjuPv8bO cnnyg4QRXLqbRBR2Ch8UHksGnFUxzQy7mnvac1hpHnzQjrDc9WxeulgXte9RxzT5htnb zANw== X-Gm-Message-State: ACrzQf0I0B+ZsgX9yl18q7crJfpXZtxfO0yxtAAzx9m4U+1lYB2/GtYq 2bnbSxBVqQjYT+dJ1CKomzEHGeYGpRA= X-Google-Smtp-Source: AMsMyM6leI3aEJdjgywOcwPjX2ay1pmDWp2ZkPBenTrpEznn16VI3e2+nWiAIhNE1/BqBeUQ2IBz4A== X-Received: by 2002:a5d:4a0a:0:b0:236:6c65:724d with SMTP id m10-20020a5d4a0a000000b002366c65724dmr32084438wrq.350.1667832604731; Mon, 07 Nov 2022 06:50:04 -0800 (PST) Received: from smtpclient.apple (host-79-41-103-217.retail.telecomitalia.it. [79.41.103.217]) by smtp.gmail.com with ESMTPSA id w2-20020adfcd02000000b0022ac672654dsm7454012wrm.58.2022.11.07.06.50.03 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 07 Nov 2022 06:50:04 -0800 (PST) From: Federico Frigo X-Google-Original-From: Federico Frigo Content-Type: multipart/alternative; boundary="Apple-Mail=_519FFF7A-10F8-4417-BCB4-55C949DA90D6" Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3731.200.110.1.12\)) Message-Id: <10389813-10A8-48AD-A329-1ABDBBEC0FA2@gmail.com> Date: Mon, 7 Nov 2022 15:49:52 +0100 To: lwip-devel@nongnu.org X-Mailer: Apple Mail (2.3731.200.110.1.12) Received-SPF: pass client-ip=2a00:1450:4864:20::42c; envelope-from=ffrigo8@gmail.com; helo=mail-wr1-x42c.google.com X-Spam_score_int: -17 X-Spam_score: -1.8 X-Spam_bar: - X-Spam_report: (-1.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Mon, 07 Nov 2022 10:38:43 -0500 Subject: [lwip-devel] PPP dial-on-demand X-BeenThere: lwip-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: lwip-devel List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Nov 2022 14:50:11 -0000 --Apple-Mail=_519FFF7A-10F8-4417-BCB4-55C949DA90D6 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 Hi all, I=E2=80=99m developing a custom firmare for an ESP8266; I have to setup = a mechanism that starts a PPP connection when packets are forwarded to = it using NAT. I saw that the PPP stack is the same (adapted) of Linux, = but I noticed that DEMAND_SUPPORT is disabled by default since it is not = supported. Is there a plan for releasing it? Otherwise I could try to implement it, = but I=E2=80=99ll need some help since I have no clue where to start = from. Federico Frigo Master=E2=80=99s Degree in Computer Science =F0=9F=91=A8=F0=9F=8F=BB=E2=80=8D=F0=9F=92=BB GitHub = =F0=9F=92=BC LinkedIn =F0=9F=93=B1 WhatsApp --Apple-Mail=_519FFF7A-10F8-4417-BCB4-55C949DA90D6 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8 Hi = all,
I=E2=80=99m developing a custom firmare for an ESP8266; I have = to setup a mechanism that starts a PPP connection when packets are = forwarded to it using NAT. I saw that the PPP stack is the same = (adapted) of Linux, but I noticed that DEMAND_SUPPORT is disabled by = default since it is not supported.
Is there a plan for = releasing it? Otherwise I could try to implement it, but I=E2=80=99ll = need some help since I have no clue where to start = from.

Federico Frigo
Master=E2=80=99s Degree in = Computer Science

=F0=9F=91=A8=F0=9F=8F=BB=E2=80=8D=F0=9F=92=BB&n= bsp;GitHub
=F0=9F=92=BC LinkedIn
=F0=9F=93=B1 WhatsApp

= --Apple-Mail=_519FFF7A-10F8-4417-BCB4-55C949DA90D6-- From MAILER-DAEMON Mon Nov 07 18:39:24 2022 Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1osBi7-0003hs-7T for mharc-lwip-devel@gnu.org; Mon, 07 Nov 2022 18:39:24 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1osBi4-0003gx-UQ; Mon, 07 Nov 2022 18:39:20 -0500 Received: from frontend1.savannah.gnu.org ([209.51.188.72]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1osBht-0004O0-RM; Mon, 07 Nov 2022 18:39:20 -0500 Received: by frontend1.savannah.gnu.org (Postfix, from userid 33) id 47CDD207D7; Mon, 7 Nov 2022 18:39:03 -0500 (EST) To: , Erik Ekman , lwip-devel@nongnu.org, lwip-members@nongnu.org From: Erik Ekman X-Savane-Server: savannah.nongnu.org:443 [2001:470:142::72] MIME-Version: 1.0 Content-Type: text/plain;charset=UTF-8 X-Savane-Project: lwip X-Savane-Tracker: bugs X-Savane-Item-ID: 63312 X-Apparently-From: Savane authenticated user yarrick Message-Id: <20221108-003903.sv66576.89798@savannah.nongnu.org> References: <20221103-200425.sv336033.52289@savannah.nongnu.org> <20221103-201249.sv336033.47836@savannah.nongnu.org> <20221104-211916.sv336033.57841@savannah.nongnu.org> In-Reply-To: <20221104-211916.sv336033.57841@savannah.nongnu.org> Date: Mon, 7 Nov 2022 18:39:03 -0500 (EST) Subject: [lwip-devel] [bug #63312] sockets bug? Port endianness X-BeenThere: lwip-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: lwip-devel List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Nov 2022 23:39:21 -0000 Update of bug #63312 (project lwip): Status: None => Invalid Open/Closed: Open => Closed _______________________________________________________ Reply to this item at: _______________________________________________ Message sent via Savannah https://savannah.nongnu.org/ From MAILER-DAEMON Tue Nov 15 02:33:44 2022 Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1ouqRz-0004Ii-VP for mharc-lwip-devel@gnu.org; Tue, 15 Nov 2022 02:33:43 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ouqRy-0004IU-Ph; Tue, 15 Nov 2022 02:33:42 -0500 Received: from frontend1.savannah.gnu.org ([209.51.188.72]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ouqRy-0001A6-6Y; Tue, 15 Nov 2022 02:33:42 -0500 Received: by frontend1.savannah.gnu.org (Postfix, from userid 33) id 9F0BD20227; Tue, 15 Nov 2022 02:33:40 -0500 (EST) To: jiangheng <853048484@qq.com>, lwip-devel@nongnu.org, lwip-members@nongnu.org From: jiangheng X-Savane-Server: savannah.nongnu.org:443 [209.51.188.72] MIME-Version: 1.0 Content-Type: text/plain;charset=UTF-8 X-Savane-Project: lwip X-Savane-Tracker: bugs X-Savane-Item-ID: 63305 X-Apparently-From: Savane authenticated user jinag12345 Message-Id: <20221115-073340.sv333441.16356@savannah.nongnu.org> References: <20221102-122127.sv333441.25149@savannah.nongnu.org> In-Reply-To: <20221102-122127.sv333441.25149@savannah.nongnu.org> Date: Tue, 15 Nov 2022 02:33:40 -0500 (EST) Subject: [lwip-devel] [bug #63305] pbuf memory leak occurs when tcp packets are out of order. X-BeenThere: lwip-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: lwip-devel List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Nov 2022 07:33:43 -0000 Follow-up Comment #1, bug #63305 (project lwip): In practice, the pbuf was released correctly. although I don't know how _______________________________________________________ Reply to this item at: _______________________________________________ Message sent via Savannah https://savannah.nongnu.org/ From MAILER-DAEMON Tue Nov 15 05:50:23 2022 Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1outWJ-0006LX-9f for mharc-lwip-devel@gnu.org; Tue, 15 Nov 2022 05:50:23 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1outWA-0006IC-HI; Tue, 15 Nov 2022 05:50:18 -0500 Received: from frontend1.savannah.gnu.org ([209.51.188.72]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1outW9-0006JF-L4; Tue, 15 Nov 2022 05:50:14 -0500 Received: by frontend1.savannah.gnu.org (Postfix, from userid 33) id 47EF220227; Tue, 15 Nov 2022 05:50:11 -0500 (EST) To: Jonathan D , lwip-devel@nongnu.org, lwip-members@nongnu.org From: Jonathan D X-Savane-Server: savannah.nongnu.org:443 [209.51.188.72] MIME-Version: 1.0 Content-Type: text/plain;charset=UTF-8 X-Savane-Project: lwip X-Savane-Tracker: task X-Savane-Item-ID: 16283 X-Apparently-From: Savane authenticated user jona Message-Id: <20221115-105009.sv174670.87095@savannah.nongnu.org> References: In-Reply-To: Date: Tue, 15 Nov 2022 05:50:11 -0500 (EST) Subject: [lwip-devel] [task #16283] LwIP 2.1.3 with mbedTLS 2.28.1 generates 3 warnings with `gcc -std=gnu11 -Wall` (GCC 10) X-BeenThere: lwip-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: lwip-devel List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Nov 2022 10:50:20 -0000 URL: Summary: LwIP 2.1.3 with mbedTLS 2.28.1 generates 3 warnings with `gcc -std=gnu11 -Wall` (GCC 10) Project: lwIP - A Lightweight TCP/IP stack Submitter: jona Submitted: Tue 15 Nov 2022 10:50:09 AM UTC Category: None Should Start On: Tue 15 Nov 2022 12:00:00 AM UTC Should be Finished on: Tue 15 Nov 2022 12:00:00 AM UTC Priority: 5 - Normal Status: None Privacy: Public Percent Complete: 0% Assigned to: None Open/Closed: Open Discussion Lock: Any Planned Release: None Effort: 0.00 _______________________________________________________ Follow-up Comments: ------------------------------------------------------- Date: Tue 15 Nov 2022 10:50:09 AM UTC By: Jonathan D Hello, After having upgrade mbedTLS from 2.28.0 to 2.28.1, GCC generates 3 warnings: Description Resource Path Location Type ignoring return value of 'mbedtls_ssl_flush_output' declared with attribute 'warn_unused_result' [-Wunused-result] altcp_tls_mbedtls.c /SV-H743/LwIP/src/apps/altcp_tls line 522 C/C++ Problem ignoring return value of 'mbedtls_ssl_flush_output' declared with attribute 'warn_unused_result' [-Wunused-result] altcp_tls_mbedtls.c /SV-H743/LwIP/src/apps/altcp_tls line 546 C/C++ Problem ignoring return value of 'mbedtls_ssl_flush_output' declared with attribute 'warn_unused_result' [-Wunused-result] altcp_tls_mbedtls.c /SV-H743/LwIP/src/apps/altcp_tls line 1209 C/C++ Problem The `__warn_unused_result__` was introduced in mbedTLS 2.28.1 for `mbedtls_ssl_flush_output`. This attribute was not there in mbedTLS 2.28.0. A patch doesn't seem obvious to me. Best regards _______________________________________________________ Reply to this item at: _______________________________________________ Message sent via Savannah https://savannah.nongnu.org/ From MAILER-DAEMON Wed Nov 16 16:11:34 2022 Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1ovPgz-0004Py-Fr for mharc-lwip-devel@gnu.org; Wed, 16 Nov 2022 16:11:34 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ovNyG-0003zW-D3 for lwip-devel@nongnu.org; Wed, 16 Nov 2022 14:21:16 -0500 Received: from mail-ed1-x535.google.com ([2a00:1450:4864:20::535]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ovNyE-0000SH-Si for lwip-devel@nongnu.org; Wed, 16 Nov 2022 14:21:16 -0500 Received: by mail-ed1-x535.google.com with SMTP id v27so28120589eda.1 for ; Wed, 16 Nov 2022 11:21:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=2XUxnV2XhPHGLslgNxh+8XEti5cF7cY1ArFQdjG+tts=; b=n1dO18xlM5+/I8K1hXotlU3/LIDMXy6YHBx+txHyfGhspGpznU/ebMZRrnXt78PF9n IWeBzkzmZdIyXQS9EjQTm8usXXWbvBg0oj71RBn/08HePQFRDmR18sEky7CrphmFw8Kk ljfcnXhUt5XoCCjgUMV5ZUibDLPRg6x9eDPbk2eoa1nY8vPzHnXzcS0sp3JGnhQhDQbp SUOBf6JeHVap6qfs5UiJDSWsTq2z705agm4rUs0fUNhWDshHLhCP9bYivAP1FwSXNUoM t7MBFKZq6B950sk8SlUssZ2fLE86eSV7ymd9O7gtepLnGrB/wrdAhw+2tHbWYZpwPYeh 3nTw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=2XUxnV2XhPHGLslgNxh+8XEti5cF7cY1ArFQdjG+tts=; b=vgrneCZnHTe/Qdcqy0edD9y6FXXQK37V88JlMVIRt2bI2KXTq0UjWn670RAVNAA7xS b56aVSGpxR09Wu6OoTW+AjvcodS7HFMVfRQVu9JPuxlvrLx+vwPtOwGyvTvY5RKe9dne EBLvAmky7CyqEVo+6yzf3lLqNAySNerlUoWwTPEkts3pg2By+hZu+IUh5OU3oLCM1o9v OU+zZtT6Kmv0JABCekOGDzzoH+og+yEty2HPfzxP5Ng10FMwwtBIPdbSy5Sv5zDvIrn+ iBpO3B0TCwV2MQ6uwUtFChQiJyhTKh8AbN9jX0f2iVB6a/zu2AUsFlL/xafgwACBkD2h QH3Q== X-Gm-Message-State: ANoB5pnoBNX0FfBbjjcUxGoSoV4gU3FgyOR+CkH2qXVDptBYNUQBqs8R strw84fjMc13de94uDKkysfKZ1ffxWMwh90xX9/ouBxDMO4wkg== X-Google-Smtp-Source: AA0mqf7w+0+1HTqXfu4Hv+E++7jyQKAf0avgmFDSkCQeFHESQrXrHX+yoyJptJe56rU0Q/vSR6CDqRa/fszfh7HUKmY= X-Received: by 2002:a05:6402:1004:b0:461:53b0:2ac0 with SMTP id c4-20020a056402100400b0046153b02ac0mr19698906edu.153.1668626472202; Wed, 16 Nov 2022 11:21:12 -0800 (PST) MIME-Version: 1.0 From: Daniel Lastanao Date: Wed, 16 Nov 2022 20:21:01 +0100 Message-ID: To: lwip-devel@nongnu.org Content-Type: multipart/alternative; boundary="00000000000023764205ed9b60b8" Received-SPF: pass client-ip=2a00:1450:4864:20::535; envelope-from=daniel13lm@gmail.com; helo=mail-ed1-x535.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Wed, 16 Nov 2022 16:11:28 -0500 Subject: [lwip-devel] New Hook IP function for output packages X-BeenThere: lwip-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: lwip-devel List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Nov 2022 19:21:16 -0000 --00000000000023764205ed9b60b8 Content-Type: text/plain; charset="UTF-8" I am thinking about implementing a LWIP_HOOK_IP4_OUTPUT and a LWIP_HOOK_IP6_OUTPUT hook function, for the following reasons, in the first place I do not understand why exists an INPUT hook function (LWIP_HOOK_IP4_INPUT, LWIP_HOOK_IP6_INPUT) and not an OUTPUT hook function, in second place I need it for my study project. I have been looking for information and no one has said it before. I do not know how it could be done, all help is welcome. --00000000000023764205ed9b60b8 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
I am thinking about implementing a LWIP_HOOK_IP4_OUTPUT and a LWI= P_HOOK_IP6_OUTPUT hook function, for the following reasons, in the first pl= ace I do not understand why exists an INPUT hook function (LWIP_HOOK_IP4_IN= PUT, LWIP_HOOK_IP6_INPUT) and not an OUTPUT hook function, in second place = I need it for my study project. I have been looking for information and no = one has said it before. I do not know how it could be done, all help is wel= come.


--00000000000023764205ed9b60b8-- From MAILER-DAEMON Thu Nov 17 05:34:12 2022 Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1ovcDk-0007RM-Bu for mharc-lwip-devel@gnu.org; Thu, 17 Nov 2022 05:34:12 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ovcDb-0007QL-Fk for lwip-devel@nongnu.org; Thu, 17 Nov 2022 05:34:04 -0500 Received: from mout.gmx.net ([212.227.15.15]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ovcDZ-0003Ne-KM for lwip-devel@nongnu.org; Thu, 17 Nov 2022 05:34:03 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.de; s=s31663417; t=1668681237; bh=KM5T7MXWIL5rL3jsLX4BKjNMfl/mEDkB/lXi3dg7q9g=; h=X-UI-Sender-Class:Date:From:To:Subject:In-Reply-To:References; b=i2Jxi8svECS1rXPzsIyafvR5vIod/rAvMIgP6oz8r4Lk0plPkXzbnE43U6Fq3wpO2 pd9mqHFCzC4Vd4lNovy9GtI53H1R+/0eHgzZVdnPfx2ISSio9XtZM5CjFM8MNjiIg4 rDVOy6abP6qt2OGMfbztl8mV/7AbhxjEKrZN/hJP4P3q2GVHXWHa5IqZNOLUBzmwCJ SCedIe943aFMH8/mLIbImYSdPEI/c3IC+PcCSUnXmgUrMfI9yxk3U/Tc9TyR0Pl0wd Yj4xGyGtWeTbvv2adFQePdI7mb2b04Uu6X7I4uUxGlZ+hxgCOiz4+2/ltz0Bvzr5uz lMbNLJLoZzI3g== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from [127.0.0.1] ([176.199.209.222]) by mail.gmx.net (mrgmx004 [212.227.17.190]) with ESMTPSA (Nemesis) id 1Mv2xO-1pDQBR1MUi-00qytw for ; Thu, 17 Nov 2022 11:33:57 +0100 Date: Thu, 17 Nov 2022 11:33:55 +0100 From: Simon Goldschmidt To: lwip-devel User-Agent: K-9 Mail for Android In-Reply-To: References: Message-ID: <89130966-40B4-4EFC-A38A-FE1E28FC94D2@gmx.de> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:Z6GzGe5ws/KqJO4keATBTgNsLmSL/8IRytmpq605NyICfbq7nIe cb7BIC4QYaDKNZaNGXhrdHgkI+UjRxr2trBJ4pWxQAdCbMSsDuYbdRympkemSE/kjC/m2Aa zm8C9ZUBumEz16fur8BZO/TWHy1zTPRnPqH3LdwBt0mEpVwI7I+2OOoZWuK/veScGuQb0Tz CZicBbuWAzRfW1wY3AACw== UI-OutboundReport: notjunk:1;M01:P0:1tfxdaH6T0o=;LT03S+W3i9o4qnUZkSFrwM5LvBV bWNckjjbjG8HPRY1B51cwDYmjsywKYqOrQYlAIhPvDvsEqxvwhXB+0vfX3l9Q2qloT6fRZE8A uK0qrF/rijXZDSiQo4h0azLq/2VS+406OYssofHEwGGI5f6ScjHuyUyhckSlXISBCnKvChjQd KT67Kdp+gCCaz8QSyb1eKN21VpcFq+q8I+qgdFaZYpuTbkxJyx/v6ajEUsLMyGh39pj6/MaEJ KWCXI+OjcfCqckjufmYfCpMs+t/WaeTAuU/ewnKLJTnYUEggqGQL3sov7pJBrAPIMjtlFoifk abPEVjEaW3SwrIpfBRDx5HJxuVQrG74UmqxBCx1vP72VZToIlTu/Q7PtdhcBHBnNUOKG14VQW /n5HYjlWTncdMt9TYfw7W4MNmjGsYpqj7zI/98al2AlZ/55S4yTyjJuNPcfhDeymT8rSJIqnH Z+WepZFRXeBhdHNaOhRvxrMUnBX1feiQ1sfk3RsceALk+Sol4s6MM40wGUuIskkma8UxDNvvG 5TuRJSWC1ulK1tWFTcxkWb1SdltQQxO63XexK4+RQr8B7feBq8eKIzTW5W+s3aZl6fpRzn0iW H/ZbGrE9HULgu3+JepwkOsztAXzrQaLp40omlGpXtxmrHD/rB+F39ACkHIO6hd2sLEjFpIQCH Al4f8Bbo77cDkwgaOYG97r23xK8BVzcGK8LHjmp6V5Iq9YTzw+Gu/nY/NgJrA1jG2jsdUul9d ArFuasJGoLYhX/K9PvadaPtXREYSc3hAuq9fYR+7cGKKl6ojsXTkGaDBuJwRe55gwiBwilmT/ ulMYds+XvRFy5EPYKS4iZK/49eb42iqWpffvAY4rHtCRqulsWZBOZY+FHDTzjkUCPE7800ddG GvVPsvGSBhCBO12pDAa4zhBGVAkOMHyJajVESjMcEkcv7MzQqdeHRcf1cVqYPIv2HN3ynFLYo J4bbgz6pbrQAHWq+deRa7BnS5Lk= Received-SPF: pass client-ip=212.227.15.15; envelope-from=goldsimon@gmx.de; helo=mout.gmx.net X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action Subject: Re: [lwip-devel] New Hook IP function for output packages X-BeenThere: lwip-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: lwip-devel List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Nov 2022 10:34:06 -0000 Daniel Lastanao wrote: >I am thinking about implementing a LWIP_HOOK_IP4_OUTPUT and a >LWIP_HOOK_IP6_OUTPUT hook function, for the following reasons, in the fir= st >place I do not understand why exists an INPUT hook function >(LWIP_HOOK_IP4_INPUT, LWIP_HOOK_IP6_INPUT) and not an OUTPUT hook functio= n, Nearly everything in lwip exists because someone has needed it and impleme= nted it=2E The lack of an output hook simply suggests no one has needed it = before=2E >in second place I need it for my study project=2E I have been looking for >information and no one has said it before=2E I do not know how it could b= e >done, all help is welcome=2E I wouldn't see a reason to reject a patch adding such a hook=2E Regards, Simon From MAILER-DAEMON Wed Nov 23 18:40:59 2022 Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1oxzMR-0000EQ-Pk for mharc-lwip-devel@gnu.org; Wed, 23 Nov 2022 18:40:59 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oxzMQ-0000ED-79 for lwip-devel@nongnu.org; Wed, 23 Nov 2022 18:40:58 -0500 Received: from wout4-smtp.messagingengine.com ([64.147.123.20]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oxzMM-00031q-VX for lwip-devel@nongnu.org; Wed, 23 Nov 2022 18:40:57 -0500 Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailout.west.internal (Postfix) with ESMTP id A60A632000E5 for ; Wed, 23 Nov 2022 18:40:51 -0500 (EST) Received: from imap42 ([10.202.2.92]) by compute2.internal (MEProxy); Wed, 23 Nov 2022 18:40:51 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chickadee.tech; h=cc:content-type:date:date:from:from:in-reply-to:message-id :mime-version:reply-to:sender:subject:subject:to:to; s=fm3; t= 1669246851; x=1669333251; bh=INBCwMorDKMQZHVW8J9tLN8IEwxnSOSWZDO scVA/WHs=; b=wOStZxMyXgxNMd+7lTCpO/2cKIpAEOX9ovzvMA9C+itQAjeeuZc cou7DH0f1L16cN9ScL+4SJn5vSyTsxRIfsg3TjAvacFtCmb+90hOESm94tfAmQcK kA/YGSpF/emmTvI/Ae7TOnZ9fxR+UF6ymXSsOVUVy8UGWV5TwRamIxcAV3aAE1z2 MjMkxUm3e0vguilME7K4kT0TuCrqO6QPtmQ9Wdq0xWC7li+8LM363UTfuBx5fQfJ YZ4cJhcWKrOX4lYDsowWAOS7JM+1uLlgrbGXdiQzKqUzaY/A4l8aBb9LLOj0ewEx ewCLOGuw5wylCPAT82V9bohH31pOb71ImqA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:date:feedback-id :feedback-id:from:from:in-reply-to:message-id:mime-version :reply-to:sender:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t=1669246851; x= 1669333251; bh=INBCwMorDKMQZHVW8J9tLN8IEwxnSOSWZDOscVA/WHs=; b=e SJowg4/dJ/0GI75xd9iMznhSToKtBSLP7/Txn/tesDj4vhyEzUqAUstQTf337J8l 8BPt4xs4eTzAdUy4wuOZIG2EOppM+8e3LUPhtVjLcViosgjw7BYXHyaROKA5QgXI S0KLOoZkz/sr/ArBufMS83u/ghsu+SG0conyHzSqHrX2ZDV3o2uj6XJ8fpqr4e+i IXMDB7wvRE3IWGey+v1nltfk2jUVeOotRTbfvgXDqadfpO6i63IvwWXj4hGNi0tr 0BrkqK1+RGLJnpV9gOrBziphCEDaaZVlrpeQ86VoOm/IB4nkAXHDb2KxqB6Bl88M T6DADGfUA4deHHkLeAhyw== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvgedriedvgdduudcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecunecujfgurhepofgfggfkfffhvffutgesthdtredtre ertdenucfhrhhomhepfdfutghothhtucfuhhgrfigtrhhofhhtfdcuoehstghothhtsegt hhhitghkrgguvggvrdhtvggthheqnecuggftrfgrthhtvghrnhepveduvedvtdeffeehfe dvieehheeiffdtffekkeekvedvhffhjedtffdtteefveffnecuffhomhgrihhnpehgihht hhhusgdrtghomhdpnhhonhhgnhhurdhorhhgnecuvehluhhsthgvrhfuihiivgeptdenuc frrghrrghmpehmrghilhhfrhhomhepshgtohhtthestghhihgtkhgruggvvgdrthgvtghh X-ME-Proxy: Feedback-ID: ib821425a:Fastmail Received: by mailuser.nyi.internal (Postfix, from userid 501) id F03BFBC0078; Wed, 23 Nov 2022 18:40:50 -0500 (EST) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.7.0-alpha0-1115-g8b801eadce-fm-20221102.001-g8b801ead Mime-Version: 1.0 Message-Id: <75887464-43e2-430e-b656-762dec0fdc29@app.fastmail.com> Date: Wed, 23 Nov 2022 15:40:29 -0800 From: "Scott Shawcroft" To: lwip-devel@nongnu.org Content-Type: text/plain Received-SPF: pass client-ip=64.147.123.20; envelope-from=scott@chickadee.tech; helo=wout4-smtp.messagingengine.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action Subject: [lwip-devel] Adding secondary hostnames for MDNS discovery X-BeenThere: lwip-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: lwip-devel List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Nov 2022 23:40:58 -0000 We're using lwip on the Raspberry Pi Pico W for CircuitPython. With our new web workflow we respond to MDNS queries for both a unique hostname (cpy-MACADD.local) and a shared hostname (circuitpython.local). To do this, I've added the notion of secondary hostnames that are also responded to for domain queries. They aren't used for service discovery. My code is available on GitHub: https://github.com/lwip-tcpip/lwip/compare/master...adafruit:lwip:circuitpython8 Is https://savannah.nongnu.org/projects/lwip/ still the best way to get feedback on it and get it merged in? Thanks, Scott From MAILER-DAEMON Mon Nov 28 08:07:32 2022 Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1ozdrA-0006Z0-AS for mharc-lwip-devel@gnu.org; Mon, 28 Nov 2022 08:07:32 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ozdr9-0006Ya-0t; Mon, 28 Nov 2022 08:07:31 -0500 Received: from frontend1.savannah.gnu.org ([209.51.188.72]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ozdr8-0000jD-OP; Mon, 28 Nov 2022 08:07:30 -0500 Received: by frontend1.savannah.gnu.org (Postfix, from userid 33) id 1FB81207CC; Mon, 28 Nov 2022 08:07:29 -0500 (EST) To: Engin Aydogan , lwip-devel@nongnu.org, lwip-members@nongnu.org From: Engin Aydogan X-Savane-Server: savannah.nongnu.org:443 [209.51.188.72] MIME-Version: 1.0 Content-Type: text/plain;charset=UTF-8 X-Savane-Project: lwip X-Savane-Tracker: bugs X-Savane-Item-ID: 63435 X-Apparently-From: Savane authenticated user engin Message-Id: <20221128-130726.sv337281.24796@savannah.nongnu.org> References: In-Reply-To: Date: Mon, 28 Nov 2022 08:07:29 -0500 (EST) Subject: [lwip-devel] [bug #63435] Timer allocation fails are silent X-BeenThere: lwip-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: lwip-devel List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Nov 2022 13:07:31 -0000 URL: Summary: Timer allocation fails are silent Project: lwIP - A Lightweight TCP/IP stack Submitter: engin Submitted: Mon 28 Nov 2022 01:07:26 PM UTC Category: TCP 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: 2.1.3 _______________________________________________________ Follow-up Comments: ------------------------------------------------------- Date: Mon 28 Nov 2022 01:07:26 PM UTC By: Engin Aydogan Hello, why is this error silent? When this allocation fails, TCP stack does not do retransmissions and I think it's a serious problem. tcp.c:1180 tcp_connect - TCP_REG_ACTIVE (MACRO) - TCP_REG (MACRO) timeouts.c:166 - tcp_timer_needed() - sys_timeout() - sys_timeout_abs() timeouts.c:189 Silently fail when timer allocation fails. Number of timers are defined in opt.h:501 /** * The number of sys timeouts used by the core stack (not apps) * The default number of timeouts is calculated here for all enabled modules. */ #define LWIP_NUM_SYS_TIMEOUT_INTERNAL (LWIP_TCP + IP_REASSEMBLY + LWIP_ARP + (2*LWIP_DHCP) + LWIP_ACD + LWIP_IGMP + LWIP_DNS + PPP_NUM_TIMEOUTS + (LWIP_IPV6 * (1 + LWIP_IPV6_REASS + LWIP_IPV6_MLD + LWIP_IPV6_DHCP6))) I think it become insufficient when we enabled SNTP (and it also allocates a timer). What the correct approach here? Cheers. _______________________________________________________ Reply to this item at: _______________________________________________ Message sent via Savannah https://savannah.nongnu.org/