goldsimon
8010d6706e
fixed bug #46471 : lwip_accept() leaks socket descriptors if new netconn was already closed because of peer behavior
2015-11-19 07:33:55 +01:00
goldsimon
98b9d31f24
Fixed compiling with LWIP_TCP==0
2015-11-16 09:37:56 +01:00
Axel Lin
ecf9d25ed0
api_msg_c: remove superfluous NETCONN_SET_SAFE_ERR call before TCPIP_APIMSG_ACK
...
The TCPIP_APIMSG_ACK will call NETCONN_SET_SAFE_ERR for both
LWIP_TCPIP_CORE_LOCKING and !LWIP_TCPIP_CORE_LOCKING cases.
So remove superfluous NETCONN_SET_SAFE_ERR call before TCPIP_APIMSG_ACK.
Signed-off-by: Axel Lin <axel.lin@ingics.com>
2015-11-16 09:12:29 +01:00
sg
f518c6578c
fixed bug #46321 : Synchronization bug around lwip_select() and tcpip_thread() with thread-local semaphores
2015-10-29 22:20:21 +01:00
sg
2dec8f449a
minor: fixed typo: even_callback -> event_callback
2015-10-29 22:18:41 +01:00
sg
f278b27119
pppapi/ppos: include tcpip_priv.h, not tcpip.h
2015-10-11 13:37:25 +02:00
Sylvain Rochet
37bb0b89f0
all: trivial include changes related to the new "lwip/priv/" include directory
2015-10-10 22:46:47 +02:00
sg
c12fa7b4c4
started to move "private" header files containing implementation details to "lwip/priv/" include directory to seperate the API from the implementation.
2015-10-09 21:58:58 +02:00
sg
fc1db87318
Fixed compiling api with LWIP_NETCONN_SEM_PER_THREAD==1 && LWIP_MPU_COMPATIBLE==1
2015-10-09 21:00:21 +02:00
goldsimon
b401f42520
minor: fixed coding style (lwip style)
2015-10-07 10:03:12 +02:00
sg
2b971400fa
minor: coding style
2015-10-06 21:57:40 +02:00
sg
22df34fc70
minor/coding style: removed spaces before line ending (from file header)
2015-10-06 21:13:15 +02:00
sg
490581a0eb
minor/coding style: removed spaces before line ending
2015-10-06 21:08:28 +02:00
goldsimon
5b1b430403
sockets ERR_TO_ERRNO_TABLE_SIZE: use LWIP_ARRAYSIZE()
2015-10-02 10:07:45 +02:00
Dirk Ziegelmeier
ae7eeda88a
dns_found_callback should take const IP addr
2015-09-30 22:19:47 +02:00
goldsimon
dbe703cfb0
netdb: fixed warning about pointless comparison
2015-09-28 08:10:53 +02:00
goldsimon
5ad743e182
FD_SET: dump NULL-check that hides usage error, dump non-standard FD_SET_VAL
2015-09-24 15:21:03 +02:00
goldsimon
c71723101a
Removed ip_2_ip4/6_c const macros again now that ip_2_ip4/6 macros keep the original const'ness
2015-09-24 14:38:52 +02:00
goldsimon
f85737bf29
Fixed const warning in lwip_writev
2015-09-24 09:30:00 +02:00
Joel Cunningham
cc4d09423a
Add writev function
...
This commit adds compatibility with POSIX writev according to the Open
Group specification:
http://pubs.opengroup.org/onlinepubs/009695399/functions/writev.html
Implementation maps to sendmsg in the same manner that write() maps to
send()
2015-09-23 15:52:28 -05:00
Sylvain Rochet
83cddd8941
PPP: more const and mixed u_char/char types fixes
2015-09-18 20:11:09 +02:00
sg
0454950564
fixed compiling for various config combinations
2015-09-17 22:19:37 +02:00
sg
4f9bcc5ecc
fixed compiler warnings reported by mingw-64
2015-09-17 22:00:16 +02:00
sg
2f3dcf7a16
fixed compiling lwip_sendmsg for LWIP_NETIF_TX_SINGLE_PBUF && LWIP_CHECKSUM_ON_COPY
2015-09-17 21:36:25 +02:00
Dirk Ziegelmeier
cca758d332
Fixed using wrong sockaddr type in lwip_getaddrinfo when IPv6 is enabled
2015-09-17 20:55:44 +02:00
Dirk Ziegelmeier
f62022cdf3
Compiler warning fixes (mostly constness in dual-stack configurations)
2015-09-17 13:59:52 +02:00
Joel Cunningham
c1c1754171
Sockets: add sendmsg
...
Adds sendmsg implementation for TCP and UDP sockets. Control messages
are not supported at this point, but could be added in the future
https://savannah.nongnu.org/bugs/?44805
Change-Id: Iddb287fd4b693f7563f8c923f76785cdde782d2f
2015-09-16 15:49:02 -05:00
goldsimon
dc04118469
fixed missing comment after #endif
2015-09-15 08:19:26 +02:00
Joel Cunningham
7276f49f54
Fix typos from task #12243
...
This fixes two typos spotted during visual inspection of changes related
to task #12243
2015-09-14 20:43:21 +02:00
Sylvain Rochet
b55412a0c4
PPP, PPPoS, replaced static sio_write() calls to a user defined callback
...
The overall lwIP design on data flows (netif,udp,tcp) is to use a user
defined callback to get data from stack and a static function to send
data to stack, which makes perfect sense. The SIO port was an exception,
the PPP stack never really used the SIO port by only using the
sio_send() function (and the ignominious sio_read_abort() function a
while back).
The way the SIO port is currently designed adds a tight coupling between
the lwIP port and the user code if the user need to do specific user
code if the current uart used is the PPPoS uart, which is not nice,
especially because all the lwIP stack is quite clean at this subject.
While we are at stabilizing the PPP API, change this behavior before
it's too late by replacing the static sio_write() calls to a user
defined callback.
2015-09-13 17:53:16 +02:00
sg
77270adb96
Changed dns_gethostbyname_addrtype() to always be a function, fixed code for C PP :-(
2015-09-07 22:33:10 +02:00
sg
1fbbf0e837
lwip_getaddrinfo: check max name length
2015-09-04 21:12:39 +02:00
sg
6795590603
fixed missing #endif
2015-09-04 21:02:24 +02:00
goldsimon
196120fabd
worked on task #12243 (Add support for AAAA/IPv6 records to DNS)
2015-09-04 13:57:20 +02:00
sg
204bd29e52
fixed bug #45827 : recvfrom: TCP window is updated with MSG_PEEK
2015-08-25 22:25:51 +02:00
goldsimon
e97f9fca22
netdb: fix debug output when IPv6 is enabled
2015-08-24 08:02:23 +02:00
Joel Cunningham
d850efdd08
IPv6 sockaddr clean ups
...
This commit address two issues with sockaddr struct implementations for
IPv6:
1) struct sockaddr_in6 should have 32-bit unsigned field sin6_scope_id
as specified in Section 3.4 of RFC 3493 (Basic Socket Interface
Extensions for IPv6)
2) struct sockaddr is not extended in IPv6 to contain space for
struct sockaddr_in6. Applications should be using struct
sockaddr_storage when needing generic storage. This removes the
extra bytes added when LWIP_IPV6 is defined
2015-08-19 10:15:47 +02:00
goldsimon
a6bd0944db
LWIP_NETCONN_SEM_PER_THREAD: ensure sys_sem_valid() is only called for non-NULL pointers (not all ports might check this)
2015-08-19 09:57:59 +02:00
sg
c2f7e166a0
fixed bug #45723 netconn_delete unconditionally uses macro TCP_SLOW_INTERVAL
2015-08-18 20:32:09 +02:00
sg
e171b4e3f0
Fixed usages of SYS_SEM_NULL after using pointers everywhere
2015-08-18 20:29:16 +02:00
goldsimon
bc4473b275
Fixed that netconn_thread_cleanup() did not call LWIP_NETCONN_THREAD_SEM_FREE() (!= vs ==)
2015-08-18 11:13:38 +02:00
sg
4edade8079
allow multicast socket options IP_MULTICAST_TTL, IP_MULTICAST_IF and IP_MULTICAST_LOOP to be used without IGMP
2015-08-05 22:52:23 +02:00
goldsimon
4b815eece9
added lwip_socket_thread_init/cleanup to use LWIP_NETCONN_SEM_PER_THREAD/LWIP_NETCONN_FULLDUPLEX without including anything but sockets.h
2015-08-03 10:15:29 +02:00
goldsimon
4dc3c7a6a0
Fixed warnings about NULL check not required (ip_addr_isany) and implicit conversion (~)
2015-08-03 08:35:01 +02:00
Erik Ekman
e448a9a4a9
err, debug: add missing ERR_ALREADY to lwip_strerr()
...
When ERR_ALREADY was added other error codes were renumbered.
The strerr function was not updated so it returned incorrect data
for ERR_CONN - ERR_IF.
2015-07-27 00:49:18 +02:00
goldsimon
232cf8c28b
Fixed bug #45098 ip_addr_t type field not populated for socket address copies (patch by James Smith)
2015-05-21 15:51:47 +02:00
goldsimon
b51805b87e
fixed bug #45135 getsockopt SO_SNDTIMEO, SO_RCVTIMEO broken
2015-05-21 15:47:21 +02:00
Sylvain Rochet
44af6978db
netconn: api_msg.c, fixed warning about unused state variable by using it a little more
2015-04-23 23:31:41 +02:00
goldsimon
3f83556128
sockets: IPPROTO_RAW/IPV6_CHECKSUM must be disabled for LWIP_RAW==0;
...
help msvc to not warn about uninitialized variables
2015-04-23 09:14:42 +02:00
goldsimon
f9965b4967
some more compiler warning fixes
2015-04-23 08:44:44 +02:00
goldsimon
00a46f104a
changed IP_IS_V6_VAL() to take an instance, not a pointer (to get the _val() functions the same)
2015-04-23 07:26:29 +02:00
goldsimon
e60bc69515
added more missing casts
2015-04-23 07:24:45 +02:00
goldsimon
634c438b50
sockets.c: added missing casts after changing storage type of 'err' member in sockets
2015-04-22 13:52:21 +02:00
goldsimon
beabd3c6b7
Added some macros with extension "_val" that work on actual instances and leave away the "if != NULL" check to get rid of gcc "-Waddress" warnings in the core code at least (I might not have caught all of them, yet)
2015-04-22 12:43:03 +02:00
goldsimon
902d190a11
Many const fixes throughout the stack (although these are not all, yet)
2015-04-22 10:29:43 +02:00
goldsimon
0142f113a3
fixed compiling netdb.c after LWIP_IPV4 changes
2015-04-22 09:17:31 +02:00
sg
6324068d34
Worked on IPv6-only stack: netdb should work
2015-04-13 21:29:04 +02:00
sg
c1c65777b6
worked on task #13480 : added LWIP_IPV4 define - IPv4 can be disabled, leaving an IPv6-only stack (SNMP is still missing)
2015-04-12 10:43:46 +02:00
Sylvain Rochet
d6fdf7d4b1
PPP, PPPoL2TP, switched to dual stack IPv4/IPv6
...
Replaced ip4_addr_t to ip_addr_t in pppapi_pppol2tp_create() prototype,
now binding to UDPv6 or UDPv4 depending on the passed ip_addr_t type.
Removed pppol2tp_create_ip6() and pppapi_pppol2tp_create_ip6().
2015-04-11 13:15:06 +02:00
sg
ce7e31cd04
task #12722 (improve IPv4/v6 address handling): renamed ip_addr_t to ip4_addr_t, renamed ipX_addr_t to ip_addr_t and added IP version;
...
ip_addr_t is used for all generic IP addresses for the API, ip(4/6)_addr_t are only used internally or when initializing netifs or when calling version-related functions
2015-04-09 22:21:15 +02:00
goldsimon
c998faeeab
fixed bug #44649 lwip_socket_drop_registered_memberships
2015-03-27 13:18:34 +01:00
Sylvain Rochet
ee752ab1ce
PPP, PPPoS, renamed PPP_INPROC_MULTITHREADED to PPP_INPROC_IRQ_SAFE
...
Follow-up of the #44565 bug fix, renamed the misnamed
PPP_INPROC_MULTITHREADED to PPP_INPROC_IRQ_SAFE because it is
IRQ safe but not thread safe.
Updated PPP documentation which now clearly state when and how
this feature can be used.
2015-03-19 21:43:55 +01:00
sg
9eb900c448
fixed race conditions in assigning netconn->last_err (fixed bugs #38121 and #37676 )
2015-03-19 21:20:29 +01:00
Sylvain Rochet
0e919d25e9
PPP, PPPoS, improved tcpip input path, fixed bug #44565
...
New input type TCPIP_MSG_INPKT_PPPOS. Removed the netif input pointer usage
which was actually broken by design.
Fixed bug #44565 .
2015-03-19 21:04:21 +01:00
Ivan Delamer
e0fe83740a
fixed bug #44565 : PPPOS support in tcpip thread breaks SLIP
2015-03-18 10:16:14 -06:00
Sylvain Rochet
9778b1411c
PPP, PPPoS, TCPIP: add packet input path for point to point interfaces (only PPPoS for now) through the TCPIP API
...
!NO_SYS users may now use as well the TCPIP API for PPPoS input data,
this way they can disable PPP_INPROC_MULTITHREADED and run pppos_input()
inside the lwIP thread, which fixes, at least for them, all the
threading issues related to PPP_INPROC_MULTITHREADED.
2015-03-11 00:58:09 +01:00
Sylvain Rochet
969306f0f1
API: netdb: replaced deprecated ip_ntoa() to ipaddr_ntoa()
2015-03-08 13:57:13 +01:00
Sylvain Rochet
3ce6dd166c
PPP, L2TP, added link-level IPv6 support
2015-03-01 22:04:24 +01:00
Sylvain Rochet
2731976a95
PPP, renamed ppp_open to ppp_connect
...
Makes it clear we are initiating the PPP session with ppp_connect
(i.e. acting as a PPP client) so there is no confusion possible
between ppp_connect and ppp_listen.
2015-03-01 10:53:08 +01:00
Sylvain Rochet
371bc91d73
PPP, SERVER: added PPPoS server support
...
New function: ppp_listen(), listen for an incoming PPP connection.
2015-02-28 22:41:18 +01:00
Joel Cunningham
9004554da3
fixed bug #43028 (IP_MULTICAST_TTL affects unicast datagrams)
2015-02-25 21:59:21 +01:00
sg
83740d81f2
fixed comment
2015-02-25 21:32:33 +01:00
sg
c8581e4cd9
fixed bug #38165 (socket with mulicast): ensure igmp membership are dropped when socket (not netconn!) is closed.
2015-02-25 21:30:22 +01:00
sg
3e8ac30940
Fixed bug #44297 (CORE_LOCKING was broken some days ago); fixed that netconn_connect still used message passing for LWIP_TCPIP_CORE_LOCKING==1
2015-02-25 20:34:18 +01:00
Sylvain Rochet
00bb70a62d
PPP, CORE, functions ppp_set_netif_statuscallback() and ppp_set_netif_linkcallback() replaced with defines
...
PPP is now pointerful for a while, we don't need anymore accessor functions
for the unique PPP local and static control block. Replaced
ppp_set_netif_statuscallback() and ppp_set_netif_linkcallback() functions to
defines.
Removed pppapi_do_ppp_set_netif_statuscallback() and
pppapi_do_ppp_set_netif_linkcallback(), they were useless because
netif_set_status_callback() and netif_set_link_callback() can be
safely called while PPP status is in dead (= non open) state
and even before the PPP session is actually created at all.
2015-02-24 20:41:47 +01:00
sg
03159254ce
added proper accessor functions for pcb->multicast_ip (previously used by get/setsockopt only)
2015-02-22 21:49:46 +01:00
sg
ec5cf8593e
Continued chrysn's work: changed nearly all functions taking 'ip(X)_addr_t' pointer to take const pointers (changed user callbacks: raw_recv_fn, udp_recv_fn; changed port callbacks: netif_output_fn, netif_igmp_mac_filter_fn)
2015-02-22 21:46:35 +01:00
Sylvain Rochet
4be7fccad3
PPP, CORE, ppp_close() and ppp_sighup() ended up sharing almost everything, merged
...
Merged ppp_sighup() to ppp_close() using an optional argument "nocarrier"
on ppp_close().
2015-02-22 14:25:36 +01:00
Sylvain Rochet
dc2e700057
PPP, CORE, using u8_t on ioctl command instead of int
...
We don't need an int here, all commands are between 0 and 255.
2015-02-21 21:37:08 +01:00
Sylvain Rochet
6b4db944dd
PPP, using err_t return code instead of PPPERR_
...
Standardised PPP API to follow lwIP already used return codes.
PPPERR_ are now used only on link status callback.
2015-02-20 21:24:58 +01:00
Sylvain Rochet
0a761d238a
PPP, using err_t return type on ppp_ioctl()
2015-02-20 21:01:24 +01:00
sg
730529353d
fixed bug #37958 "netconn API doesn't handle correctly connections half-closed by peer"
2015-02-18 22:21:26 +01:00
sg
2cfc9e286e
"Not connected" shouldn't be fatal (as opposed to "closed")
2015-02-18 20:39:20 +01:00
sg
998ed99288
Fixed select not reporting received FIN as 'readable' in certain rare cases (bug #43779 : select(), close(), and TCP retransmission error)
2015-02-18 20:38:42 +01:00
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