Dirk Ziegelmeier
9ab2eefc37
Fix documentation in sockets.c
2017-02-26 09:42:06 +01:00
Dirk Ziegelmeier
08931b33c1
Fix documentation on pbuf_get_contiguous()
2017-02-25 17:03:14 +01:00
Joel Cunningham
36b9a45c3b
netconn_write_partly cleanups
...
This commit changes netconn_write_partly to use msg.w.offset to set
bytes_written for both blocking and non-blocking connections
This is correct because msg.w.offset is the canonical output from
the do_write call and in the case that not all bytes were written,
(a bug?) returning the full size to the caller is dangerous
Lastly, this commit adds an assert for the blocking case to sanity
check that all the bytes we requested were written. This will help
catch bugs in do_write
2017-02-24 15:50:28 -06:00
Joel Cunningham
36fa1a97d4
lwip_netconn_do_writemore() cleanups
...
This commit makes a couple of cleanups discussed in patch #8882 :
1) msg.w.offset should not be set to 0 in the error case. It is
only valid when err == ERR_OK
2) Remove out-of-date comment which indicated the entire write had
completed (not true for non-blocking write)
This also updates the documentation on offset to include that offset
is only valid when err == ERR_OK
2017-02-24 15:42:07 -06:00
goldsimon
0da9cf70ea
Added pbuf_get_contiguous() to get data in one piece (either zero copy from pbuf or memcpied into a supplied buffer)
2017-02-24 21:36:49 +01:00
goldsimon
a38e937dd6
fixed close race conditions in lwip_select (for LWIP_NETCONN_FULLDUPLEX)
2017-02-24 21:29:29 +01:00
goldsimon
f4d13d52d3
fixed get_socket, fixed LWIP_SOCKET_OFFSET != 0
2017-02-24 21:23:53 +01:00
goldsimon
8bb43e7388
Added a few missing calls to done_socket()
2017-02-24 21:11:20 +01:00
goldsimon
6786c9f143
Start working on bug #44032 : added sock->fd_used that is != 0 when at least one thread is using a socket
2017-02-24 21:00:01 +01:00
goldsimon
9afe10e23d
make get_socket use tryget_socket, added tryget_socket_unconn in preparation of properly fixing bug #44032
2017-02-24 20:49:18 +01:00
goldsimon
f1f6050ad7
minor: comment, whitespace
2017-02-24 19:50:53 +01:00
goldsimon
d73e225519
lwip_select: check for correct 'maxfdp1' parameter range
2017-02-24 19:50:14 +01:00
goldsimon
3107d4a0fa
fixed that select ignored invalid/not open sockets in the fd_sets (bug #50392 )
2017-02-24 19:48:59 +01:00
goldsimon
01cc06bcb8
netif_add: ensure netif->num is unique even if more than 255 netifs have been added/removed since system startup (e.g. by ppp)
2017-02-23 20:41:54 +01:00
goldsimon
76763c9bcd
pbuf_ref: assert-check for 'ref' overflow
2017-02-23 20:16:51 +01:00
Dirk Ziegelmeier
e94e2da3ec
opt.h: Set LWIP_PBUF_REF_T back to u8_t, s8_t has no advantage any more after reverting last commit
2017-02-23 18:10:00 +01:00
Dirk Ziegelmeier
2cf3bbddd4
pbuf_free: Use correct type LWIP_PBUF_REF_T for local variable
2017-02-23 18:08:26 +01:00
Dirk Ziegelmeier
0f6d8ccd90
Revert "Improve pbuf refcount underflow check by checking the local variable on the stack that was assigned in a protected region"
...
This reverts commit 62c44138da19a8cd9b100b3050c9697a80d8866f.
Didn't notice due to local changes the ASSERTION was already inside the locks...
2017-02-23 18:04:30 +01:00
Dirk Ziegelmeier
62c44138da
Improve pbuf refcount underflow check by checking the local variable on the stack that was assigned in a protected region
...
The old code was vulnerable to race conditions since it checked ref to be >0 without locks
2017-02-23 16:55:14 +01:00
Dirk Ziegelmeier
0a7734cf64
Preparation for task #14369 : Define ways to work with a netif having multiple ports
...
Let ethernet_input() fill in pbuf's if_idx (if not already set by driver or an L2 bridge)
2017-02-23 16:36:40 +01:00
Dirk Ziegelmeier
0eeb10d4bb
Preparation for task #14369 : Define ways to work with a netif having multiple ports
...
Add if_idx member to struct pbuf
2017-02-23 16:34:28 +01:00
Dirk Ziegelmeier
2e1b12d09f
Make pbuf refcount type an LWIP option and #define it to s8_t (to be able to check for underflow!)
2017-02-23 15:47:44 +01:00
goldsimon
5c55978f10
Revert "Added LWIP_SOCKERR_T to adapt the size of sock->err to what is needed."
...
Let's stay with the standard and accept the 4-bytes-per-socket memory increase...
This reverts commit 5d6c9ce77bb9dadda80484c2edf4e7de5076a605.
2017-02-20 13:29:33 +01:00
goldsimon
5d6c9ce77b
Added LWIP_SOCKERR_T to adapt the size of sock->err to what is needed.
2017-02-20 12:55:18 +01:00
goldsimon
d1049511cc
post-fixups for patch #9262 : fix SO_ERROR, fix !LWIP_TCPIP_CORE_LOCKING
2017-02-20 12:43:45 +01:00
Joan Lledó
703a22fae5
Support for 32bit errno codes
2017-02-20 12:37:29 +01:00
sg
ff3fe1f489
Fixed bug #50231 (nd6: several option size related issues in Router Advertisement message processing)
2017-02-17 21:59:08 +01:00
Joel Cunningham
4c76fd500c
Move write_offset from struct netconn to struct api_msg
...
This moves the write_offset variable from struct netconn to struct api_msg
This optimizes the storage by only having the space claimed when it is
needed (during a netconn_write_partly() call) and not throughout the
lifetime of the netconn
This also reduces code space/execution by not having to separately manage
clearing/checking write_offset from the current_msg pointer
Lastly, we also save execution by using msg.w.offset as the output
rather than marshaling the result to msg.w.len. Previously, len was used
as input length of dataptr and output for the write operation.
netconn_write_partly() also has access to msg.w.offset, so we can use
that
2017-02-17 13:26:16 -06:00
goldsimon
deaa6e9406
Improved DNS_LOCAL_HOSTLIST interface (bug #50325 )
2017-02-17 10:08:49 +01:00
goldsimon
19d63e6aa0
Fix portable initialization of non-dynamic DNS_LOCAL_HOSTLIST
2017-02-17 09:25:31 +01:00
sg
6dca664217
LWIP_NETCONN_FULLDUPLEX: fixed shutdown during write (bug #50274 )
2017-02-16 22:09:02 +01:00
Dirk Ziegelmeier
d7b51b5906
MDNS: Fix accessing wrong union member in netif ext callback
2017-02-15 14:38:57 +01:00
Dirk Ziegelmeier
3c9e05a6d9
Minor: Fix documentation in netif.h
2017-02-15 14:38:34 +01:00
Dirk Ziegelmeier
498913b982
Third draft of task #14283 : Add more detailed status callback
...
Implement Joel's idea of a union
2017-02-15 10:14:06 +01:00
Dirk Ziegelmeier
35e148e26d
MDNS: Use new netif callback, now does not need mdns_resp_netif_settings_changed() calls from user any more when LWIP_NETIF_EXT_STATUS_CALLBACK is enabled
2017-02-14 21:03:49 +01:00
Dirk Ziegelmeier
454927151d
Continue working on ext netif callback
...
Docs, better callback points (e.g. before netif is set down)
2017-02-14 21:02:38 +01:00
Dirk Ziegelmeier
d46d8bcda2
Add some asserts to netif callback functions
2017-02-14 20:35:48 +01:00
Dirk Ziegelmeier
4434762a08
Some minor documentation fixes
2017-02-14 20:28:43 +01:00
Dirk Ziegelmeier
bbedb35bf3
Fix name clash between typedef and struct definition.
...
Interesting, all three compilers in Erik Ekman's travis-ci don't complain. But my gcc at home does...
2017-02-14 20:17:27 +01:00
Dirk Ziegelmeier
f4f204b850
Implement a better way to initialize all fields in ip address than using memset() (better fix than my last commit)
2017-02-14 14:20:39 +01:00
Dirk Ziegelmeier
feba38a1f4
Fix unportable struct initializer I introcduced while working on task #14283 : Add more detailed status callback
2017-02-14 13:54:14 +01:00
Dirk Ziegelmeier
1b2c8974b8
Forgot to adapt #define in my last commit
2017-02-14 11:00:34 +01:00
Dirk Ziegelmeier
8025b85694
Second draft of task #14283 : Add more detailed status callback
2017-02-14 10:59:28 +01:00
Joel Cunningham
b2beb42c14
Remove forward declaration of struct lwip_sock
...
The forward declaration was added in commit
e2c2afbbe01762345ef99561a40b05033e166941 for use in struct
lwip_setgetsockopt_data, but became dead after commit
5d2e93e5f0a7e85ecf96d76950c5ee02aceecc89 where the sock pointer was
removed from lwip_setgetsockopt_data
2017-02-13 17:22:52 -06:00
Dirk Ziegelmeier
7dd21e93c4
Fix my last commits (unused variable warning)
...
my gcc at home did not show this warning...
2017-02-13 22:27:59 +01:00
Dirk Ziegelmeier
3c1713406e
Work on task #14283 : Add more detailed status callback
...
Cleanups and IPv6 address status
2017-02-13 21:52:55 +01:00
Dirk Ziegelmeier
58c48af58f
Start working on task #14283 : Add more detailed status callback
...
IPv6 stuff is not implemented
2017-02-13 21:40:08 +01:00
Joel Cunningham
0b257f71e7
Fix comment typo from bug #47485
...
tcp_close_shutdown_impl() should be tcp_close_shutdown_fin()
2017-02-13 11:25:05 -06:00
Dirk Ziegelmeier
45f3c28eb2
Fix netif_find() function for many netifs (should use atoi) and move it to the bottom of the file where similar functions are located
2017-02-13 13:35:30 +01:00
Dirk Ziegelmeier
400c41ffd9
Also base netif_index_to_name function on netif_get_by_index
2017-02-13 13:26:54 +01:00