Sylvain Rochet
ee2936ffbf
PPP, all protocols, uniformised naming
...
Uniformised fonction naming between and inside PPPoS, PPPoE, PPPoL2TP.
2015-02-17 23:22:14 +01:00
Sylvain Rochet
9c15ffbb74
PPP: Moved PPPoS from ppp.c to pppos.c
...
Started removing from PPP core most of low level protocol PPPoS
handling to separate files, using the new low level PPP callbacks.
2015-02-17 23:22:13 +01:00
Sylvain Rochet
ee85aaccd2
PPP, removed low level create functions from PPP core
...
ppp_over_ethernet_create() moved from ppp.c to pppoe.c
ppp_over_l2tp_create() moved from ppp.c to pppol2tp.c
2015-02-17 23:22:13 +01:00
Sylvain Rochet
17c6be6a9b
PPP: removed ppp_delete(), merged with ppp_free()
...
The only benefit of ppp_delete() call was about having a persistent
netif interface. netif was moved out of PPP pcb so we don't need
ppp_delete() anymore, second step in simplifying the weird
new/open/free/delete PPP API.
2015-02-17 23:22:12 +01:00
Sylvain Rochet
318e752fd6
PPP: removed ppp_new(), merged with ppp_over_X_create()
...
The only benefit of ppp_new() call was about having a persistent netif
interface. netif was moved out of PPP pcb so we don't need ppp_new()
anymore, first step in simplifying the weird new/open/free/delete PPP
API.
2015-02-17 23:22:12 +01:00
Sylvain Rochet
3dcfd7ba41
PPP: moved netif out of PPP control block
...
Users might want to share a netif control block between an Ethernet
interface and a PPPoS interface (I want actually) in case PPP is just
used as redundancy if Ethernet is down (eg. PPPoS GPRS fail over).
Moved netif out of PPP control block in a similar way it is currently
done for Ethernet interfaces. Furthermore, this is a first step on
removing the "new/create/free/delete" API which is awful but currently
necessary to handle fail over from PPPoX to another PPPoX (eg. from PPoE
on xDSL to PPPoS on GPRS fail over) without free()ing the netif which
might be used on udp_sendto() or L2TP VPN links.
2015-02-17 23:22:12 +01:00
sg
604a92dc3d
fixed bug #38853 "connect() use a wrong errno": return ERR_ALREADY/EALRADY during connect, ERR_ISCONN/EISCONN when already connected
2015-02-17 22:10:23 +01:00
sg
b146ae96a7
sockets.c: removed LWIP_TCPIP_CORE_LOCKING hack in lwip_sendto(): since all functions are static when LWIP_NETCONN==0, the speedup gained by this hack should now be minimal and not worth the duplicate code.
2015-02-17 21:26:40 +01:00
goldsimon
0963e91c34
api_msg_c: fixed compiler warning (added brackets in if statement)
2015-02-17 09:38:20 +01:00
goldsimon
5d13b5a2fb
fixed bug #37614 "Errors from ipX_output are not processed". Now tcp_output(_segment) checks for the return value of ipX_output and does not try to send more on error. A netif driver can call tcp_txnow() (from tcpip_thread!) to try to send again if TX buffers are available again.
2015-02-17 08:02:34 +01:00
sg
8155b8cfb3
patch #7702 "Include ability to increase the socket number with defined offset"
2015-02-11 23:05:52 +01:00
sg
276e35ecfb
Fixed a bug in linger-closing when LWIP_TCPIP_CORE_LOCKING==1
2015-02-11 22:53:19 +01:00
sg
060a1fc727
patch #8481 Fix a couple of c&p mistakes in the error prints
2015-02-11 21:39:45 +01:00
sg
28783abbe2
fixed bug #43094 "The function tcpip_input() forget to handle IPv6"
2015-02-11 21:36:46 +01:00
sg
7ff9825f55
started to implement fullduplex sockets/netconns (note that this is highly unstable yet!)
2015-02-11 21:18:15 +01:00
sg
6c3f6cfd89
netconn/socket api: fixed bug #44225 "closing TCP socket should time out eventually", implemented task #6930 "Implement SO_LINGER": closing TCP sockets times out after 20 seconds or after the configured SND_TIMEOUT or depending on the linger settings; fixed that netconn_close/netconn_delete still used message passing for LWIP_TCPIP_CORE_LOCKING==1
2015-02-10 22:15:54 +01:00
sg
ec68aaf43b
fixed that SHUT_RD followed by SHUT_WR was different to SHUT_RDWR, fixed return value of lwip_netconn_do_close on unconnected netconns
2015-01-27 21:28:39 +01:00
goldsimon
24df78bcbc
fixed that lwip_netconn_do_delconn() did not set msg->err on success (just introduced that bug this weekend...)
2015-01-20 14:01:16 +01:00
sg
05aa0ad114
netconn_delete(): check for errors returned by lwip_netconn_do_delconn() and don't call netconn_free() on error
2015-01-17 21:54:17 +01:00
sg
5ceaed291f
fixed bug #43361 select() crashes with stale FDs
2015-01-17 21:02:58 +01:00
sg
c1804810d8
allow enabling socket API without (public) netconn API - netconn API is still used by sockets, but keeping it private (static) should allow better compiler optimizations
2015-01-17 14:42:50 +01:00
sg
5d2e93e5f0
fixed bug #40788 "lwip_setsockopt_internal() crashes" by rewriting set/getsockopt functions to combine checks with the actual code and add more NULL checks; this also fixes that CORE_LOCKING used message passing for set/getsockopt.
2015-01-17 14:18:27 +01:00
Sylvain Rochet
91356d2d03
PPPAPI, added const modifier on auth strings
2014-12-24 19:05:19 +01:00
goldsimon
a883fe7b8e
sockets.c: fixed assert check after changing type of sock->select_waiting to unsigned
2014-12-17 16:21:44 +01:00
sg
7ca4fd817e
- fixed bug #43797 set/getsockopt: SO_SNDTIMEO/SO_RCVTIMEO take int as option but should take timeval (LWIP_SO_SNDRCVTIMEO_STANDARD==0 can be used to revert to the old 'winsock' style behaviour);
...
- Fixed implementation of SO_ACCEPTCONN to just look at the pcb state;
- cleaned up the SO/SOF defines (only 3 left a ip_pcb level);
2014-12-10 21:46:49 +01:00
sg
8e13bcd43d
fixed indentation
2014-12-10 21:24:02 +01:00
sg
cacdbb5262
added option LWIP_NETCONN_SEM_PER_THREAD to use a semaphore per thread instead of using one per netconn and per select call
2014-12-10 20:45:01 +01:00
goldsimon
1bf2e313f6
sockets.c: fixed using unsigned constant 'FIONBIO' in switch on (signed) long
2014-12-08 15:01:18 +01:00
goldsimon
2809405164
lwip_socket_init() is not needed any more -> compatibility define
2014-11-06 14:14:58 +01:00
sg
d6fbe2a5ad
fixed bugs #41495 Possible threading issue in select() and #43278
...
event_callback() handle context switch when calling sys_sem_signal()
2014-10-28 22:28:50 +01:00
goldsimon
aecbce283d
fixed bug #38219 Assert on TCP netconn_write with sndtimeout set
2014-10-21 11:09:07 +02:00
Simon Goldschmidt
33237419c1
Parts of patch #8397 Typos corrected in comments and text outputs
2014-09-18 21:15:13 +02:00
Simon Goldschmidt
9f48488d87
minor: fixed coding style in pppapi.h/.c
2014-09-16 21:57:52 +02:00
Simon Goldschmidt
4b9883a573
DNS: does not support IPv6, may return a name cased different than the request (when multiple requests are combined to one)
2014-09-15 21:56:29 +02:00
Simon Goldschmidt
3c40d93f36
fixed bug #43110 (call getpeername() before listen() will cause a error) by re-sorting the error numbers and letting listen() continue on ERR_CONN
2014-09-02 22:34:53 +02:00
Simon Goldschmidt
4335e99f2e
netconn_gethostbyname() needs to check for name length when LWIP_MPU_COMPATIBLE==1
2014-09-02 21:40:05 +02:00
Simon Goldschmidt
5c37c63cef
fixed bug #42117 lwip_fcntl does not set errno
2014-09-02 21:08:30 +02:00
Sylvain Rochet
7fe7e1e984
Merge branch 'ppp-new'
...
Based from pppd 2.4.5, released 2009-11-17, with huge changes to match
code size and memory requirements for embedded devices, including:
- Gluing together the previous low-level PPP code in lwIP to pppd 2.4.5, which
is more or less what pppd sys-* files are, so that we get something working
using the unix port.
- Merged some patchs from lwIP Git repository which add interesting features
or fix bugs.
- Merged some patchs from Debian pppd package which add interesting features
or fix bugs.
- Ported PPP timeout handling to the lwIP timers system
- Disabled all the PPP code using filesystem access, replaced in necessary cases
to configuration variables.
- Disabled all the PPP code forking processes.
- Removed IPX support, lwIP does not support IPX.
- Ported and improved random module from the previous PPP port.
- Removed samba TDB (file-driven database) usage, because it needs a filesystem.
- MS-CHAP required a DES implementation, we added the latest PolarSSL DES
implementation which is under a BSD-ish license.
- Also switched to PolarSSL MD4,MD5,SHA1 implementations, which are meant to be
used in embedded devices with reduced memory footprint.
- Removed PPP configuration file parsing support.
- Added macro definition EAP_SUPPORT to make EAP support optional.
- Added macro definition CHAP_SUPPORT to make CHAP support optional.
- Added macro definition MSCHAP_SUPPORT to make MSCHAP support optional.
- Added macro definition PAP_SUPPORT to make PAP support optional.
- Cleared all Linux syscall calls.
- Disabled demand support using a macro, so that it can be ported later.
- Disabled ECP support using a macro, so that it can be ported later.
- Disabled CCP support using a macro, so that it can be ported later.
- Disabled CBCP support using a macro, so that it can be ported later.
- Disabled LQR support using a macro, so that it can be ported later.
- Print packet debug feature optional, through PRINTPKT_SUPPORT
- Removed POSIX signal usage.
- Fully ported PPPoS code from the previous port.
- Fully ported PPPoE code from the previous port.
- Fully ported VJ compression protocol code from the previous port.
- Removed all malloc()/free() use from PPP, replaced by stack usage or PBUF.
- Disabled PPP server support using a macro, so that it can be ported later.
- Switched all PPP debug to lwIP debug system.
- Created PPP Control Block (PPP PCB), removed PPP unit integer everywhere,
removed all global variables everywhere, did everything necessary for
the PPP stack to support more than one PPP session (pppd only support
one session per process).
- Removed the statically allocated output buffer, now using PBUF.
- Improved structure size of all PPP modules, deep analyze of code to reduce
variables size to the bare minimum. Switched all boolean type (char type in
most architecture) to compiler generated bitfields.
- Added PPP IPv6 support, glued lwIP IPv6 support to PPP.
- Now using a persistent netif interface which can then be used in lwIP
functions requiring a netif.
- Now initializing PPP in lwip_init() function.
- Reworked completely the PPP state machine, so that we don't end up in
anymore in inconsistent state, especially with PPPoE.
- Improved the way we handle PPP reconnection after disconnect, cleaning
everything required so that we start the PPP connection again from a
clean state.
- Added PPP holdoff support, allow the lwIP user to wait a little bit before
reconnecting, prevents connection flood, especially when using PPPoL2TP.
- Added PPPoL2TP LAC support (a.k.a. UDP tunnels), adding a VPN client
feature to lwIP, L2TP being a widely used tunnel protocol.
- Switched all used PPP types to lwIP types (u8t, u16t, u32t, ...)
- Added PPP API "sequential" thread-safe API, based from NETIFAPI.
2014-05-22 21:25:58 +02:00
Simon Goldschmidt
695e001984
lwip_gethostbyname: fixed using uninitialized variable when LWIP_DNS_API_HOSTENT_STORAGE==1
2014-05-15 21:17:41 +02:00
Sylvain Rochet
d9e2edd1df
Merge branch 'master' into ppp-new
2014-05-05 20:55:18 +02:00
goldsimon
e4ddd6cb6d
Multiple fixes found by coverity scan
2014-04-30 12:22:31 +02:00
Sylvain Rochet
ca7769e041
Merge branch 'master' into ppp-new
2014-04-12 01:25:00 +02:00
Simon Goldschmidt
3f016fcc5a
Multiple small/minor issues: bug #36492 Static Analysis on code 1.4.0
2014-04-06 21:43:37 +02:00
Sylvain Rochet
a38e5a44ec
Merge branch 'master' into ppp-new
2014-03-14 20:48:12 +01:00
Simon Goldschmidt
c065427ebe
fixed bug #35928 BSD sockets functions must set errno for POSIX-compliance (patch by Mason)
2014-03-11 20:53:44 +01:00
Simon Goldschmidt
c60635855d
fixed bug #38404 getpeeraddr returns success on unconnected/listening TCP sockets
2014-02-27 21:28:15 +01:00
Simon Goldschmidt
2666d6df90
fixed bug #41729 Some socket functions return Exyz instead of -1
2014-02-27 20:57:37 +01:00
Sylvain Rochet
75ef1278e6
Merge branch 'master' into ppp-new
2014-02-21 20:37:10 +01:00
Simon Goldschmidt
fc158ad5c0
Fixed netconn_gethostbyname for LWIP_MPU_COMPATIBLE: removed invalid check on 'addr', copy 'name' since it could be located on the caller's stack
2014-02-21 09:04:39 +01:00
Sylvain Rochet
d7ba4bbb9b
Merge branch 'master' into ppp-new
2014-02-21 00:39:29 +01:00
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