lwIP - A Lightweight TCP/IP stack - Bugs: bug #20223, netconn_write() /tcp_enqueue()...
You are not allowed to post comments on this tracker with your current authentication level.
bug #20223: netconn_write() /tcp_enqueue() truncates data 'size'
Submitter: | Srinivas Gollakota <gollakota> | ||
Submitted: | Wed 20 Jun 2007 02:04:25 PM UTC | ||
Category: | TCP | Severity: | 3 - Normal |
Item Group: | Change Request | Status: | Fixed |
Privacy: | Public | Assigned to: | None |
Open/Closed: | Closed | Planned Release: | None |
lwIP version: | None |
Jump to the original submission
Fri 10 Aug 2007 03:38:26 PM UTC, comment #11: |
Jonathan Larmour <jifl> |
Fri 10 Aug 2007 03:19:20 PM UTC, comment #10: So, do you suggest changing the size parameter to size_t? |
Simon Goldschmidt <goldsimon> |
Mon 30 Jul 2007 04:17:06 PM UTC, comment #9: Note that a signed int may be as small as 32768 on a 16-bit architecture.
|
Jonathan Larmour <jifl> |
Thu 21 Jun 2007 09:21:50 PM UTC, comment #8: Since size_t seems more used on socket layer, change netconn_write with a int or a s32_t is good for me.
|
Frédéric Bernon <fbernon> |
Thu 21 Jun 2007 08:19:41 PM UTC, comment #7: Since the question on size_t is not really related to this bug, I'm closing this as fixed. |
Simon Goldschmidt <goldsimon> |
Thu 21 Jun 2007 07:37:49 PM UTC, comment #6: OK, I've changed it now. The only problem is: which type should we use? I had this discussion previously (I think it was with Dmitry Potapov): opengroup.org says the len arguments for the socket functions should be size_t. At that time, I've favoured 'int' but now I think it is really better to convert them to size_t.
|
Simon Goldschmidt <goldsimon> |
Wed 20 Jun 2007 03:14:21 PM UTC, comment #5: Sure,I'll patch my code for now.
|
Srinivas Gollakota <gollakota> |
Wed 20 Jun 2007 03:05:59 PM UTC, comment #4: If you really want, we will wait, but I think that change the netconn_write's parameter won't interact a lot with your job on #20021. So, Srinivas, patch your code, but don't worry, we keep this item opened.
|
Frédéric Bernon <fbernon> |
Wed 20 Jun 2007 02:58:17 PM UTC, comment #3: Keep in mind that I'm currently changing netconn_write because of bug #20021! This includes moving much of the processing into do_write (or api_msg.c, at least).
|
Simon Goldschmidt <goldsimon> |
Wed 20 Jun 2007 02:27:14 PM UTC, comment #2: Since the "cut" in segment is already done in netconn_write, and that "size" is compare to tcp_sndbuf (which is a u16_t), I think we can change ...
|
Frédéric Bernon <fbernon> |
Wed 20 Jun 2007 02:13:27 PM UTC, comment #1: I'd guess the initial reason is both the 'lw' in lwIP's name together with the assumption you'd never send that much data and the fact that the tcp header also has an u16_t for its length. Since netconn api was built on the existing tcp_write, it has taken over the u16_t. I personally don't see a problem in that, only lwip_send should check the value and call netconn_write multiple times to be correct (or at least assert or return a return value. |
Simon Goldschmidt <goldsimon> |
Wed 20 Jun 2007 02:04:25 PM UTC, original submission:
lwip_send() takes the 'size' parameter as 'int' where as netconn_write(..,u16_t size,..) and
|
Srinivas Gollakota <gollakota> |
No files currently attached
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 2 latest changes.
Date | Changed by | Updated Field | Previous Value | => | Replaced by |
---|---|---|---|---|---|
2007-06-21 | goldsimon | Status | None | Fixed | |
Open/Closed | Open | Closed |
Powered by Savane 3.13-02a9.
Corresponding source code
I think size_t would be the most portable choice personally. size_t is part of the C standard (including older ANSI C).