fbernon
7c104c8fbb
igmp.h, igmp.c, ip.c: Fix minor changes from bug #20503 : IGMP Improvement. This is mainly on using lookup/lookfor, and some coding styles...
2007-08-09 16:53:47 +00:00
fbernon
42eead8f41
igmp.c: Fix bug #20595 to accept IGMPv3 "Query" messages.
2007-07-26 17:10:56 +00:00
goldsimon
f4036e8352
Another fix for bug #20021 : by not returning an error if tcp_output fails in tcp_close, the code in do_close_internal gets simpler (tcp_output is called again later from tcp timers).
2007-07-25 19:24:27 +00:00
goldsimon
f9c30017b0
Fixed bug #20429 : use the new pbuf_copy_partial instead of the old copy_from_pbuf, which illegally modified the given pbuf; Introduced pbuf_copy_partial, making netbuf_copy_partial use this function.
2007-07-25 18:53:45 +00:00
goldsimon
8be76ed450
tcp_enqueue: pcb->snd_queuelen didn't work for chaine PBUF_RAMs: changed snd_queuelen++ to snd_queuelen += pbuf_clen(p).
2007-07-25 08:46:41 +00:00
goldsimon
9eff9676e9
Fix bug #20506 : Slow start / initial congestion window starts with 2 * mss (instead of 1 * mss previously) to comply with some newer RFCs and other stacks.
2007-07-25 07:31:29 +00:00
goldsimon
62c3de30b9
Fix bug #20480 : Check the pcb passed to tcp_listen() for the correct state (must be CLOSED).
2007-07-24 07:41:55 +00:00
jgrubb
05e177e2c8
+bug fix #20478 : memp_malloc now returns NULL for failed allocation (instead of NULL+MEMP_SIZE)
2007-07-14 00:21:37 +00:00
fbernon
116bcb9dfb
opt.h, netif.h, netif.c, ethernetif.c: Add new configuration option to add a link callback in the netif struct, and functions to handle it. Be carefull for port maintainers to add the NETIF_FLAG_LINK_UP flag (like in ethernetif.c) if you want to be sure to be compatible with future changes...
2007-07-13 15:00:40 +00:00
fbernon
6a452951f5
api_msg.c: Fix bug #20318 : api_msg "recv" callbacks don't call pbuf_free in all error cases.
2007-07-13 14:28:15 +00:00
fbernon
a891854ef5
Fix bug #20315 : possible memory leak problem if tcp_listen failed, because current code doesn't follow rawapi.txt documentation.
2007-07-13 13:59:11 +00:00
kieranm
4ac0580aa0
2007-07-13 Kieran Mansley
...
* src/core/tcp_in.c Apply patch#5741 from Oleg Tyshev to fix bug in
out of sequence processing of received packets
2007-07-13 12:24:32 +00:00
goldsimon
eb875de67e
Added assertions where PBUF_RAM pbufs are used and an assumption is made that this pbuf is in one piece (i.e. not chained). These assumptions clash with the possibility of converting to fully pool-based pbuf implementations, where PBUF_RAM pbufs might be chained.
2007-07-03 20:28:35 +00:00
goldsimon
9a4a5b1816
Final fix for bug #20021 and some other problems when closing tcp netconns: removed conn->sem, less context switches when closing, both netconn_close and netconn_delete should safely close tcp connections.
2007-07-03 19:29:59 +00:00
goldsimon
96e4ec4a15
Added option LWIP_NETIF_HWADDRHINT (default=off) to cache ARP table indices with each pcb instead of single-entry cache for the complete stack.
2007-07-02 20:41:22 +00:00
goldsimon
fa4b711495
Added some ASSERTS and casts to prevent warnings when assigning to smaller types.
2007-07-02 20:13:45 +00:00
fbernon
b6750de9e8
sockets.h, sockets.c: Implement MSG_PEEK flag for recv/recvfrom functions.
2007-06-30 13:24:11 +00:00
goldsimon
6c3c184bc7
Added check to prevent tcp_pcb->snd_queuelen from overflowing.
2007-06-29 17:09:47 +00:00
goldsimon
24e29cecae
Fixed bug #20287 : Fixed nagle algorithm (sending was done too early if a segment contained chained pbufs)
2007-06-28 20:05:38 +00:00
fbernon
ab4c3a326f
autoip.c: replace most of rand() calls by a macro LWIP_AUTOIP_RAND which compute a "pseudo-random" value based on netif's MAC and some autoip fields. It's always possible to define this macro in your own lwipopts.h to always use C library's rand(). Note that autoip_create_rand_addr doesn't use this macro.
2007-06-28 18:05:38 +00:00
fbernon
d6fbe45296
netifapi.h, netifapi.c, tcpip.h, tcpip.c: Update code to handle the option LWIP_TCPIP_CORE_LOCKING, and do some changes to be coherent with last modifications in api_lib/api_msg (use pointers and not type with table, etc...)
2007-06-28 10:11:05 +00:00
goldsimon
2270f0d172
Fixed bug #20259 : struct udp_hdr was lacking the packin defines.
2007-06-26 07:32:17 +00:00
goldsimon
dcc2247a90
Fixed bug #20253 : icmp_dest_unreach was called with a wrong p->payload for udp packets with no matching pcb.
2007-06-25 17:30:16 +00:00
goldsimon
00b7aeb49b
Fixed bug #20220 : UDP PCB search in udp_input(): a non-local match could get udp input packets if the remote side matched.
2007-06-25 17:24:31 +00:00
goldsimon
b51d1b79a3
Combined etharp_request with etharp_raw for both LWIP_AUTOIP =0 and =1 to remove redundant code.
2007-06-24 12:51:22 +00:00
goldsimon
0c18e653e8
Introduced the option MEM_USE_POOLS to use 4 pools with different sized elements instead of a heap. This both prevents memory fragmentation and gives a higher speed at the cost of more memory consumption. Turned off by default.
2007-06-21 20:12:11 +00:00
goldsimon
f49fc35f55
Converted the length argument of netconn_write (and therefore also api_msg_msg.msg.w.len) from u16_t into int to be able to send a bigger buffer than 64K with one time (mainly used from lwip_send).
2007-06-21 19:32:26 +00:00
goldsimon
2aef8bad55
Moved the nagle algorithm from netconn_write/do_write into a define (tcp_output_nagle) in tcp.h to provide it to raw api users, too.
2007-06-21 18:55:09 +00:00
goldsimon
9f05cabf87
Fixed bug #20021 : Moved sendbuf-processing in netconn_write from api_lib.c to api_msg.c to also prevent multiple context-changes on low memory or empty send-buffer.
2007-06-21 18:40:21 +00:00
goldsimon
d3f0a3211d
Changed etharp to use a defined hardware address length of 6 to avoid loading netif->hwaddr_len every time (since this file is only used for ethernet and struct eth_addr already had a defined length of 6).
2007-06-19 16:22:55 +00:00
goldsimon
ea7b0052f3
Implemented socket options SO_NO_CHECK for UDP sockets to disable UDP checksum generation on transmit.
2007-06-17 11:46:30 +00:00
goldsimon
cbf281589b
Fixed bug #20180 (TCP pcbs listening on IP_ADDR_ANY could get changed in netif_set_ipaddr if previous netif->ip_addr.addr was 0.
2007-06-16 13:32:10 +00:00
goldsimon
15e8208457
pcb_new sets conn->err if protocol is not implemented -> netconn_new_..() does not allocate a new connection for unsupported protocols.
2007-06-13 19:00:21 +00:00
fbernon
d8fe18c28e
api_lib.c: change return expression in netconn_addr and netconn_peer, because conn->err was reset to ERR_OK without any reasons (and error was lost)...
2007-06-13 18:08:49 +00:00
fbernon
9ee85fb1b6
debug.h, api_msg.c: change LWIP_ERROR to use it to check errors like invalid pointers or parameters, and let the possibility to redefined it in cc.h. Use this macro to check "conn" parameter in api_msg.c functions (some others change will be done...).
2007-06-13 18:00:54 +00:00
fbernon
bdbc96f453
opt.h, mem.h, mem.c, memp.c, pbuf.c, ip_frag.c, vj.c: Fix bug #20162 . Rename MEM_ALIGN in LWIP_MEM_ALIGN and MEM_ALIGN_SIZE in LWIP_MEM_ALIGN_SIZE to avoid some macro names collision with some OS macros.
2007-06-13 17:17:26 +00:00
goldsimon
046a270156
Added UDP lite support for sockets
2007-06-11 18:43:16 +00:00
goldsimon
2f293d53ba
UDP Lite: corrected the use of chksum_len (based on RFC3828: if it's 0, create checksum over the complete packet. On RX, if it's < 8 (and not 0), discard the packet. Also removed the duplicate 'udphdr->chksum = 0' for both UDP & UDP Lite.
2007-06-11 18:03:57 +00:00
fbernon
1d7caed340
tcp_out.c: Fix for bug #20075 : "A problem with keep-alive timer and TCP flags" where TCP flags wasn't initialized in tcp_keepalive. Reported by Srinivas Gollakota with help of Oleg Tyshev.
2007-06-11 13:59:10 +00:00
goldsimon
95f4c02381
Included switch LWIP_UDPLITE (enabled by default) to switch off UDP-Lite support if not needed (reduces udp.c code size)
2007-06-10 12:02:24 +00:00
fbernon
e01f342048
Contrib module by Dominik Spies: autoip.h, autoip.c, dhcp.h, dhcp.c, netif.h, netif.c, etharp.h, etharp.c, opt.h: AutoIP implementation available for IPv4, with new options LWIP_AUTOIP and LWIP_DHCP_AUTOIP_COOP if you want to cooperate with DHCP. Some tips to adapt (see TODO mark in the source code).
2007-06-09 16:57:04 +00:00
goldsimon
c028619cdd
Modified order of parameters for etharp_output() to match netif->output so etharp_output() can be used directly as netif->output to save one function call.
2007-06-08 22:20:05 +00:00
goldsimon
0e9cb48ea1
Changed define NETIF_INIT_SNMP(type, speed) to include the name of the struct netif to change...
2007-06-08 19:59:20 +00:00
goldsimon
945460c67e
Added define NETIF_INIT_SNMP(type, speed) to initialize per-netif snmp variables, added initialization of those to slipif and loopif.
2007-06-08 17:17:41 +00:00
goldsimon
3a607a197e
opt.h, ip_frag.c, ip_frag.h, ip.c: Added option IP_FRAG_USES_STATIC_BUF (defaulting to off for now) that can be set to 0 to send fragmented packets by passing PBUF_REFs down the stack.
2007-06-03 18:36:42 +00:00
goldsimon
974cf08e5d
udp_input(): Input pbuf was not freed if pcb had no recv function registered, p->payload was modified without modifying p->len if sending icmp_dest_unreach() (had no negative effect but was definitively wrong).
2007-06-03 11:32:03 +00:00
goldsimon
7abfe74fa4
Corrected bug #19937 : ICMP assumes p_buf has space for ethernet header. Allocating new pbuf if the input pbuf isn't big enough.
2007-06-03 10:48:23 +00:00
goldsimon
add68e0da1
Checked in patch #5914 : Moved sockopt processing into tcpip_thread.
2007-06-01 17:15:54 +00:00
fbernon
0a4130a4ff
Minor, fix files modified by last patch...
2007-05-23 19:49:55 +00:00
fbernon
a3fdc33f88
api_lib.c: Implement SO_RCVTIMEO for accept and recv on TCP connections, such present in patch #5959 .
2007-05-23 19:18:09 +00:00
fbernon
a330917ee8
api_lib.c, sockets.c: Fixed bug #5958 for netconn_listen (acceptmbox only allocated by do_listen if success) and netconn_accept errors handling. In most of api_lib functions, we replace some errors checkings like "if (conn==NULL)" by ASSERT, except for netconn_delete.
2007-05-23 18:43:30 +00:00
fbernon
0fe5dd8d43
api_lib.c: Fixed bug #5957 "Safe-thread problem inside netconn_recv" to return an error code if it's impossible to fetch a pbuf on a TCP connection (and not directly close the recvmbox).
2007-05-23 17:53:35 +00:00
fbernon
953d783a3e
api.h, api_lib.c, api_msg.c, sockets.c: group the different NETCONN_UDPxxx code in only one part...
2007-05-23 17:46:53 +00:00
fbernon
2ff620e1b5
sys.h, sys.c, api_lib.c, tcpip.c: remove sys_mbox_fetch_timeout() (was only used for LWIP_SO_RCVTIMEO option) and use sys_arch_mbox_fetch() instead of sys_mbox_fetch() in api files. Now, users SHOULD NOT use internal lwIP features like "sys_timeout" in their application threads.
2007-05-22 20:51:34 +00:00
goldsimon
0aaf69769f
Fixed bug #1895 (tcp_bind not correct) by introducing a list of bound but unconnected (and non-listening) tcp_pcbs.
2007-05-22 20:48:36 +00:00
fbernon
499f4689be
api.h, api_lib.c, api_msg.h, api_msg.c: change the struct api_msg_msg to see which parameters are used by which do_xxx function, and to avoid "misusing" parameters (patch #5938 ).
2007-05-22 09:54:00 +00:00
goldsimon
81ac03a28b
Included patch #5938 : changed raw_pcb.protocol from u16_t to u8_t since for IPv4 and IPv6, proto is only 8 bits wide. This affects the api, as there, the protocol was u16_t, too.
2007-05-22 07:31:06 +00:00
goldsimon
a4f4e6e71d
Addition to patch #5913 : decrease size of memp_memory.
...
Added option MEMP_OVERFLOW_CHECK to check for memp elements to overflow.
2007-05-18 19:48:44 +00:00
goldsimon
5c89228878
Fix bug #19729 : free pbuf if netif->input() returns != ERR_OK.
2007-05-16 19:54:54 +00:00
goldsimon
2740a81103
If a udp_pcb has a local_ip set, check if it is the same as the one of the netif used for sending to prevent sending from old addresses after a netif address gets changed (partly fixes bug #3168 ).
2007-05-16 18:55:25 +00:00
fbernon
0f8a2d6418
tcpip.c, igmp.h, igmp.c: Fixed bug " #19800 : IGMP: igmp_tick() will not work with NO_SYS=1". Note that igmp_init is always in tcpip_thread (and not in tcpip_init) because we have to be sure that network interfaces are already added (mac filter is updated only in igmp_init for the moment).
2007-05-16 14:12:52 +00:00
goldsimon
fd982597fe
Removed semaphores from memp, changed sys_sem_wait calls into sys_arch_sem_wait calls to prevent timers from running while waiting for the heap. This fixes bug #19167 .
2007-05-16 11:02:07 +00:00
goldsimon
62d705903e
task #6831 : removed the option PBUF_POOL_USES_MEMP and removed the old pbuf pool code, pbuf pool now always allocates from a memp pool
2007-05-13 18:17:22 +00:00
goldsimon
a5e2e9ea03
(see task #6831 ): Included new option PBUF_POOL_USES_MEMP to use a memp pool for PBUF_POOL pbufs instead of the old pool implementation in pbuf.c to remove redundant code.
2007-05-13 16:16:03 +00:00
goldsimon
efd3104fd0
Fixed bug from patch #5865 by moving the defines for socket options (lwip_set/-getsockopt) used with level IPPROTO_TCP from tcp.h to sockets.h.
2007-05-13 14:34:02 +00:00
fbernon
9cf1390dc6
sockets.c, api_lib.c, api_msg.h, api_msg.c, netifapi.h, netifapi.c, tcpip.c: Include a function pointer instead of a table index in the message to reduce footprint. Disable some part of lwip_send and lwip_sendto if some options are not set (LWIP_TCP, LWIP_UDP, LWIP_RAW).
2007-05-11 08:58:23 +00:00
goldsimon
84fc489e0c
Included patch #5448 : include '#ifdef __cplusplus \ extern "C" {' in all header files. Now you can write your application using the lwIP stack in C++ and simply #include the core files. Note I have left out the netif/ppp/*h header files for now, since I don't know which files are included by applications and which are for internal use only.
2007-05-10 10:59:20 +00:00
goldsimon
255d5a748f
Included patch #5920 : Create define to override C-library memcpy. 2 Defines are created: MEMCPY() for normal memcpy, SMEMCPY() for situations where some compilers might inline the copy and save a function call. Also replaced all calls to memcpy() with calls to (S)MEMCPY().
2007-05-10 05:20:05 +00:00
goldsimon
1571881f7a
If MEM_LIBC_MALLOC==1, allow the defines (e.g. mem_malloc() -> malloc()) to be overriden in case the C-library malloc implementation is not protected against concurrent access.
2007-05-08 11:00:49 +00:00
goldsimon
824ef1ff2c
Another attempt to fix bug #17922
2007-05-07 19:48:29 +00:00
goldsimon
79d9b36ece
Further update to ARP queueing: Changed pbuf_copy() implementation so that it can be reused (don't allocate the target pbuf inside pbuf_copy()).
2007-05-04 21:31:25 +00:00
goldsimon
be316e81a7
Introduced fast one-entry-cache to speed up ARP lookup when sending multiple packets to the same host.
2007-05-04 19:31:27 +00:00
goldsimon
7f232b43ff
checked in patch #5913 : in memp_malloc() we can return memp as mem to save a little RAM (next pointer of memp is not used while not in pool).
2007-05-04 15:52:11 +00:00
fbernon
5a12aeb4a1
sockets.c, api.h, api_lib.c, api_msg.h, api_msg.c: Fix bug #19162 "lwip_sento: a possible to corrupt remote addr/port connection state". Reduce problems "not enought memory" with netbuf (if we receive lot of datagrams). Improve lwip_sendto (only one exchange between sockets api and api_msg which run in tcpip_thread context). Add netconn_sento function. WARNING, if you directly access to "fromaddr" & "fromport" field from netbuf struct, these fields are now renamed "addr" & "port".
2007-05-04 15:18:29 +00:00
jifl
e895aa71a4
* sockets.c: Fix ioctl FIONREAD when some data remains from last recv.
...
(patch #3574 ).
2007-05-03 19:13:27 +00:00
goldsimon
02e194b15f
fix bug #2595 : "loopif results
...
in NULL reference for incoming TCP packets". Loopif has to be configured
(using LWIP_LOOPIF_MULTITHREADING) to directly call netif->input()
(multithreading environments, e.g. netif->input() = tcpip_input()) or
putting packets on a list that is fed to the stack by calling loopif_poll()
(single-thread / NO_SYS / polling environment where e.g.
netif->input() = ip_input).
2007-04-23 20:00:29 +00:00
jifl
eacac8ee1d
* sockets.h: FD_SETSIZE needs to match number of sockets, which is
...
MEMP_NUM_NETCONN in sockets.c right now.
2007-04-17 14:50:08 +00:00
jifl
cd19d81411
* pbuf.c: Use s32_t in pbuf_realloc(), as an s16_t can't reliably hold
...
the difference between two u16_t's.
2007-04-17 14:44:41 +00:00
jifl
748ba22a19
* icmp.c: Reset IP header TTL in ICMP ECHO responses (bug #19580 ).
2007-04-12 18:55:44 +00:00
goldsimon
e54f3fdaac
3rd fix for bug #11400 (arp-queuing): More pbufs than previously thought need to be copied (everything but PBUF_ROM!). Cleaned up pbuf.c: removed functions no needed any more (by etharp).
2007-04-11 18:50:45 +00:00
jifl
e8b055b8d3
Oops, forgot final version of Changelog for last change I made.
2007-04-11 16:20:07 +00:00
jifl
0c94f22ded
* sys.h, api_lib.c: Provide new sys_mbox_tryfetch function.
...
Require ports to provide new sys_arch_mbox_tryfetch function to get
a message if one is there, otherwise return with SYS_MBOX_EMPTY.
2007-04-11 15:41:03 +00:00
kieranm
05909d6fa7
Apply patch #5745 : Fix "Constant is long" warnings with 16bit
...
compilers. Contributed by avatar@mmlab.cse.yzu.edu.tw
2007-04-11 13:32:41 +00:00
fbernon
35893e36dd
opt.h, tcpip.h, tcpip.c, netifapi.h, netifapi.c: New configuration option LWIP_NETIF_API allow to use thread-safe functions to add/remove netif in list, and to start/stop dhcp clients, using new functions from netifapi.h. Disable as default (no port change to do).
2007-04-06 10:09:24 +00:00
fbernon
5f1aac1450
api_msg.c: Fix bug #16830 : "err_tcp() posts to connection mailbox when no pend on the mailbox is active". Now, the post is only done during a connect, and do_send, do_write and do_join_leave_group don't do anything if a previous error was signaled.
2007-04-05 16:54:20 +00:00
fbernon
7fdd312cca
sockets.c: remplace ENOBUFS errors on alloc_socket by ENFILE to be more BSD compliant.
2007-04-05 16:49:33 +00:00
goldsimon
f16911f7dd
comment to the last check-in was incomplete: Introduced #define LWIP_UNUSED_ARG(x) use this for and architecture-independent form to tell the compiler you intentionally are not using this variable. Can be overriden in cc.h.
2007-04-04 19:55:42 +00:00
goldsimon
f6bdd2cae4
Introduced #define LWIP_UNUSED_ARG(x) use this for and architecture-independent form to tell the compiler you intentionally are not using this variable. Can be overriden in cc.h.
2007-04-04 19:54:22 +00:00
fbernon
26e88dc2c1
Don't set the IP_DF ("Don't fragment") flag in the IP header in IP output packets. See patch #5834 .
2007-04-03 14:08:11 +00:00
fbernon
996d5fda69
ip.c: if IP_REASSEMBLY is set to 1, don't set the IP_DF ("Don't fragment") flag in the IP header in IP output packets.
2007-03-30 13:30:42 +00:00
fbernon
f1412f5e5a
api_msg.c: add a "pcb_new" helper function to avoid redundant code, and to add missing pcb allocations checking (in do_bind, and for each raw_new). Fix style.
2007-03-30 09:42:16 +00:00
fbernon
5368a760cf
most of files: prefix all debug.h define with "LWIP_" to avoid any conflict with others environment defines (these were too "generic").
2007-03-30 08:47:04 +00:00
fbernon
913a99dd35
api.h, api_lib.c, sockets.c: netbuf_ref doesn't check its internal pbuf_alloc call result and can cause a crash. lwip_send now check netbuf_ref result.
2007-03-28 17:26:06 +00:00
goldsimon
d956a39fec
sockets.c Remove "#include <errno.h>" from sockets.c to avoid multiple
...
definition of macros (in errno.h and lwip/arch.h) if LWIP_PROVIDE_ERRNO is
defined. This is the way it should have been already (looking at
doc/sys_arch.txt)
2007-03-28 14:49:04 +00:00
kieranm
01d9bd573e
2007-03-28 Kieran Mansley
...
* opt.h Change default PBUF_POOL_BUFSIZE (again) to accomodate default MSS +
IP and TCP headers *and* physical link headers
2007-03-28 12:27:38 +00:00
fbernon
c1fe7517ec
opt.h, netif.h, dhcp.h, dhcp.c: New configuration option LWIP_NETIF_HOSTNAME allow to define a hostname in netif struct (this is just a pointer, so, you can use a hardcoded string, point on one of your's ethernetif field, or alloc a string you will free yourself). It will be used by DHCP to register a client hostname, but can also be use when you call snmp_set_sysname.
2007-03-28 09:39:12 +00:00
fbernon
cd1c96db56
netif.h, netif.c: A new NETIF_FLAG_ETHARP flag is defined in netif.h, to allow to initialize a network interface's flag with. It tell this interface is an ethernet device, and we can use ARP with it to do a "gratuitous ARP" (RFC 3220 "IP Mobility Support for IPv4" section 4.6) when interface is "up" with netif_set_up().
2007-03-28 09:23:35 +00:00
fbernon
19338d2774
opt.h, tcpip.c: New configuration option LWIP_ARP allow to disable ARP init at build time if you only use PPP or SLIP. The default is enable. Note we don't have to call etharp_init in your port's initilization sequence if you use tcpip.c, because this call is done in tcpip_init function.
2007-03-26 16:13:46 +00:00
fbernon
005e5f2f72
api_lib.c (from Dmitry Potapov) : patch for netconn_write(), fixes a possible race condition which cause to send some garbage. It is not a definitive solution, but the patch does solve the problem for most cases.
2007-03-26 15:37:48 +00:00
fbernon
e54cd23ecb
stats.h, stats.c, msg_in.c: Stats counters can be change to u32_t if necessary with the new option LWIP_STATS_LARGE. If you need this option, define LWIP_STATS_LARGE to 1 in your lwipopts.h. More, unused counters are not defined in the stats structs, and not display by stats_display(). Note that some options (SYS_STATS and RAW_STATS) are defined but never used. Fix msg_in.c with the correct #if test for a stat display.
2007-03-22 16:36:45 +00:00