Simon Goldschmidt
9572db262c
Fixed bug #39718 : disconnecting an UDP socket reports an error
2014-02-20 22:32:57 +01:00
Simon Goldschmidt
515e4b9187
fixed bug #39882 No function shall set errno to 0
2014-02-20 22:23:40 +01:00
Simon Goldschmidt
4d774e275d
netconn::recv_avail: forgot one line
2014-02-20 22:01:13 +01:00
Simon Goldschmidt
a2d6a50dff
fixed bug #41499 netconn::recv_avail can overflow
2014-02-20 21:55:11 +01:00
Simon Goldschmidt
a375ea4ee2
Minor: coding style cleanups...
2014-02-20 20:09:33 +01:00
Grant Erickson
d74464e091
Add RFC3542-style checksum compuation on raw, IPv6 sockets
...
This patch adds support for RFC3542-style checksum computation on raw,
IPv6 sockets via the IPV6_CHECKSUM socket option.
This allows the development of application-layer utilities such as
ping6 which are unable to compute the raw packet checksum without a
prior knowledge of the source address selection.
2014-02-20 20:01:37 +01:00
Simon Goldschmidt
e2c2afbbe0
patch #7885 : modification of api modules to support FreeRTOS-MPU (don't pass stack-pointers to other threads) (based on patch by Artem Pisarenko)
2014-02-20 19:50:17 +01:00
Sylvain Rochet
87cfd930e4
Merge branch 'master' into ppp-new
2014-01-17 00:48:55 +01:00
Simon Goldschmidt
2cf5eec62f
patch by Thomas Faber: patch #8241 : Fix implicit declaration of ip_input with LWIP_TCPIP_CORE_LOCKING_INPUT disabled
2014-01-14 21:32:45 +01:00
Sylvain Rochet
4fda366b67
PPP, added PPP notify phase support
...
PPP notify phase support, using compile-time PPP_NOTIFY_PHASE macro.
This can be used for example to set a LED pattern depending on the
current phase of the PPP session.
Callback example:
static void ppp_notify_phase_cb(ppp_pcb *pcb, u8_t phase, void *ctx) {
switch(phase) {
case PPP_PHASE_DEAD: /* Kept off */
case PPP_PHASE_MASTER:
/* LED Off */
break;
case PPP_PHASE_INITIALIZE: /* Session opened */
/* LED FastBlink */
break;
case PPP_PHASE_RUNNING: /* Session running */
/* LED On */
break;
default:
/* LED SlowBlink */
}
}
2013-04-30 15:16:09 +02:00
Sylvain Rochet
3fe5a99dab
Merge branch 'master' into ppp-new
2013-04-25 00:36:12 +02:00
Simon Goldschmidt
097bc4c622
patch #8008 Fix a potential null pointer dereference in assert
2013-04-24 22:28:22 +02:00
Sylvain Rochet
44b527415f
PPP, slight API change, great code factorisation
...
Created new ppp_over_X_create() functions which only prepare the PPP session without starting it
Removed ppp_reopen() and all of its sub ppp_over_X_reopen()
Removed PPPoL2TP reconnect() function, merged to connect()
Added ppp_open() able to start or restart any session
2013-04-22 23:58:51 +02:00
Sylvain Rochet
ed294c5945
PPP, removed ppposapi_input(), unnecessary because pppos_input() is already thread-safe
2013-04-22 21:21:04 +02:00
Sylvain Rochet
7fb874ad28
Merge branch 'master' into ppp-new
2012-09-27 21:32:27 +02:00
goldsimon
a4a41b9023
fixed bug #37405 'err_tcp()' uses already freed 'netconn' object
2012-09-26 21:50:42 +02:00
Sylvain Rochet
ad5f520c68
PPP, updated pppapi_reopen() to follow ppp_reopen() prototype change
2012-08-23 20:47:14 +02:00
Sylvain Rochet
773a2767c7
PPP, added missing pppapi_delete() thread safe function
2012-08-21 20:26:37 +02:00
Sylvain Rochet
1ddebcc862
Moved PPP headers into include/netif/ppp/, fixing bug #37040 .
2012-08-18 22:40:19 +02:00
Sylvain Rochet
519f81771a
Merge remote-tracking branch 'origin/master' into ppp-new
2012-08-17 23:11:47 +02:00
goldsimon
a070751061
fixed bug #37052 : "netconn_alloc: undefined netconn_type" assertion skipped
2012-08-13 21:17:17 +02:00
Sylvain Rochet
3c122117fc
improved PPP API, added ppp_reopen()
...
This is now the user choice to re-establish the session in the link status callback
by either calling the ppp_reopen() to re-establish or ppp_delete() to free the PPP
control block. Without user intervention, the PPP control block now stay in the dead
phase, allowing the user to re-establish or delete the control block later.
2012-07-22 20:53:54 +02:00
Sylvain Rochet
9e021cd1a8
improved PPP default interface management, added ppp_set_default() API call
2012-07-14 17:25:24 +02:00
Sylvain Rochet
78565026ac
L2TP output netif is now selectable, making it useful to select a default route for the L2TP tunnel, in case the default interface is set to the L2TP PPP interface
2012-07-12 01:11:08 +02:00
Sylvain Rochet
f534e80c71
added L2TPv2 (PPP over L2TP, a.k.a. UDP tunnels) support
...
Supported:
- L2TPv2 (PPP over L2TP, a.k.a. UDP tunnels)
- LAC
Not supported:
- LNS (require PPP server support)
- L2TPv3 ethernet pseudowires
- L2TPv3 VLAN pseudowire
- L2TPv3 PPP pseudowires
- L2TPv3 IP encapsulation
- L2TPv3 IP pseudowire
- L2TP tunnel switching - http://tools.ietf.org/html/draft-ietf-l2tpext-tunnel-switching-08
- Multiple tunnels per UDP socket, as well as multiple sessions per tunnel
- Hidden AVPs
2012-07-09 23:25:32 +02:00
Sylvain Rochet
d92c462466
added PPP Sequential API module, based from the Network Interface Sequential API module
2012-07-07 19:50:56 +02:00
Ivan Delamer
6c12e5bfbe
Allow setting/getting socket option IPV6_V6ONLY for stream sockets
...
only, as datagram sockets do not support dual IP versions yet.
Change-Id: I2d89bdaa06b19dc0c553c7be6ac6e9a71d3ce8a5
2012-07-03 14:39:25 -06:00
James Smith
e65202f825
Applied patch by James Smith to implement IPV6_V6ONLY support in
...
sockets and netconns.
Change-Id: I2ecd8e218703114890b2d678cc1ccf997a16f5e3
2012-07-03 13:16:04 -06:00
goldsimon
8dbf572ea5
Fixed bug #35817 : do_connect() invalidly signals op_completed for UDP/RAW with LWIP_TCPIP_CORE_LOCKING==1
2012-03-25 14:56:41 +02:00
goldsimon
f8af1a7443
fixed bug #35931 : Name space pollution in api_msg.c and netifapi.c
2012-03-25 14:41:27 +02:00
goldsimon
c6e4b8f829
patch by Mason: fixed bug #35907 : lwip_gethostbyname_r returns an invalid h_addr_list
2012-03-20 22:06:32 +01:00
goldsimon
c6605766e7
Fixed unused variable warnings produced with the last commit
2012-03-01 19:10:52 +01:00
goldsimon
4fca628d36
Speed up LWIP_TCPIP_CORE_LOCKING by directly calling functions in api_msg.c instead of calling via function pointer.
2012-02-28 12:45:59 +01:00
goldsimon
c8647c0396
implemented API functions to access so_options of IP pcbs (UDP, TCP, RAW) (fixes bug #35061 )
2011-12-17 22:12:01 +01:00
goldsimon
d12e742373
Fixed bug #34733 Null pointer exception with SOCKET_DEBUG.
2011-11-13 17:06:19 +01:00
Simon Goldschmidt
d00fa906cf
fixed bug #34592 : lwip_gethostbyname_r uses nonstandard error value, removed those unused (nonstandard?) error values from arch.h
2011-10-18 20:56:08 +02:00
goldsimon
2f58ef781c
fixed bug #34581 missing parentheses in udplite sockets code
2011-10-18 11:04:08 +02:00
Simon Goldschmidt
e039d4103f
fixed bug #34569 : shutdown(SHUT_WR) crashes netconn/socket api
2011-10-17 19:38:47 +02:00
Simon Goldschmidt
dc34636598
fixed bug #34540 : compiler error when CORE_LOCKING is used and not all protocols are enabled
2011-10-13 19:25:11 +02:00
Simon Goldschmidt
a2aa43a426
Implemented timeout on send (TCP only, bug #33820 )
2011-09-21 19:36:09 +02:00
Simon Goldschmidt
5be300736e
lwip_accept: fixed warning about accessing uninitialized 'port' when SOCKETS_DEBUG is enabled
2011-09-09 23:20:34 +02:00
Simon Goldschmidt
d0877153bf
netconn_alloc(): return on invalid protocol instead of initializing mbox size to 0
2011-09-03 21:24:06 +02:00
Simon Goldschmidt
f64808c385
fixed bug #33956 Wrong error returned when calling accept() on UDP connections
2011-08-24 21:12:12 +02:00
Ivan Delamer
b5305d5a8c
Initialize recvmbox size for undefined netconn type, to supress
...
compiler warning.
Change-Id: I14c3f1786a8ca3513b5d4cf375c4951e4c09ebd6
2011-08-12 09:04:29 -06:00
Simon Goldschmidt
46af0d38fa
fixed bug #31084 (socket API returns always EMSGSIZE on non-blocking sockets if data size > send buffers) -> now lwip_send() sends as much as possible for non-blocking sockets and only returns EWOULDBLOCK if the buffers are full
2011-07-22 22:05:24 +02:00
Simon Goldschmidt
bd69890ccd
(bug #30185 ): added LWIP_FIONREAD_LINUXMODE that makes ioctl/FIONREAD return the size of the next pending datagram.
2011-07-21 20:15:39 +02:00
Simon Goldschmidt
fb0ad2f9ea
Fixed bug #33802 tcpip: tcpip_callbackmsg_new sets msg->type to wrong type
2011-07-19 21:52:40 +02:00
goldsimon
7385449f33
Fixed wrong endianess of port in bind() and connect() broken with the last commit
2011-07-06 07:18:06 +00:00
goldsimon
a93d9c4310
Fixed bug #33561 bugs in recvfrom() and sendto()
2011-07-05 19:42:23 +00:00
goldsimon
1813d11b9d
Fixed invalid SOCK_ADDR_TYPE_MATCH check in lwip_sendto()
2011-07-04 19:39:16 +00:00
idelamer
0f56d838ec
Process IPv6 packets arriving from non-Ethernet links.
2011-06-17 11:06:06 +00:00
goldsimon
2911c84a69
Fixed compilation error after converting sockaddr_aligned from struct to union
2011-06-12 11:57:34 +00:00
goldsimon
e584557afe
- sockaddr_aligned: use a union instead of a manually aligned struct;
...
- fixed compilation for different configurations
2011-06-07 19:36:05 +00:00
goldsimon
5a674f419d
Restructured the code a bit to help my dump compiler not creating a jump table in ROM
2011-06-07 19:07:00 +00:00
goldsimon
af5a913019
Fixed compilation with LWIP_IPV6==0
2011-06-06 16:04:06 +00:00
goldsimon
604e69c7ae
- fixed bug #33485 (forgot '!' before SOCK_ADDR_MATCH*);
...
- fixed 'cast increases alignment' by casting via 'void*';
- introduced 'struct sockaddr_aligned' where the 'base' type is instantiated to make sure the alignment is correct;
2011-06-06 16:00:06 +00:00
goldsimon
2aec3a9789
use PCB_IS_IPV6(pcb) instead of pcb->isipv6 everywhere
2011-05-28 09:28:18 +00:00
goldsimon
92fcfd7a6f
Fixed two compilation errors with different opt.h settings
2011-05-26 14:47:28 +00:00
goldsimon
1b2b054139
Fixed bug #33337 (which is #32906 reappearing after adding IPv6 support)
2011-05-25 17:40:42 +00:00
goldsimon
6865806b55
Combined IPv4 and IPv6 code where possible, added defines to access IPv4/IPv6 in non-IP code so that the code is more readable.
2011-05-25 17:16:35 +00:00
goldsimon
4bfbe7ebeb
... and finally, we got a first working version of a dual-stack lwIP runnin IPv4 and IPv6 in parallel - big thanks to Ivan Delamer! (this is work in progress, so please beware, test a lot and report problems!)
2011-05-17 19:35:14 +00:00
goldsimon
a444ec5111
patch #7449 allow tcpip callback from interrupt with static memory message
2011-05-14 12:23:10 +00:00
goldsimon
80b344e9fc
Fixed printf-format error (bug #33079 )
2011-04-21 05:15:45 +00:00
goldsimon
b54c7bedfd
Fixed bug #32906 : lwip_connect+lwip_send did not work for udp and raw pcbs with LWIP_TCPIP_CORE_LOCKING==1.
2011-03-27 13:36:32 +00:00
goldsimon
7203680146
fixed bug #31748 (Calling non-blocking connect more than once can render a socket useless) since it mainly involves changing "FATAL" classification of error codes: ERR_USE and ERR_ISCONN just aren't fatal.
2011-03-14 21:21:26 +00:00
goldsimon
d793ed3b9b
fixed bug #32769 (ESHUTDOWN is linux-specific) by fixing err_to_errno_table (ERR_CLSD: ENOTCONN instead of ESHUTDOWN), ERR_ISCONN: use EALRADY instead of -1
2011-03-13 11:21:06 +00:00
goldsimon
c6de17d1e5
netconn_accept: return ERR_ABRT instead of ERR_CLSD if the connection has been aborted by err_tcp (since this is not a normal closing procedure).
2011-03-13 11:17:18 +00:00
goldsimon
03be8f88fe
Fixed bug #31741 : lwip_select seems to have threading problems
2011-01-24 19:28:28 +00:00
goldsimon
effcb90fdf
Mreged back changes that were lost during the savannah hack 3 weeks ago (using the sources from http://git.infradead.org/users/dwmw2/lwip.git )
2010-12-20 18:03:51 +00:00
goldsimon
377628216e
Fixed bug #31590 : getsockopt(... SO_ERROR ...) gives EINPROGRESS after a successful nonblocking connection.
2010-11-22 20:55:57 +00:00
goldsimon
e52730d1fb
Fixed bug #31170 : lwip_setsockopt() does not set socket number
2010-11-20 18:01:01 +00:00
goldsimon
d73262a0e5
Fixed compilation with TCP or UDP disabled.
2010-07-29 19:25:50 +00:00
goldsimon
691410ba18
task #10495 : Added support for IP_MULTICAST_LOOP at socket- and raw-API level.
2010-07-12 09:34:11 +00:00
goldsimon
48be546357
fixed bug #30300 (shutdown parameter was not initialized in netconn_delete)
2010-06-30 08:33:14 +00:00
goldsimon
6929a786aa
Fixed bug #10088 : Correctly implemented shutdown at socket level.
2010-06-24 19:33:14 +00:00
goldsimon
2c60a48d02
ip_addr_set_any does not work on pointers...
2010-06-14 19:52:17 +00:00
goldsimon
505dd10d3c
Fixed bug #29979 (lwip_sendto did not check parameter "to" != NULL)
2010-06-12 18:46:19 +00:00
goldsimon
ddd2b69f27
bug #29976 : forgot some places using the changed IP address (copy vs. pointer)
2010-06-12 18:37:41 +00:00
goldsimon
f7479781c1
bug #27352 : removed packing from ip_addr_t, the packed version is now only used in protocol headers. Added global storage for current src/dest IP address while in input functions.
2010-05-22 21:11:02 +00:00
goldsimon
d3e5ade2da
Correctly NULL-terminate h_addr_list
2010-05-17 12:36:45 +00:00
goldsimon
4b7288e8f4
use checksum-on-copy for sending UDP data for LWIP_NETIF_TX_SINGLE_PBUF==1
2010-05-02 17:25:33 +00:00
goldsimon
51061fb61e
Fixed bug #29617 (sometime cause stall on delete listening connection)
2010-04-21 19:59:40 +00:00
goldsimon
2e18a9be63
Added an overridable define to get informed when the tcpip_thread processes messages or timeouts to implement a watchdog.
2010-04-14 07:02:26 +00:00
goldsimon
846a2fb933
Fixed compiling with different options disabled (TCP/UDP), triggered by bug #29345 ; don't allocate acceptmbox if LWIP_TCP is disabled
2010-03-26 16:09:02 +00:00
goldsimon
46b7bd6ec3
Make functions static where applicable, add default cases to switches where applicable, prevent old-style function prototypes (without arguments)
2010-03-26 14:07:05 +00:00
goldsimon
5ef976aed5
Fixed bug #29332 : lwip_select() processes readset incorrectly
2010-03-25 12:19:39 +00:00
goldsimon
a5b0ea97d6
Updated netconn_write doc/comment about api_flags
2010-03-21 12:19:56 +00:00
goldsimon
0a49f2e068
Corrected spelling of ERR_WOULDBLOCK (D was missing)
2010-03-20 12:56:47 +00:00
goldsimon
f70014b8ea
Added an option to disable tcpip_(un)timeout code since the linker cannot do this automatically to save space.
2010-03-20 11:55:41 +00:00
goldsimon
385d044f7d
Corrected spelling of milliseconds (my dictionary tells me to use two l's :)
2010-03-20 11:34:50 +00:00
goldsimon
a54bb7205d
Added missing casts, use strlen + MEMCPY instead of strcpy (as that might overrun the buffer)
2010-03-16 15:14:14 +00:00
goldsimon
67f5e17588
Bug #29210 : check alignment of struct sockaddr vs. struct sockaddr_in
2010-03-14 09:54:47 +00:00
goldsimon
d47a04456b
bug #29105 : Review printf formatters
2010-03-08 17:07:35 +00:00
goldsimon
5d20e690fd
Added/corrected casts
2010-03-08 12:17:29 +00:00
goldsimon
d5531a239b
bug #28775 (select/event_callback: only check select_cb_list on change) plus use SYS_LIGHTWEIGHT_PROT to protect the select code. This should speed up receiving data on sockets as the select code in event_callback is only executed when select is waiting.
2010-03-07 18:40:54 +00:00
goldsimon
99ff7efe80
Use braces for if-blocks
2010-03-06 12:26:20 +00:00
goldsimon
f5b783d107
Fixed LWIP_NETIF_TX_SINGLE_PBUF for LWIP_TCPIP_CORE_LOCKING
2010-03-06 11:52:55 +00:00
goldsimon
38fcfcdfac
task #10167 (sockets: speed up TCP recv by not allocating a netbuf): added function netconn_recv_tcp_pbuf() for tcp netconns to receive pbufs, not netbufs; use that function for tcp sockets.
2010-03-06 11:29:01 +00:00
goldsimon
957f4d8096
renamed struct lwip_socket to struct lwip_sock to avoid duplicate names (function lwip_socket)
2010-03-06 10:21:03 +00:00
goldsimon
0b5d60db5e
Correctly set TCP_WRITE_FLAG_MORE when netconn_write is split into multiple calls to tcp_write.
2010-03-05 11:34:43 +00:00
goldsimon
402597c2cb
Fixed bug #28970 (invalid preprocessor macro introduced with LWIP_TCPIP_CORE_LOCKING_INPUT)
2010-02-22 12:57:00 +00:00
goldsimon
19a9b52c06
Corrected comment
2010-02-21 19:28:46 +00:00
goldsimon
db38ee6630
Added define LWIP_TCPIP_CORE_LOCKING_INPUT that lets tcpip_input omit the thread-change to tcpip_thread and instead lock the core
2010-02-21 12:38:08 +00:00
goldsimon
7c57ee0c17
Use tcp_debug_state_str() instead of tcp_debug_print_state()
2010-02-21 10:56:00 +00:00
goldsimon
c5dfa4099d
Fixed bug #28183 (ARP and TCP/IP cannot be disabled on netif used for PPPoE) by adding a new netif flag (NETIF_FLAG_ETHERNET) that tells the stack the device is an ethernet device but prevents usage of ARP (so that ethernet_input can be used for PPPoE).
2010-02-14 16:44:47 +00:00
goldsimon
0792effc2a
task #7865 (implement non-blocking send operation)
2010-02-13 17:08:40 +00:00
goldsimon
49c6ce3703
Add a new err_t, ERR_WOULDBLOCK in preparation for non-blocking send
2010-02-13 16:03:12 +00:00
goldsimon
0f05a6aede
Fixed compilation for LWIP_DNS==1 after changing sys layer
2010-02-13 15:43:19 +00:00
goldsimon
7ccf8cb731
Fixed compilation with LWIP_DNS==1 after changing sys layer
2010-02-13 15:01:55 +00:00
goldsimon
c49a3ab2d6
Fixed compilation for LWIP_SO_RCVBUF==0
2010-02-13 10:06:42 +00:00
goldsimon
8fbaf0304a
Added a minimal version of posix fctl() to have a standardised way to set O_NONBLOCK for nonblocking sockets.
2010-02-12 17:59:20 +00:00
goldsimon
bd3f86e505
Code layout: splitted long line
2010-02-12 16:31:18 +00:00
goldsimon
c73b1b4fa2
Fixed bug #28865 (Cannot close socket/netconn in non-blocking connect)
2010-02-12 15:21:37 +00:00
goldsimon
0030d1ade5
task #10139 (Prefer statically allocated memory): converted mbox and semaphore functions to take pointers to sys_mbox_t/sys_sem_t; converted sys_mbox_new/sys_sem_new to take pointers and return err_t; task #7212 : Add Mutex concept in sys_arch (define LWIP_COMPAT_MUTEX to let sys.h use binary semaphores instead of mutexes - as before)
2010-02-12 13:49:21 +00:00
goldsimon
2d1631792a
struct netconn.socket is only used with LWIP_SOCKET; added comments
2010-02-12 09:58:44 +00:00
goldsimon
9e59f661bc
Fixed a compiler warning (comparison between signed and unsigned)
2010-02-10 08:11:18 +00:00
goldsimon
59a623e648
Use sys_arch_sem_wait instead of sys_sem_wait_timeout (same function, different name)
2010-02-09 21:04:50 +00:00
goldsimon
306f2203fa
Fixed bug #22110 (recv() makes receive window update for data that wasn't received by application); added function-like macros to correctly access/change conn->recv_timeout and conn->recv_bufsize
2010-02-09 20:23:39 +00:00
goldsimon
7699b59e27
Another fix for bug #28853 (recv returns 0 on recv-timeout or any other error), fixed err_to_errno_table: ERR_TIMEOUT is EWOULDBLOCK, not ETIMEDOUT
2010-02-09 20:17:06 +00:00
goldsimon
1550c4215d
Fixed bug #28853 (lwip_recvfrom() returns 0 on receive time-out or any netconn_recv() error)
2010-02-09 18:46:54 +00:00
goldsimon
a84590273d
Merge 3 u8_t for netconn-internal status into one u8_t 'flags' to prevent waisting memory when adding more flags
2010-02-09 18:41:07 +00:00
goldsimon
b0b4290c29
Reduced the time SYS_ARCH_PROTECT is protecting the socket array
2010-02-08 17:25:57 +00:00
goldsimon
848debf999
Fixed bug #28818 (New connection probably not marked writable on accept()) introduced a week ago while implementing non-blocking connect
2010-02-08 12:33:28 +00:00
goldsimon
5d360a6711
Replaced struct ip_addr by typedef ip_addr_t to make changing the actual implementation behind the typedef easier.
2010-02-04 18:47:44 +00:00
goldsimon
a23b446ddf
Use macros defined in ip_addr.h (some of them new) to work with IP addresses (preparation for bug #27352 - Change ip_addr from struct to typedef (u32_t) - and better code).
2010-02-04 17:21:32 +00:00
goldsimon
a66039b86c
Let netdb use a memp pool for allocating memory when getaddrinfo() is called.
2010-02-01 21:04:29 +00:00
goldsimon
c22d3b4c98
Use SYS_LIGHTWEIGHT_PROT instead of a semaphore to protect the sockets array since the protection time is short
2010-01-30 15:01:29 +00:00
goldsimon
f8c22c7428
Moved freeing a socket to its own function (free_socket, like alloc_socket
2010-01-30 14:19:18 +00:00
goldsimon
855dcadf7a
Added except set support in select (patch #6860 )
2010-01-29 23:05:33 +00:00
goldsimon
c70c3eac62
Added function-like macro for struct netconn::non_blocking
2010-01-29 22:21:45 +00:00
goldsimon
e58f4c567a
Add non-blocking support for connect (partly from patch #6860 ) plus many cleanups in socket & netconn API
2010-01-29 22:09:31 +00:00
goldsimon
5fa0347e64
Cleanly separate the portability file inet.h and its contents from the stack: moved htonX- functions to def.h (and the new def.c - they are not ipv4 dependent), let inet.h depend on ip_addr.h and not the other way round. This fixes bug #28732 .
2010-01-29 08:20:32 +00:00
goldsimon
32c16fad42
igmp related: renamed netif pointers from 'interface' to 'netif' to not use keywords (or at least my editor highlights it as one...)
2010-01-28 18:42:40 +00:00
goldsimon
04a8b0f85d
Added TCP_SNDQUEUELOWAT corresponding to TCP_SNDLOWAT and added tcp_sndqueuelen() - this fixes bug #28605
2010-01-27 18:24:57 +00:00
goldsimon
e678e1bdcb
bug #28659 : Missing casts
2010-01-25 08:24:30 +00:00
goldsimon
408829bcf6
Fixed compilation for LWIP_TCPIP_CORE_LOCKING
2010-01-23 18:13:55 +00:00
goldsimon
dbcce3a4be
bug #26523 : Compiler Warnings
2010-01-23 17:48:36 +00:00
goldsimon
426dd9bfad
Fixed bug #28716 : select() returns 0 after waiting for less than 1 ms
2010-01-23 15:01:15 +00:00
goldsimon
82318c0ef1
Fixed bug #28651 (tcp_connect: no callbacks called if tcp_enqueue fails) both in raw- and netconn-API
2010-01-21 18:43:37 +00:00
goldsimon
52389fc09a
Fixed bug #27316 (netconn: Possible deadlock in err_tcp) by using sys_mbox_trypost in err_tcp
2010-01-19 18:34:01 +00:00
goldsimon
cc1e9370af
Minor: fixed argument casts for mbox_fetch parameters (to fix compiler warnings)
2010-01-18 08:11:39 +00:00
goldsimon
34139606ca
task #10102 : "netconn: clean up conn->err threading issues" by adding error return value to struct api_msg_msg
2010-01-17 18:28:56 +00:00
goldsimon
ca11baf1cd
Changed netconn_recv() and netconn_accept() to return err_t (bugs #27709 and #28087 )
2010-01-17 16:21:07 +00:00
goldsimon
2d4e76874c
Using typedefs for function prototypes and -pointers throughout the stack for clarity
2010-01-14 20:02:15 +00:00
goldsimon
97f797e859
do_connect(): set conn->err to an error if conn->pcb is NULL
2010-01-14 19:49:27 +00:00
goldsimon
9521f54741
Another fix for bug #28562 : Segfault @ err_tcp
2010-01-14 15:43:11 +00:00
goldsimon
0e38a52edc
Again: Fixed bug #26672 (close connection when receive window = 0) by correctly draining recvmbox/acceptmbox
2010-01-13 15:59:47 +00:00
goldsimon
533e6b5f8d
Fixed bug #26672 (close connection when receive window = 0) by correctly draining recvmbox/acceptmbox
2010-01-08 15:10:03 +00:00
goldsimon
28f0bbd575
Fixed bug #28519 (lwip_recvfrom bug with len > 65535)
2010-01-08 14:51:14 +00:00
goldsimon
a566f9d8f2
Separated timer implementation from semaphore/mbox implementation, moved timer implementation to timers.c/.h (TASK#7235)
2009-12-31 16:16:44 +00:00
goldsimon
a1c0b9da7b
Added an additional option LWIP_ETHERNET to support ethernet without ARP (necessary for pure PPPoE) - no changes in the ppp code yet
2009-12-27 11:40:48 +00:00
goldsimon
4391463832
Got the tcp_nagle_*() defines wrong (inverted) :-(
2009-11-26 15:51:29 +00:00
goldsimon
c8d2d2a8ea
Fixed bug #28099 (API required to disable Nagle algorithm at PCB level): added tcp_nagele_*() function-like macros
2009-11-26 15:19:30 +00:00
goldsimon
8a81cb4ba0
Fixed bug #27955 : netconn_close may nether return when LWIP_TCPIP_CORE_LOCKING enabled
2009-11-22 16:08:52 +00:00
goldsimon
94a7fee8c8
Fixed bug #28062 : Data received directly after accepting does not wake up select
2009-11-20 16:16:20 +00:00
goldsimon
e2de2c6bb2
Added netifapi_netif_set_addr()
2009-10-27 20:29:16 +00:00
goldsimon
db259c3557
Improved heap usage of lwip_getaddrinfo by only allocating one block of memory per call.
2009-10-26 09:30:50 +00:00
goldsimon
a9740c6a44
Fixed bug #27709 : conn->err race condition on netconn_recv() timeout by directly returning when sys_arch_mbox_fetch times out.
2009-10-15 14:33:18 +00:00
goldsimon
a9cbdc141b
patch #6888 : Patch for UDP Netbufs to support dest-addr and dest-port
2009-10-07 17:58:30 +00:00
goldsimon
8a7c1c4926
do_connect: LWIP_ERROR on invalid/disabled protocol
2009-08-30 20:24:08 +00:00
goldsimon
bc10ad2356
patch #6900 : added define ip_ntoa(struct ip_addr*)
2009-08-25 14:53:25 +00:00
goldsimon
8bf57c0e14
Fixed bug #26657 : DNS, if host name is "localhost", result is error.
2009-08-23 13:51:12 +00:00
goldsimon
3a6165f0b9
Added missing include to <string.h>
2009-08-11 14:38:55 +00:00
goldsimon
cc4b968f0a
Fixed bug #27114 : Missing #include in api_msg.c on LWIP 1.3.1RC1; added include <string.h>
2009-07-27 15:13:24 +00:00
fbernon
ce5699f41b
minor changes: typos and coding style
2009-07-09 10:21:16 +00:00
kieranm
1eee0be951
BUG23240 use signed counters for recv_avail and don't increment
...
counters until message successfully sent to mbox
2009-07-09 09:35:07 +00:00
kieranm
2b87f899ab
BUG26722: initialise netconn write variables in netconn_alloc
2009-06-25 10:17:18 +00:00
goldsimon
22d6558f13
task #7013 : Added option LWIP_NETIF_TX_SINGLE_PBUF to try to create transmit packets from only one pbuf to help MACs that don't support scatter-gather DMA.
2009-05-10 17:07:25 +00:00
goldsimon
99d82c4980
Fixed bug #26405 : Prematurely released semaphore causes lwip_select() to crash
2009-05-05 17:20:45 +00:00
goldsimon
152d22d4f9
fixed tcpip_untimeout (does not need the time, broken after 1.3.0 in CVS only) - fixes compilation of ppp_oe.c
2009-05-02 16:12:35 +00:00
fbernon
4fba1b1430
netdb.c: remplace some %#p by %p to be more portable.
2009-04-23 14:41:52 +00:00
goldsimon
9d5bf57dd9
fixed bug #25695 : Segmentation fault in do_writemore()
2009-04-18 17:48:41 +00:00
goldsimon
422ba5bcec
tried to fix bug #23559 : lwip_recvfrom problem with tcp
2009-04-15 21:13:55 +00:00
goldsimon
27b28a9306
Converted netconn_type() from a function to a macro
2009-04-15 21:04:19 +00:00
goldsimon
dbd6d7ec8d
bug #26027 : netbuf_chain resulted in pbuf memory leak
2009-04-15 14:57:32 +00:00
goldsimon
b3a5d6df0d
bug #25763 : Corrected 4 occurrences of SMEMCPY to MEMCPY; corrected indentation
2009-04-15 14:48:56 +00:00
goldsimon
3587e8481d
bug #26121 : set_errno can be overridden
2009-04-15 14:33:05 +00:00
kieranm
7d8fac62ec
Fix compiler warning about %#p
2009-03-25 11:02:24 +00:00
goldsimon
c05e968278
Fixed many LWIP_DEBUGF format strings; added new format string SZT_F for size_t
2009-02-18 21:13:06 +00:00
goldsimon
14cb4eb735
fixed arguments of socket functions to match the standard; converted size argument of netconn_write to 'size_t' for that; fixed some warnings
2009-02-16 19:33:51 +00:00
goldsimon
8c7705bbf9
added configurable default valud for netconn->recv_bufsize: RECV_BUFSIZE_DEFAULT (fixes bug #23726 : pbuf pool exhaustion on slow recv())
2009-02-11 19:07:22 +00:00
goldsimon
b0c61ffbb1
Reverted last changes since it's wrong when sizeof(int)==2...
2008-12-20 12:24:41 +00:00
goldsimon
aa568727d1
patch #6699 : fixed some warnings on platform where sizeof(int) == 2
2008-12-19 18:08:29 +00:00
fbernon
411cb39eb4
sockets.c: fixed bug #25051 : lwip_recvfrom problem with udp: fromaddr and port uses deleted netbuf.
2008-12-10 21:36:44 +00:00
jifl
1f3fe200df
Correct commented description of do_recv().
...
Reported by Charles Landau on lwip-users.
2008-11-12 19:14:21 +00:00
jifl
1d2804d6a2
* sockets.c (lwip_accept): Return EWOULDBLOCK if would block on non-blocking
...
socket.
2008-10-02 13:59:18 +00:00
jifl
0d7dccba5e
* sockets.c (lwip_accept): check addr isn't NULL. If it's valid, do an
...
assertion check that addrlen isn't NULL.
2008-09-30 14:51:27 +00:00
goldsimon
c779a9f29f
Fixed some warnings, changed some debug defines to include better names
2008-07-16 20:36:12 +00:00
goldsimon
ae2d5266c5
removed invalid call to tcp_connect() in do_close_internal()
2008-07-15 11:18:58 +00:00
goldsimon
99db244124
fixed bug #23847 : do_close_internal references freed memory
2008-07-14 20:12:36 +00:00
goldsimon
95b15fe463
Fix typo, add comment
2008-06-27 20:34:51 +00:00
jifl
a3bc6cd666
* err.h, err.c, sockets.c: Fix bug #23119 : Reorder timeout error code to
...
stop it being treated as a fatal error.
2008-05-09 12:14:23 +00:00
goldsimon
05587f5da9
Changed the pbuf_free/mem_free callback functions a little: created extra functions for that
2008-03-28 07:56:47 +00:00
goldsimon
43dd38df0a
fixed bug #21433 (Calling mem_free/pbuf_free from interrupt context isn't safe): set LWIP_USE_HEAP_FROM_INTERRUPT to 1 in lwipopts.h or use tcpip_callback_nonblocking(pbuf_free_int, p)/ tcpip_callback_nonblocking(mem_free, m) to free pbufs or heap memory from interrupt context
2008-03-27 19:29:35 +00:00
fbernon
7774b57a1c
api_msg.c: fix wrong mailbox invalidate (NULL was used instead of SYS_MBOX_NULL). Spoted by Silas Boyd-Wickizer.
2008-03-21 16:23:14 +00:00
goldsimon
90cb4b4e09
Corrected comment in do_writemore()
2008-03-19 20:59:59 +00:00
fbernon
e07d71f5e8
sockets.c: Fix bug #22435 "lwip_recvfrom with TCP break;". Using (lwip_)recvfrom with valid "from" and "fromlen" parameters, on a TCP connection caused a crash. Note that using (lwip_)recvfrom like this is a bit slow and that using (lwip)getpeername is the good lwip way to do it (so, using recv is faster on tcp sockets).
2008-03-13 20:03:57 +00:00
fbernon
afcf49ad3a
api_msg.c: minor change, fix warning.
2008-03-13 19:57:11 +00:00
fbernon
a2f1892480
api_msg.c: fix the netbuf::addr field to point on the ip_src on the pbuf's copy (about bug#22530).
2008-03-12 12:58:07 +00:00
fbernon
552106e2a4
api_msg.c: Fix bug #22530 "api_msg.c's recv_raw() does not consume data".
2008-03-12 10:55:54 +00:00
fbernon
7b11fb75d9
Minor changes: replace directy call to memcpy by MEMCPY macro.
2008-01-26 16:11:39 +00:00
fbernon
7518acf634
rawapi.txt, api_msg.c, tcp.c, tcp_in.c, tcp.h: changes for task #7675 "Enable to refuse data on a TCP_EVENT_RECV call". Important, behavior changes for the tcp_recv callback (see rawapi.txt).
2008-01-14 21:07:08 +00:00
fbernon
55bcc20deb
tcpip.h, tcpip.c, api.h, api_lib.c, api_msg.c, sockets.c: replace the field netconn::sem per netconn::op_completed like suggested for the task #7490 "Add return value to sys_mbox_post".
2008-01-12 11:52:21 +00:00
fbernon
9906e4c984
api_msg.c, opt.h: replace DEFAULT_RECVMBOX_SIZE per DEFAULT_TCP_RECVMBOX_SIZE, DEFAULT_UDP_RECVMBOX_SIZE and DEFAULT_RAW_RECVMBOX_SIZE (to optimize queues sizes), like suggested for the task #7490 "Add return value to sys_mbox_post".
2008-01-11 23:50:10 +00:00
fbernon
4e40fee1db
tcpip.h, tcpip.c: add tcpip_callback_with_block function for the task #7490 "Add return value to sys_mbox_post". tcpip_callback is always defined as "blocking" ("block" parameter = 1).
2008-01-10 21:47:52 +00:00
fbernon
bceff76c70
tcpip.h, tcpip.c, api.h, api_lib.c, api_msg.c, sockets.c: replace the field netconn::mbox (sys_mbox_t) per netconn::sem (sys_sem_t) for the task #7490 "Add return value to sys_mbox_post".
2008-01-10 21:34:25 +00:00
goldsimon
a41f113b8f
Added function netconn_free(), which deallocates all mboxes and frees the netconn (to be used from different places) - the PCB is not freed!
2008-01-06 14:28:04 +00:00
fbernon
5941b3c86e
sys_arch.txt, api.h, api_lib.c, api_msg.h, api_msg.c, tcpip.c, sys.h, opt.h: Introduce changes for task #7490 "Add return value to sys_mbox_post" with some modifications in the sys_mbox api: sys_mbox_new take a "size" parameters which indicate the number of pointers query by the mailbox. There is three defines in opt.h to indicate sizes for tcpip::mbox, netconn::recvmbox, and for the netconn::acceptmbox. Port maintainers, you can decide to just add this new parameter in your implementation, but to ignore it to keep the previous behavior. The new sys_mbox_trypost function return a value to know if the mailbox is full or if the message is posted. Take a look to sys_arch.txt for more details. This new function is used in tcpip_input (so, can be called in an interrupt context since the function is not blocking), and in recv_udp and recv_raw.
2008-01-05 21:10:32 +00:00
fbernon
9c4daa312d
Minor changes in lwip folder: fix some warnings, coding style, and rename "internal" netconn_alloc function.
2008-01-04 23:07:44 +00:00
fbernon
32005617b9
rawapi.txt, api.h, api_lib.c, api_msg.h, api_msg.c, sockets.c, tcp.h, tcp.c, tcp_in.c, init.c, opt.h: rename backlog options with TCP_ prefix, limit the "backlog" parameter in an u8_t, 0 is interpreted as "smallest queue", add documentation in the rawapi.txt file.
2008-01-04 22:18:27 +00:00
goldsimon
1ed34774c8
tcp.h, opt.h, api.h, api_msg.h, tcp.c, tcp_in.c, api_lib.c, api_msg.c, sockets.c, init.c: task #7252 : Implement TCP listen backlog: Warning: raw API applications have to call 'tcp_accepted(pcb)' in their accept callback to keep accepting new connections.
2007-12-21 16:47:56 +00:00
goldsimon
48e62e25e9
sys.h, api_lib.c, api_msg.c, sockets.c: fix bug #21698 : "netconn->recv_avail is not protected" by using new macros for interlocked access to modify/test netconn->recv_avail.
2007-12-21 14:59:10 +00:00
goldsimon
ba4254231e
Corrected assert when netconn_new_* fails
2007-12-16 16:15:08 +00:00
fbernon
2b54da5070
api_msg.c, err.h, err.c, sockets.c, dns.c, dns.h: replace "enum dns_result" by err_t type. Add a new err_t code "ERR_INPROGRESS".
2007-12-13 23:06:49 +00:00
fbernon
1dd1064051
Fix err_stderr[] table with new err.h defines.
2007-12-12 08:25:23 +00:00
fbernon
ac10470643
netdb.c: add a LWIP_DNS_API_HOSTENT_STORAGE option to decide to use a static set of variables (=0) or a local one (=1). In this last case, your port should provide a function "struct hostent* sys_thread_hostent( struct hostent* h)" which have to do a copy of "h" and return a pointer ont the "per-thread" copy.
2007-12-05 23:00:02 +00:00
goldsimon
113a52d091
fix bug #21656 (recvmbox problem in netconn API): always allocate a recvmbox in netconn_new_with_proto_and_callback. For a tcp-listen netconn, this recvmbox is later freed and a new mbox is allocated for acceptmbox. This is a fix for thread-safety and allocates all items needed for a netconn when the netconn is created.
2007-12-02 14:53:50 +00:00
goldsimon
6746beb2a3
Compacted code: moved the code creating a netconn (without pcb) from netconn_new_with_proto_and_callback to new (synchroneous) function netconn_alloc_with_proto_and_callback and call this function from netconn_new_with_proto_and_callback and accept_function.
2007-11-30 12:54:10 +00:00
goldsimon
03777ccb21
Changed error handling: ERR_MEM, ERR_BUF and ERR_RTE are seen as non-fatal, all other errors are fatal. netconns and sockets block most operations once they have seen a fatal error.
2007-11-27 21:15:44 +00:00
goldsimon
4dcfdac2f5
initialize netconn->socket to -1 instead of 0 since 0 is a valid socket!
2007-11-25 16:13:56 +00:00
goldsimon
9343b767f8
lock event_callback against lwip_accept for data that arrives right away after an accept (before lwip_accept has processed the new conn)
2007-11-25 16:04:38 +00:00
fbernon
77d9233427
Minor change (redundant code)
2007-11-25 15:32:29 +00:00
goldsimon
f63a3c1f62
Added an explaining comment for the line 'nsock->rcvevent += -1 - newconn->socket;' in lwip_accept
2007-11-25 14:33:23 +00:00
goldsimon
e1f49d990b
Fix some warnings discovered by compiling the unixsim under cygwin (gcc pedantic)
2007-11-25 13:57:05 +00:00
goldsimon
c7a0f32c98
Back to old alloc_socket(), lwip_accept had a bug in last revision
2007-11-25 10:04:04 +00:00
fbernon
3d9c76a69c
Minor change (doxygen tags)
2007-11-24 22:13:25 +00:00
goldsimon
7797ada1f5
Added documentation
2007-11-24 21:19:47 +00:00
goldsimon
8cfd923aaa
Added some documentation (mainly what is unimplemented in contrast to 'std-BSD'), alloc_socket returns the sock pointer directly (for speedup)
2007-11-24 17:39:53 +00:00
goldsimon
c86b446d4c
Moved lwip_gethostbyname from sockets.c to the new file netdb.c; included lwip_getaddrinfo.
2007-11-24 16:12:02 +00:00
goldsimon
dc515c7ad3
Fixed bug #20287 : tcp_output_nagle sends too early. This fixes the nagle algorithm; nagle now also works for all raw API applications and has to be explicitly disabled with 'tcp_pcb->flags |= TF_NODELAY'
2007-11-21 17:59:03 +00:00
goldsimon
e7483f2e64
Added return value comments to netconn_gethostbyname
2007-11-20 21:23:24 +00:00
goldsimon
9a524dac86
Adopted lwip_gethostbyname and lwip_gethostbyname_r to the new return values of dns_gethostbyname/netconn_gethostbyname
2007-11-20 21:22:45 +00:00
fbernon
f58515b51e
api_msg.c, dns.h, dns.c: Implement DNS_DOES_NAME_CHECK option (check if name received match the name query), implement DNS_USES_STATIC_BUF (the place where copy dns payload to parse the response), return an error if there is no place for a new query, and fix some minor problems.
2007-11-19 22:42:01 +00:00
goldsimon
9dd4ad6c1f
Added thread-safe function gethostbyname_r (as in glibc)
2007-11-18 16:36:34 +00:00
fbernon
edc46281a4
Minor changes on DNS client.
2007-11-18 14:19:27 +00:00
goldsimon
e6ec23d7cc
Added sequential (socket API) function gethostbyname and the struct hostent it uses
2007-11-16 17:29:30 +00:00
goldsimon
e2cd201f6a
Added sequential dns resolver function for netconn api (netconn_gethostbyname)
2007-11-16 17:16:17 +00:00
fbernon
0c0e8d6544
opt.h, init.c, tcpip.c, dhcp.c, dns.h, dns.c: add DNS client for simple name requests with RAW api interface. Initialization is done in lwip_init() with build time options. DNS timer is added in tcpip_thread context. DHCP can set DNS server ip addresses when options are received. You need to set LWIP_DNS=1 in your lwipopts.h file (LWIP_DNS=0 in opt.h). DNS_DEBUG can be set to get some traces with LWIP_DEBUGF. Sanity check have been added. There is a "todo" list with points to improve.
2007-11-14 23:27:13 +00:00
fbernon
a4d14722f3
sockets.c, api.h, api_lib.c, api_msg.h, api_msg.c: Fixed bug #20900 . Now, most of the netconn_peer and netconn_addr processing is done inside tcpip_thread context in do_getaddr.
2007-11-12 22:39:24 +00:00
goldsimon
f3dbd986cb
Task #7410 : Removed the need to include core header files in api.h (ip/tcp/udp/raw.h) to hide the internal implementation from netconn api applications.
2007-11-06 20:31:28 +00:00
fbernon
ecce865cfe
api.h, api_lib.c, api_msg.c, sockets.c, opt.h: add SO_RCVBUF option for UDP & RAW netconn. You need to set LWIP_SO_RCVBUF=1 in your lwipopts.h (it's disabled by default). Netconn API users can use the netconn_recv_bufsize macro to access it. This is a first release which have to be improve for TCP. Note it used the netconn::recv_avail which need to be more "thread-safe" (note there is already the problem for FIONREAD with lwip_ioctl/ioctlsocket).
2007-11-02 10:37:08 +00:00
fbernon
cbe9b050a9
sockets.h, sockets.c, api.h, api_lib.c, api_msg.h, api_msg.c, tcp.h, tcp_out.c: Integrate "patch #6250 : MSG_MORE flag for send". MSG_MORE is used at socket api layer, NETCONN_MORE at netconn api layer, and TCP_WRITE_FLAG_MORE at raw api layer. This option enable to delayed TCP PUSH flag on multiple "write" calls. Note that previous "copy" parameter for "write" APIs is now called "apiflags".
2007-11-01 17:37:50 +00:00
fbernon
7077d51f1f
api.h, api_lib.c, api_msg.c: Add macro API_EVENT in the same spirit than TCP_EVENT_xxx macros to get a code more readable. It could also help to remove some code (like we have talk in "patch #5919 : Create compile switch to remove select code"), but it could be done later.
2007-10-24 12:09:18 +00:00
goldsimon
270c7c1110
Removed check for conn->err for functions whose counterparts in api_msg.c also do the check (1. remove redundant code, 2. check is better done in tcpip thread context)
2007-10-22 20:01:16 +00:00
goldsimon
2d3a64815f
Minor coding style fixes, added comment
2007-10-22 19:59:52 +00:00
fbernon
649d43c2c5
Minor change (define DHCP_COARSE_TIMER_MSECS - using DHCP_COARSE_TIMER_SECS - to use milliseconds like all others timers)
2007-10-15 21:31:42 +00:00
fbernon
cf998b7bf8
Minor fix (remove warning)
2007-10-10 08:13:58 +00:00
goldsimon
199648ff37
Changed initialization: many init functions are not needed any more since we now rely on the compiler initializing global and static variables to zero!
2007-10-09 19:59:56 +00:00
goldsimon
b1a4b00091
Preprocessor statements have to start at the beginning of a line for old compilers!
2007-10-09 19:30:17 +00:00
goldsimon
c1c9983cfe
Removed <warning: potential uninitialized reference to
...
"buf" in function "lwip_recvfrom">
2007-10-09 19:29:54 +00:00