Simon Goldschmidt
0a0452b2c3
Prepare 2.2.0 release
2023-09-25 21:25:35 +02:00
Simon Goldschmidt
c0cf130bb7
Prepare changelog for 2.2.0 release
2023-09-22 10:02:18 +02:00
Simon Goldschmidt
3eeda139bc
minor coding style/spelling fixes
2023-09-22 09:54:36 +02:00
Simon Goldschmidt
b92faffaaa
LWIP_VLAN_PCP==1: initialize tci correctly (disabled); add pcb_tci_*() functions to access the tci
2023-09-22 09:53:13 +02:00
Simon Goldschmidt
84fde1ebbf
release: mark 2.2.0 RC1
...
Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de >
2023-06-29 22:22:19 +02:00
Simon Goldschmidt
2a3711a566
win32: check: adjust check config.h to run with newest check library on VS2022
...
Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de >
2023-06-29 22:14:36 +02:00
Simon Goldschmidt
1a5dffb931
win32: pcapif: ensure we can run with npcap as well
...
By default, npcap keeps its DLLs not in system32 but in system32/npcap.
To load DLLs from there, mark them as "delay load DLLs" and adjust the
DLL search path before using/loading them.
Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de >
2023-06-29 22:11:55 +02:00
Simon Goldschmidt
bfcbf80221
win32: msvc: fix msvc project files to compile with VS2022; add test_tcp_state
...
Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de >
2023-06-29 22:08:45 +02:00
Simon Goldschmidt
657c9735a7
doxygen: dhcp: fix doxygen stumbling over nonexisting define
2023-06-29 21:59:05 +02:00
Simon Goldschmidt
9672405eb9
test: unit: tcp: fix tcp state tests to not break other tests
...
On platform where check cannot fork (win32), the tcp_state tests crashed other tests.
Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de >
2023-06-29 21:32:20 +02:00
Shawn Silverman
e29870c15e
Fix a printf conversion specifier in mdns.c
...
Use U32_F to print a u32_t.
2023-05-11 22:16:49 +02:00
Shawn Silverman
f84076b112
Add missing terminating newlines to LWIP_DEBUGF statements
2023-05-11 22:13:51 +02:00
Jonathan Neuschäfer
c2f9244137
test/fuzz: Fix use of htons vs. ntohs
...
Although ntohs and htons perform equivalent operations (a byte swap on
little-endian platforms), their semantic roles (as implied by the names)
are different.
In fuzz_common.c, we get integers from simulated network packages, and
convert them for host CPU use, so ntohs is the right variant to use.
2023-05-11 22:10:32 +02:00
Jonathan Neuschäfer
5514d8eb63
test/fuzz: Build with -O2 by default
...
Fuzzers should run fast by default, since the goal is to try many
variations of input data.
2023-05-11 22:08:46 +02:00
Jonathan Neuschäfer
911da26f96
test/fuzz: Fix CC default value in makefile
...
Unfortunately, CC ?= afl-gcc doesn't work. This is because CC has a
default value (of "cc"), and the ?= operator only assigns a value if the
variable previously had none. "make" currently compiles with cc.
In this patch, I implemented the more elaborate way to achieve what was
probably intended: "make" will use afl-gcc now, and "make CC=foo" will
compile with "foo".
2023-05-11 22:08:40 +02:00
Mingjie Shen
2e3dcf06d1
api,sockets: Fix signed overflow check
...
Signed overflow is undefined behaviour in C/C++.
2023-05-11 21:28:22 +02:00
Mingjie Shen
e3a20b3bc2
mdns: Add null check for pbuf_skip
2023-05-11 21:26:22 +02:00
Jan Breuer
1c5cc7bc02
snmp_v3: fix reported usmUserAuthProtocol for SHA
2023-05-11 21:05:16 +02:00
David Cermak
3aa82745c1
dhcp: Add macro for appending extra client's request options
...
Co-Authored-By: Liu Han <liuhan@espressif.com >
Co-Authored-By: Simon Goldschmidt <goldsimon@gmx.de >
2023-05-11 21:03:11 +02:00
Logan Gunthorpe
90b2a6b4c4
dhcp: Set hostname for DISCOVER packets
...
If the hostname is not set in the DISCOVER packet, then some servers might
issue an OFFER with hostname configured and consequently reject the REQUEST
with any other hostname.
Signed-off-by: Logan Gunthorpe <logang@deltatee.com >
Co-Authored-By: Simon Goldschmidt <goldsimon@gmx.de >
2023-05-11 20:59:15 +02:00
xueyunfei
5231c8da23
dhcp: Enable custom config for timeouts, thresholds, backoff time
...
Enables to configure:
* DHCP_COARSE_TIMER_SECS
* if DHCP_DEFINE_CUSTOM_TIMEOUTS defined these addtional options are
available:
- DHCP_CALC_TIMEOUT_FROM_OFFERED_T0_LEASE to adjust the t0 lease timeout from the offered value
- DHCP_CALC_TIMEOUT_FROM_OFFERED_T1_RENEW same for t1 renew
- DHCP_CALC_TIMEOUT_FROM_OFFERED_T2_REBIND same for t2 rebind
- DHCP_NEXT_TIMEOUT_THRESHOLD to adjust the period of the next timeout
- DHCP_REQUEST_BACKOFF_SEQUENCE to adjust back-off times based on DHCP
request attempts
Also updates timeout type from u16 to u32 - eps useful when DHCP_COARSE_TIMER_SECS is a smaller number
2023-05-11 20:49:14 +02:00
David Cermak
00f5e179b5
dhcp: Move in-place timeout/threshold calculations to macros
2023-05-11 20:44:21 +02:00
Simon Goldschmidt
90c9a482a6
ci: fix compiling test_tcp_state.c; add to msvc project
2023-05-11 20:26:21 +02:00
David Cermak
724cc173ca
ci: Add the default example_app config to the build step
2023-05-10 22:20:07 +02:00
David Cermak
187e4ededd
contrib/addons: Add example of using DHCP extra options hooks
2023-05-10 22:16:57 +02:00
Chen Yu Dong
f50c87da6f
ci: Add unit test suite to validate tcp state transitions
2023-05-10 22:02:43 +02:00
David Cermak
a6874a46c6
contrib/ports: Add semaphore per thread option for unix
2023-05-10 21:49:34 +02:00
Simon Goldschmidt
3a9c1e48dd
altcp_tls_mbedtls: note which version of mbedtls we are compatible to
...
Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de >
2023-05-10 21:00:23 +02:00
Simon Goldschmidt
59ec032fa9
pppos: add new pppos unit test to vsproj
2023-05-10 20:59:36 +02:00
Simon Goldschmidt
64f75dbd89
pppos: fix compiling new pppos unit test
...
Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de >
2023-05-10 20:58:23 +02:00
Peter Putz
a9664395b0
pppos: fix in_tail null
...
happens during quick reconnect of LTE ppp session
2023-05-10 20:57:12 +02:00
David Cermak
6b734bbb2c
PPP: Add test exhibiting empty packet null-deref
...
Also updates lcp.c to compile with PPP_AUTH_SUPPORT=0 in clang
2023-05-10 20:42:27 +02:00
Jonathan Neuschäfer
d8d1e4a015
altcp: Fix NULL pointer dereference found by fuzzing
...
Reproducer (in bash):
base64 -d <<< "H4sIAP/9L2QCA+3WoQ2AMBSE4QoCTFHBBJfgSRF4RDfpRmgmYBpGQRBCk4ZiSfk/+fJMK+5dZRVpzSQzSs6oPierDV4y87WxLQLwE42SfNCdDyHJB9/xZwAARPbMJbUq4JJmu4JVT1cAAACfbGIqoqcMzy90eu+aBw2+N28WFgAA" | gunzip | test/fuzz/lwip_fuzz2
Crash log:
../../src/core/altcp_tcp.c:178:13: runtime error: member access within null pointer of type 'struct tcp_pcb'
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior ../../src/core/altcp_tcp.c:178:13 in
AddressSanitizer:DEADLYSIGNAL
=================================================================
==192415==ERROR: AddressSanitizer: SEGV on unknown address 0x000000000048 (pc 0x557065081703 bp 0x0aae0cb71204 sp 0x7ffd034dabc0 T0)
==192415==The signal is caused by a READ memory access.
==192415==Hint: address points to the zero page.
#0 0x557065081703 in altcp_tcp_setup_callbacks /.../lwip/test/fuzz/../../src/core/altcp_tcp.c:178:19
#1 0x55706508206f in altcp_tcp_setup /.../lwip/test/fuzz/../../src/core/altcp_tcp.c:189:3
#2 0x55706508206f in altcp_tcp_accept /.../lwip/test/fuzz/../../src/core/altcp_tcp.c:84:5
#3 0x557065095592 in tcp_input /.../lwip/test/fuzz/../../src/core/tcp_in.c:380:9
#4 0x5570650e752f in ip4_input /.../lwip/test/fuzz/../../src/core/ipv4/ip4.c:743:9
#5 0x55706513d4de in ethernet_input /.../lwip/test/fuzz/../../src/netif/ethernet.c:186:9
#6 0x557064fe0959 in input_pkt /.../lwip/test/fuzz/fuzz_common.c:209:9
#7 0x557064fdeb6a in input_pkts /.../lwip/test/fuzz/fuzz_common.c:257:9
#8 0x557064fdeb6a in lwip_fuzztest /.../lwip/test/fuzz/fuzz_common.c:669:3
#9 0x7ff4f578e189 in __libc_start_call_main csu/../sysdeps/nptl/libc_start_call_main.h:58:16
#10 0x7ff4f578e244 in __libc_start_main csu/../csu/libc-start.c:381:3
#11 0x557064f20420 in _start (/.../lwip/test/fuzz/lwip_fuzz2+0x81420) (BuildId: 8680a96430d5749c90111fe9c3a3d4f881a5dbcd)
AddressSanitizer can not provide additional info.
SUMMARY: AddressSanitizer: SEGV /.../lwip/test/fuzz/../../src/core/altcp_tcp.c:178:19 in altcp_tcp_setup_callbacks
==192415==ABORTING
Aborted
2023-04-07 22:32:18 +02:00
Jonathan Neuschäfer
95a63bc352
test/fuzz: Use HTTPS URLs and mention AFL++
2023-04-07 22:27:30 +02:00
Jonathan Neuschäfer
e8b0324f81
test/fuzz: Don't crash with assertion failure when a packet is too big
...
A fuzzer may generate big packets, and it will interpret assertion
failures as bugs. Instead of asserting that the packet size is
reasonable, simply skip the packet when it's not the case.
2023-04-07 22:25:50 +02:00
Renzo Davoli
0f2de1f684
contrib/ports/unix: add vdeif
2023-04-07 22:13:55 +02:00
Renzo Davoli
427b4f9b08
add posixlib
2023-04-07 22:11:27 +02:00
Renzo Davoli
6a350a0278
contrib/port/unix/lib: exclude slipif.c source
2023-04-07 22:07:17 +02:00
Simon Goldschmidt
3fe8d2fc43
get cmake to compile under windows with ms cl compiler
...
Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de >
2023-01-03 21:34:05 +01:00
Simon Goldschmidt
eaf4926239
UPGRADING: added a not about merging contrib
2022-12-22 22:07:16 +01:00
Simon Goldschmidt
e6341a6081
some documentation fixes after merging contrib and example apps
...
Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de >
2022-12-22 21:42:42 +01:00
Simon Goldschmidt
790b914fea
pbuf_copy_partial_pbuf: fix warning about assigning to smaller type when using '-=' operator
...
Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de >
2022-12-22 20:43:18 +01:00
Steven Wartik
4b7a54c06c
Added warning to cmake instructions when lwipcfg.h isn't present.
...
Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de >
2022-12-22 20:42:25 +01:00
yuanjm
239918ccc1
tcp: Make retransmission timeout (RTO) configurable
2022-05-09 21:24:57 +02:00
Erik Ekman
876517ea3e
gitignore: *.exe moved to top level
...
Requested on lwip-devel list
2022-05-09 21:13:38 +02:00
Jonathan Demeyer
234d282936
mqtt: Fix typos on 'incomming'
2022-05-09 21:10:34 +02:00
Giuseppe Modugno
52b4649636
Replace C++ comment with standard C comment to avoid error during building with -Werror.
2022-05-09 21:07:14 +02:00
Simon Goldschmidt
124dc0a64e
vscode: fix debugging on windows
2022-03-25 21:29:31 +01:00
Simon Goldschmidt
7807402899
cmake: fix building on windows with mingw64
...
- wpcap/packet libraries were wrong (.a, not .lib; not the x64 ones)
- link order resulted in undefined references
Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de >
2022-03-22 22:38:28 +01:00
Simon Goldschmidt
215dec653b
fix some compile problems with mingw
2022-02-12 09:40:32 +01:00
Simon Goldschmidt
a55679224f
fs: move prototypes required to implement custom files as fs addon to header
2022-02-12 09:40:32 +01:00
Florian La Roche
34e435c786
tapif: fix strncpy
...
Adjust the strncpy() call in tapif.c to how this is coded
in other strncpy() invocations. Also gcc warns about this.
See patch #10142
2021-12-30 22:58:52 +01:00
Florian La Roche
7c3aab2ea2
gcc warning for sign conversion
...
See patch #10143
2021-12-30 22:48:18 +01:00
Florian La Roche
62ac0faad8
redefine many vars as "static"
...
See patch #10156
2021-12-30 22:13:01 +01:00
Wouter van Gulik
5ab46f82f9
Fix failing fuzzer if compiling with ubsan
...
See patch #10163
Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de >
2021-12-30 22:04:23 +01:00
Simon Goldschmidt
7e96691ccf
ignore LwipMibCompiler output files
2021-12-22 21:39:27 +01:00
weycen
9f7d9170c1
netif: fix the netif's index error
...
When using multiple netifs on one hardware interface (e.g. when mapping multiple IP addresses to one hardware interface), if the netif's low-level receive routine cannot decide for the correct netif, here the `netif` parameter may be a default netif, in this case, `p-> if_idx` will get a wrong netif index value. It should be placed after `netif = LWIP_ARP_FILTER_NETIF_FN(p, netif, lwip_htons(type));`. Filter function can returns the correct netif before assigning `p-> if_idx`.
2021-12-07 00:57:48 +01:00
0x1abin
63d21c53e5
altcp mbedtls: Compile error fix.
2021-12-07 00:47:05 +01:00
Erik Ekman
562431b034
Update gitattributes after travis removal
2021-11-28 20:56:37 +01:00
Erik Ekman
ff28f73fa0
README: Update CI link
2021-11-27 21:09:06 +01:00
Erik Ekman
853258fff0
Switch from travis to github actions for CI
...
travis.org is no longer active
2021-11-27 20:48:02 +01:00
Erik Ekman
7c84799c4f
doxygen: Remove obsolete config
...
warning: Tag 'PERL_PATH' at line 2212 of file '/home/runner/work/lwip/lwip/doc/doxygen/lwip.Doxyfile' has become obsolete.
To avoid this warning please remove this line from your configuration file or upgrade it using "doxygen -u"
warning: Tag 'MSCGEN_PATH' at line 2234 of file '/home/runner/work/lwip/lwip/doc/doxygen/lwip.Doxyfile' has become obsolete.
To avoid this warning please remove this line from your configuration file or upgrade it using "doxygen -u"
2021-11-27 20:40:54 +01:00
Erik Ekman
17413c28b4
httpd: Add documentation for http_set_cgi_handlers
2021-11-27 20:36:27 +01:00
Erik Ekman
5b9159ce0d
api: Adapt doc comment to varying parameters
2021-11-27 20:32:59 +01:00
Erik Ekman
754d628f2d
ip_addr: Add description for IP_ANY_TYPE
2021-11-27 20:32:59 +01:00
Erik Ekman
b0361f14c1
netif: Add documentation for mac filter macros
2021-11-27 20:17:30 +01:00
Erik Ekman
2711dbcac0
lwiperf: Complete documentation of lwiperf_report_fn
...
Doxygen did not like only annotating one parameter.
2021-11-27 20:17:30 +01:00
Erik Ekman
e594742801
altcp: Add doxygen comment for altcp_allocator_t
2021-11-27 20:17:30 +01:00
Erik Ekman
759c38b956
ip_addr: Add text descriptions for ip addr macros
...
Doxygen seems to ignore them otherwise.
2021-11-27 20:17:30 +01:00
Florian La Roche
089697bb1c
Use NULL instead of 0 as a pointer
...
Recommended by 'sparse' tool
2021-11-27 15:49:20 +01:00
Erik Ekman
f3300731be
example_app: Minor tweaks
...
- Make variables static
- Fix spelling
- Use NULL instead of 0 as a pointer
2021-11-26 22:41:06 +01:00
quanjia
553fedd443
ping: sizeof to struct not pointer
2021-11-25 00:14:59 +01:00
Florian La Roche
53c09fe921
tcp_out: move debug output to after checking pcb
2021-11-24 23:17:16 +01:00
Florian La Roche
3636b3e2d1
iteropts.sh: Fix warning on first run
...
Running iteropts.sh there is a warning on the first
cycle that lwipopts_test.h cannot be removed.
2021-11-24 23:04:57 +01:00
Florian La Roche
fdcfb9bdce
contrib/ports: check library has moved to github
2021-11-24 22:52:18 +01:00
Bas Prins
a44fcb2e2e
http_client: reset timeout when receiving data
...
This fixes downloads longer than 15 seconds.
See bug #60787 (http_client does not reset timeout counter)
Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de >
2021-11-12 23:11:22 +01:00
Simon Goldschmidt
a72fc743ef
update tinydir.h to newest version
...
Update to cxong/tinydir commit 97a6032ddb ("Fix tinydir_file_open for root or subfolder of root in Linux.")
This should fix bug #61106 (compiling newest source fails with "-O3" optims)
2021-11-12 22:56:56 +01:00
Tom Collins
601e1bb326
altcp mbedtls: fix error in preprocessor logic setting ALTCP_MBEDTLS_PLATFORM_ALLOC
...
Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de >
2021-11-12 22:31:04 +01:00
Simon Goldschmidt
12506cda7d
doc/FILES: remove outdated entries
2021-11-10 21:14:02 +01:00
Florian La Roche
e8741da9d2
contrib/ports: Remove redundant -Wredundant-decls
2021-10-03 12:45:51 +02:00
Simon Goldschmidt
39a9c5a3c5
netif: fix removing ext-callback while callback is called
...
When a registered netif ext-callback unregisters itself when being
called (e.g. because some state is reached by this event), the invoke
iteration might access uninitialized memory or at least stop the
iteration (because next is set to null).
Fix his by caching the next pointer during iteration before calling
callbacks.
Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de >
2021-10-01 19:44:07 +02:00
Jannis Achstetter
7ec4e9be30
makefsdata: Support using the system's zlib instead of only minizip for deflate compression and note so in the readme
...
Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de >
2021-05-21 22:32:37 +02:00
Simon Goldschmidt
bb5ee3783a
fix compiling/running tests on win32
...
- new files
- different warning settings
- all tests run in a single process (no fork)
2021-05-21 22:00:49 +02:00
Simon Goldschmidt
a8e8ce4108
dhcp: don't set a default gateway if dhcp server doesn't give one
...
see bug #60578
2021-05-14 10:32:57 +02:00
Axel Lin
919dc2019a
acd: Fix updating prev pointer in acd_remove
...
Fixes: 3a788b6e8b ("dhcp: remove acd handle when stopping dhcp")
Signed-off-by: Axel Lin <axel.lin@ingics.com >
2021-05-14 13:48:43 +08:00
Eric Koldeweij
b538bff383
ip6: Fix crash in ip6_output with debug enabled
...
It turns out the crash only occurs if LWIP_DEBUG is enabled. If the
parameter dest is NULL the function tries to find a route using the
destination address of the packet instead. If this fails as well a
debug message is printed but it is still using dest causing a NULL
pointer dereference and crash at src/core/ipv6/ip6.c line 1312.
[erik@kryo.se: Apply fix to ip6_output_hinted as well]
2021-05-13 13:40:33 +02:00
Erik Ekman
b9056e148e
acd: Fix LWIP_ASSERT argument order
2021-05-13 13:28:02 +02:00
Simon Goldschmidt
3a788b6e8b
dhcp: remove acd handle when stopping dhcp
...
see bug #57706
2021-05-12 21:05:17 +02:00
Simon Goldschmidt
fa5ca55c9d
pbuf_realloc: check that mem_trim does not move the memory
...
Our own implementation does not do this, but overridden implementations
calling 'realloc()' might invalidly do this
2021-05-12 21:05:17 +02:00
Erik Ekman
b0e347158d
dhcp: Add missing newline to debug message
2021-03-25 20:56:21 +01:00
Simon Goldschmidt
0056522cc9
netdb: improve documentation of LWIP_DNS_API_HOSTENT_STORAGE
2021-03-05 13:04:59 +01:00
Simon Goldschmidt
8a900aa81f
netdb: fix alignment warning in debug output
...
see bug #58650
2021-03-05 13:04:18 +01:00
Simon Goldschmidt
3ff267fbed
dhcp: prevent dhcp_cleanup passing external data to heap
2021-03-04 22:20:17 +01:00
Simon Goldschmidt
c7e1b35899
dhcp: convert 'subnet_mask_given' to 'flags'
...
Don't waste 7 bits (in preparation for more flags)
2021-03-04 22:16:19 +01:00
Simon Goldschmidt
18b1178e0c
makefsdata: add version info
...
This is required to make it possible to see you're using an old version if something doesn't work...
See task #15331
2021-03-04 21:51:06 +01:00
Simon Goldschmidt
f924c43621
doc: add description to get a release tgz from git
2021-03-04 21:46:58 +01:00
Harrold Spier
79c8a04152
SNMP netconn API should not check for core locked
...
See patch #9907
2021-03-04 21:29:20 +01:00
Hu Keping
ccea55370a
Remove unnecessary files in release tarball
...
This patch adds a few entries in .gitattributes to specify files that
should never end up in a distribution tarball.
Signed-off-by: Hu Keping <hukeping@huawei.com >
2021-03-04 21:22:20 +01:00
Jeremy HU
4a169109a7
makefsdata: Fix flags missing
...
Fix the Perl script from which the generated fsdata.c cause runtime assertion: "HTTP headers not included in file system".
2021-03-04 21:16:48 +01:00
Oliver Hitz
b5176936c7
tcp: make tcp_listen() inherit the netbuf_idx of the original pcb
...
This simple patch causes tcp_listen() to inherit the netbuf_idx setting
of the original pcb. Without this, it is not possible to restrict a
socket to a specific interface using SO_BINDTODEVICE before listening.
Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de >
2021-03-04 21:15:25 +01:00
Simon Goldschmidt
3666dcc66c
tcp: send RST to input netif when no pcb is available
...
If we know there's no matchin pcb (e.g. for routing), don't even
try to pass NULL but instead send the RST to the input netif.
See also patch #9988 .
2021-03-04 21:10:28 +01:00
Simon Goldschmidt
1f4a029d10
mqtt: check data_cb != NULL
2021-03-04 20:18:04 +01:00
Simon Goldschmidt
d7a0757764
mqtt: allow calling mqtt_set_inpub_callback before mqtt_client_connect
...
See also patch #10037
2021-03-04 20:14:46 +01:00
Christoffer Lind
600e248f06
dhcp: generate new xid for DHCP release
2021-03-02 22:49:57 +01:00
Erik Ekman
988ce1e80e
netif: Add test for netif_find
2021-02-27 12:28:14 +01:00
Erik Ekman
e02d126b07
lowpan6: Use arch-independent printf formatters
2021-02-13 21:14:29 +01:00
Erik Ekman
74231d6873
netif: Add test for netif_is_flag_set()
2021-02-08 19:29:33 +01:00
Thomas Mueller
7a2923020f
Fix typo in definition of netif_is_flag_set() macro
2021-02-08 19:17:20 +01:00
Simon Goldschmidt
12b45506dd
fs_example: fix comment in fs_wait_read_custom
...
See bug #59866
2021-01-30 22:13:29 +01:00
Simon Goldschmidt
9aae444f49
pbuf_free: remove outdated comment about packet queues
...
See bug #59875
2021-01-30 22:08:36 +01:00
Simon Goldschmidt
3e098f90df
pbuf: fix allocating large PBUF_RAM
...
See bug #59974
2021-01-30 22:06:46 +01:00
Mike Kleshov
6fee08daab
httpd: revert part of previous change
...
pextension needs to be zeroed in case fs_file structure
is reused in a persistent HTTP connection
2021-01-29 08:02:56 +03:00
yuanjm
b00a05d086
lwip_selscan: lwip_selscan return -1 without setting errno number
...
Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de >
2021-01-28 21:00:37 +01:00
Simon Goldschmidt
fc5b6f7b0e
lwiperf: fix double-free of pcb on error
...
See bug #59841 (PCB double-free happened at lwiperf TCP error)
Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de >
2021-01-28 20:00:11 +01:00
Mike Kleshov
9b040624c0
httpd: follow-up to previous commit
...
see bug #59876
2021-01-28 19:53:57 +03:00
Mike Kleshov
69725292a0
httpd: wrap fs_file::pextension in a config macro
...
see bug #59876
2021-01-28 08:29:25 +03:00
Mike Kleshov
89dca4588f
httpd: follow-up to previous commit, replace strstr() with memcmp()
2021-01-27 19:28:19 +03:00
Mike Kleshov
fdd702e61b
httpd: fix bug #58223
2021-01-26 19:19:32 +03:00
Mike Kleshov
1678b21a94
httpd: remove fs_file::is_custom_file, use fs_file::flags instead
2021-01-25 21:49:17 +03:00
Jacob Berg Potter
f7ff2d416c
ports/freertos: add missing include of tcpip.h
...
To fix build (lock_tcpip_core is not defined otherwise)
2021-01-23 13:41:34 +01:00
Erik Ekman
651d0af0b6
netdb: Accept '0' as service in lwip_getaddrinfo
...
Fixes bug #59925
2021-01-22 20:20:51 +01:00
Erik Ekman
c825eb3604
tcp: Check tcp_output return values in tests
...
Found with clang-analyzer
2021-01-19 20:19:02 +01:00
Erik Ekman
21fba21054
test/unit: Update convenience makefile
...
Allow cleaning - useful when switching compiler between GCC/clang.
2021-01-19 20:19:02 +01:00
Erik Ekman
b5618c51ca
altcp: Fix memory leak in altcp_tls_free_config
...
Reported in bug #59032 by Ondrej Lufinka,
fix suggested by David GIRAULT.
2021-01-13 22:19:47 +01:00
Erik Ekman
ecab77654a
ports/unix/check: Ignore error from fail_* macros
...
Usage of fail_if/fail_unless macros with a message results in a
warning with the latest version of check (0.15.2+) and GCC.
Ignore this specific error (since warnings are treated as errors) for now.
Example failure:
In file included from ../../../../src/../test/unit/lwip_check.h:7,
from ../../../../src/../test/unit/lwip_unittests.c:1:
../../../../src/../test/unit/lwip_unittests.c: In function ‘lwip_check_ensure_no_alloc’:
../../../../src/../test/unit/lwip_unittests.c:55:7: error: too many arguments for format [-Werror=format-extra-args]
55 | "mem heap still has %d bytes allocated", lwip_stats.mem.used);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2021-01-13 21:48:03 +01:00
Erik Ekman
7b77378ed8
test/unit: Fix compilation of ip4 test
...
../../../../src/../test/unit/ip4/test_ip4.c: In function ‘test_ip4_icmp_replylen_short’:
../../../../src/../test/unit/ip4/test_ip4.c:291:35: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare]
fail_unless(linkoutput_byte_ctr == icmp_len + sizeof(unknown_proto));
Plus minor cleanup in second icmp reply test
2021-01-13 21:31:19 +01:00
Erik Ekman
d0c214feff
test/unit: Add convenience Makefile
...
To allow running them easily on *nix without changing directory.
2021-01-13 20:57:23 +01:00
Erik Ekman
35550eeab3
icmp: Fix copied length in response packets
...
Fixes bug #59364 , reported by Yi Guai
2021-01-13 20:31:55 +01:00
Mike Kleshov
c6777547f6
Make sure tag insertion is complete when tag is followed by EOF.
...
See bug #59728 .
Signed-off-by: Mike Kleshov <m.kleshov@gmail.com >
2021-01-01 11:26:30 +03:00
Erik Ekman
2d0c49adca
Clean up COPYING
...
No need to have comment block.
2020-12-05 09:48:51 +01:00
Erik Ekman
d6a37b1ad6
fuzz: Improve Makefile
...
Similar to recent change to ports/unix/check:
- Split depfile into three different files
- Fix make dep
- Skip depfile generation for 'make clean'
2020-12-04 10:51:11 +01:00
Erik Ekman
45332ab38c
ports/unix/check: Fix 'make dep'
...
It used to fail with this error after building the depfiles:
clang -DLWIP_NOASSERT_ON_ERROR -I/usr/include/check -I../../../../src/../test/unit -Wno-gnu-zero-variadic-macro-arguments -g -DLWIP_DEBUG -Wall -pedantic -Werror -Wparentheses -Wsequence-point -Wswitch-default -Wextra -Wundef -Wshadow -Wpointer-arith -Wcast-qual -Wc++-compat -Wwrite-strings -Wold-style-definition -Wcast-align -Wmissing-prototypes -Wredundant-decls -Wnested-externs -Wunreachable-code -Wuninitialized -Wmissing-prototypes -Wredundant-decls -Waggregate-return -Wlogical-not-parentheses -fsanitize=address -fsanitize=undefined -fno-sanitize=alignment -Wdocumentation -Wno-documentation-deprecated-sync -I. -I../../.. -I../../../../src/include -I../../../ports/unix/port/include -c
clang-11: error: no input files
Also don't include depfiles while cleaning, to avoid generating them
just to remove them.
2020-12-03 21:55:45 +01:00
Erik Ekman
63fb3721ef
ports/unix/check: Split depfiles for faster build
...
Having just one depfile (.depend) means it has to be fully regenerated
on every change, and it can't be done in parallel.
After this change the rebuild time after touching a single test file has
gone from 5.0 to 0.9 seconds. (make -j12)
Build of tests from clean has gone from 8.1 to 5.5s.
We could go even further and have one depfile per c-file, but this felt
like a simple first step giving a nice improvement.
2020-12-03 21:41:31 +01:00
Erik Ekman
c748395bda
PPP: Change data argument in sio_write to const
...
To fix the build after ppp_output_cb started taking it as const in
commit b2d1fc119d .
Fixes this failure:
../contrib/examples/ppp/pppos_example.c: In function ‘ppp_output_cb’:
../contrib/examples/ppp/pppos_example.c:163:29: error: cast discards ‘const’ qualifier from pointer target type [-Werror=cast-qual]
return sio_write(ppp_sio, (u8_t*)data, len);
^
2020-12-03 09:47:00 +01:00
Sylvain Rochet
d1fc5c2ec4
PPP: add one more timer to PPP_NUM_TIMEOUTS_PER_PCB for late authentication
...
Authentication timer might still be running when entering network phase
for any necessary rechallenge, mostly for PPP server support.
Update the detailed analysis of simultaneously running PPP timers
taking into account the authentication timer that might still be
running and chose to increase the base number to 2 instead of
adding more unnecessary complexity.
2020-11-17 01:19:21 +01:00
Sylvain Rochet
9a9d92a59e
PPP, PAP: cancel PAP timeout when authentication succeed or fail
...
upap_timeout is not currently stopped on authentication success or
fail events. This may have strange results if session is restarted
in a high pace because even if the timeout callback have a sanity
check against the PAP state the session can be restarted and be
back in the valid state before the timeout callback is actually
called.
2020-11-17 00:50:50 +01:00
Sylvain Rochet
3013e1fc19
PPP: remove unused ppp_pcb CHAP fields if server mode is disabled
...
pcb->settings.chap_timeout_time and pcb->settings.chap_max_transmits
are only used if server mode is enabled.
2020-11-17 00:26:32 +01:00
Sylvain Rochet
a4514cf416
PPP: fix unused parameter warning on prot_flavor if CHAP support is disabled
...
prot_flavor parameter is only used if CHAP support is enabled.
2020-11-16 22:26:00 +01:00
Sylvain Rochet
332119d7e0
PPP, magic: dot not assume LWIP_RAND will return 32 bits of randomness
...
Do not assume LWIP_RAND will return 32 bits of randomness because it is
probably going to be defined to directly return the rand() value. For
example, LCP magic numbers are 32-bit random values.
2020-10-27 21:52:18 +01:00
Sylvain Rochet
e239222775
PPP, magic: cleanup code and documentation
...
Documentation and simple code cleanup, no behavior change.
2020-10-27 21:47:26 +01:00
Sylvain Rochet
72d9132ecf
PPP, PPPoL2TP: skip address & flags for PPP control packets
...
This is already what we inherently have always done for IPv4/IPv6
packets, so it works. Receivers must handle both cases anyway because
both behaviors are seen in the wild.
2020-10-23 17:34:25 +02:00
Sylvain Rochet
a494b990da
PPP, PPPoS: drop in flight packets from the tcpip mailbox if PPP session is down
...
A previous call to ppp_input might have disconnected the session while
there were still packets in flight in the tcpip mailbox. Drop incoming
packets because ppp_input must never be called if the upper layer is
down.
2020-10-22 23:03:56 +02:00
Sylvain Rochet
a9f19cd7f1
PPP, PPPoS: only check open flag after events that may have changed it
...
Speed-up a little bit the PPPoS input parser by only checking the open
flag after calling the ppp_input function, the only one that can induce
a state change here.
2020-10-22 20:56:23 +02:00
Sylvain Rochet
22f13c24aa
PPP: assert if ppp_set_* functions are called when session is not dead
...
ppp_set_* functions that set the PPP session parameters must only be
called when the session is in a dead state (i.e. disconnected),
otherwise not fatal but surprising results may happen.
2020-10-21 02:11:59 +02:00
Sylvain Rochet
dbb7c00aa5
PPP: add LWIP_ASSERT_CORE_LOCKED to ppp_set_notify_phase_callback
...
This function call the notify phase callback that should be called from
the lwIP core thread. This is especially true if the user callback
is not designed to be reentrant.
2020-10-21 01:43:57 +02:00
Freddie Chopin
c18a8dc9cc
PPP, PPPoS: Remove useless cast from pppos_output_append() and pppos_output_last()
...
pppos_output_cb_fn() now takes `const void*`, so there is no need to
cast the payload (`void*`) to anything else.
2020-10-20 05:38:05 +02:00
Freddie Chopin
b2d1fc119d
PPP, PPPoS: Use const void* instead of u8_t* in pppos_output_cb_fn()
...
There is no good reason why this function should take a non-const
pointer, as the output callback should never modify what lwIP gives it.
While changing that also switch to a more generic `void*` instead of
"byte".
2020-10-20 05:38:03 +02:00
Freddie Chopin
7f91a71eca
Contrib, PPP: Remove trailing whitespaces in pppos_example.c
2020-10-20 05:30:59 +02:00
Freddie Chopin
34156e0594
PPP, PPPoS: Remove useless cast from pppos_input_sys()
...
pppos_input() now takes `const void*`, so there is no need to cast the
payload (`void*`) to anything else.
2020-10-20 05:30:21 +02:00
Freddie Chopin
5ad2f06333
PPP, PPPoS: Use const void* instead of u8_t* in pppos_input()
...
There is no good reason why this function should take a non-const
pointer. While changing that also switch to a more generic `void*`
instead of "byte".
2020-10-20 05:30:17 +02:00
Freddie Chopin
c5021bdc4d
PPP, PPPoS: Use const void* instead of u8_t* in pppos_input_tcpip()
...
There is no good reason why this function should take a non-const
pointer. While changing that also switch to a more generic `void*`
instead of "byte".
2020-10-20 05:30:12 +02:00
Sylvain Rochet
3b57750715
PPP: remove LWIP_ASSERT_CORE_LOCKED on ppp_set_auth function
...
We do not have equivalents in PPPAPI for ppp_set_* functions because
calling them only makes sense while session is disconnected, furthermore
they are only setting structure members of the session configuration.
2020-10-20 04:15:25 +02:00
Sylvain Rochet
9b7cba9643
PPP: don't define PPP_IP if PPP_IPV4_SUPPORT is disabled
...
Doing so helps a lot at finding places where we have leftovers of IPv4
support when the support is disabled.
2020-10-20 03:59:34 +02:00
Sylvain Rochet
6584002826
PPP, PPPoS: only reserve header space for IPv4 and IPv6 packets if IP forwarding is enabled
...
We only have to reserve header space for forwarding for IPv4 and IPv6
packets, all other packets are PPP control packets. Doing so reduce
the need of having to coalesce the PBUF chain before PPP processes
control packets.
2020-10-20 03:53:07 +02:00
Sylvain Rochet
e801307738
PPP: set mtu6 too when setting PPP netif MTU
...
PPP peer can negotiate its MRU, therefore we don't know the MTU we are
going to use before starting PPP. This is an issue because netif_add
function assume that the netif init callback function will set the MTU,
netif_add will then copy mtu to mtu6. We have then to update mtu6 each
time we update mtu to keep them in sync. Doing so is fine because PPP
netif MTU is only updated when the netif is in link down state.
2020-10-20 02:53:46 +02:00
Sylvain Rochet
a39ce0f53b
PPP, PPPoS: drop input packets much bigger than our MRU
...
Our current HDLC decoder does not protect against starving the Rx
PBUF POOL for one packet, most likely due to received garbage on
the serial port.
Prevent starving the Rx pool by checking incoming packets length
against PPP_MRU with a 10% margin because we only want to avoid
filling all PBUFs with garbage, we don't have to be pedantic.
Fixes bug #58441 : Invalid PPP data accumulates forever.
2020-10-20 02:18:48 +02:00
Sylvain Rochet
51c6548631
PPP: allow negotiating MRU with PPP_MRU config option
...
PPP_MRU is now free to be used for what it should have been. Now using
it at PPP init stage to set the wanted MRU value, triggering a MRU
negotiation at the LCP phase.
I doubt anyone needs it anyway, but, well, at least it is fixed and the
MRU/MTU config mess is cleaned.
And while we are at it, better document PPP MRU config values.
2020-10-19 00:53:11 +02:00
Sylvain Rochet
90874392e3
PPP: force default MRU to 1500
...
RFC1661 mandates that default MRU value, that must be used prior
negotiation of MRU value and if MRU value is not negotiated later, must
be 1500.
That is, any PPP host must accept control frames of at least 1500 when
the PPP session start (there are no way to split them in multiples
frames anyway) and must use a value of 1500 if MRU is no negotiated
during LCP exchanges.
Therefore, having it configurable in ppp_opts is a mistake. It was wrong
and never worked because changing the value never triggered a MRU value
negotiation because it changed both the wanted MRU value and the RFC
default value to which the wanted value is compared to trigger a MRU
negotiation if values are not equal.
2020-10-18 23:54:48 +02:00
Sylvain Rochet
b8640678d6
PPP, LCP: merge PPP_MRU into PPP_DEFMRU
...
This is actually the same thing, both values are used interchangeably in
various places but their value must be the same.
2020-10-18 22:36:53 +02:00
Sylvain Rochet
331fe2dea2
PPP: rename netif_set/get_mtu to ppp_netif_set/get_mtu
...
Those are private functions, using the netif_ prefix here is not really
nice, especially with functions named netif_set_mtu and netif_get_mtu
for obvious reasons.
2020-10-18 22:11:18 +02:00
Sylvain Rochet
7633c24213
PPP, PPPoE, PPPoL2TP: remove persistent retries if sending packets fails
...
We currently retry indefinitely if sending packets fails, for example
if the output interface is down. We are even doing it if we are in
a middle of a connection process. This is not a very nice behavior
because PPP low level will retry indefinitely to connect and the user
application will never be warned that something is wrong.
We have the persist boolean in PPP settings to achieve more or less
the same thing anyway. Except it does it better at only retrying
indefinitely the initiation packet.
2020-10-18 17:10:13 +02:00
Sylvain Rochet
39cb84466d
PPP: remove PPP_USE_PBUF_RAM configuration option
...
Having it configurable does not really make sense anymore, we already
need PBUF_RAM in all transmit paths. There are no real reason to keep
allocating PPP response buffers from the PBUF_POOL which should be now
reserved for receive paths only.
2020-10-18 16:44:23 +02:00
Sylvain Rochet
012fadd77f
PPP: enable PPP_USE_PBUF_RAM by default
...
We need PBUF_RAM for quite a while for PPP, e.g. through pbuf_coalesce
and for all PPP transmit paths. There are no real reason to keep
allocating packets from PBUF_POOL for PPP control packets transmit path
by default today.
2020-10-18 02:34:43 +02:00
Sylvain Rochet
6b30cf62cc
PPP, PPPoL2TP: fix displayed length in debug message
...
Packet length is p->tot_len here, not len.
2020-10-18 02:29:42 +02:00
Sylvain Rochet
5bf9cebb54
PPP: check that pbuf_coalesce succeed
...
When pbuf_coalesce fails it does nothing and returns the previous buffer
chain. Adds checks that pbuf_coalesce succeeded, otherwise drop incoming
packet.
2020-10-18 02:18:50 +02:00
Sylvain Rochet
7c0c3879b2
PPP, PPPoS: use PBUF_RAM in transmit pathway
...
Allocate Tx chunk in PBUF_RAM, using PBUF_POOL_BUFSIZE as a great
chosen value for chunk size.
2020-10-18 01:44:09 +02:00
Sylvain Rochet
3779cf7856
PPP, PPPoS: wait for next packet when we drop a packet before it is complete
...
If we fail to receive a full packet, for exemple if a memory allocation
fail for some reason, we currently do not wait for next packet flag
character and we start filling a new packet at next received byte. Then
we expect the checksum check to discard the packet.
The behavior seem to have been broken one or two decades ago when adding
support for PFC (Protocol-Field-Compression) and ACFC
(Address-and-Control-Field-Compression).
Rework to drop any character until we receive a flag character at init
and when we drop a packet before it is complete.
2020-10-17 20:09:35 +02:00
Sylvain Rochet
88ac7460f0
PPP: cleanup
...
Code cleaning only (misleading indents or comments, etc.), no behavior
change.
2020-10-17 17:53:04 +02:00
Sylvain Rochet
bedb4e4745
PPP: disable VJ support by default
...
VJ support is known to be broken when built with some compiler
optimizations enabled, disabling it by default until someone needs it
and fixes it.
It was mostly used with dial-up modems, it is useless with PPPoE and
PPPoL2TP and is probably useless as well with cellular modems, so
disabling it by default makes sense anyway.
2020-10-17 01:19:35 +02:00
Sylvain Rochet
729b3da96d
PPP: remove casts from unsigned (strlen return value) to signed when checking auth
...
In theory, if provided username or password is over 0x80000000 byte long
(err...), casts to signed integer of strlen() return values is going to
return negative values breaking lengths checks.
Fix it by only using unsigned integer or size_t (guaranteed to be
unsigned) comparisons.
2020-10-16 21:16:05 +02:00
Sylvain Rochet
49bbc2d4bf
PPP, PPPoE: prevent integer overflows when computing packets length
...
Check that service_name and concentrator_name strings length will not
trigger integer overflows when computing packets length.
2020-10-16 19:27:46 +02:00
Sylvain Rochet
678a7a4044
PPP, PPPoE: remove casts from unsigned (strlen return value) to signed
...
Those casts do not serve any purpose and can be safely removed.
2020-10-16 17:17:40 +02:00
Erik Ekman
c385f31076
Remove @ref to fix doxygen build
...
Generating docs for file src/incl/home/travis/build/lwip-tcpip/lwip/src/include/lwip/ip4_addr.h:151:s
error: unable to resolve reference to `ip4_addr_eq' for \ref command (warning treated as error, aborting now)
2020-07-07 18:59:50 +02:00
Erik Ekman
264a5a3e97
Rename IP and Ethernet equality checkers from _cmp to _eq
...
Functions ending in cmp are expected to return 0 on equality but these
return non-zero.
eth_addr_cmp -> eth_addr_eq
ip_addr_cmp -> ip_addr_eq
ip4_addr_cmp -> ip4_addr_eq
ip6_addr_cmp -> ip6_addr_eq
ip_addr_netcmp -> ip_addr_net_eq
ip4_addr_netcmp -> ip4_addr_net_eq
ip6_addr_netcmp -> ip6_addr_net_eq
ip_addr_cmp_zoneless -> ip_addr_zoneless_eq
ip6_addr_cmp_zoneless -> ip6_addr_zoneless_eq
ip6_addr_cmp_zone -> ip6_addr_zone_eq
ip6_addr_netcmp_zoneless -> ip6_addr_net_zoneless_eq
ip6_addr_nethostcmp -> ip6_addr_nethost_eq
ip6_addr_cmp_packed -> ip6_addr_packed_eq
ip6_addr_cmp_solicitednode -> ip6_addr_solicitednode_eq
All call sites have been changed, and fallback macros have been added to not
break external users.
2020-07-07 18:51:45 +02:00
Erik Ekman
047f3b3306
dns: Verify setting/getting servers in unit test
2020-07-04 18:57:41 +02:00
Erik Ekman
5b7524e10e
unit: Enable DNS
...
Avoid allocating in dns_init by enabling random source port.
2020-07-04 14:24:40 +02:00
Erik Ekman
8363c24e45
zepif: Copy possibly chained output pbuf properly
...
Fixes bug #58554
2020-07-03 18:55:08 +02:00
Erik Ekman
2bf8fcd7c2
pbuf: Add pbuf_copy_partial_pbuf library function
...
Like pbuf_copy, but can copy part of a pbuf to an offset in another.
pbuf_copy now uses this function internally.
Replace pbuf_take_at loop in icmp6 with pbuf_copy_partial_pbuf().
2020-07-03 18:55:02 +02:00
Erik Ekman
942ca825d0
ip4: Fix missing END_TEST in ip4 test case
2020-07-01 21:09:49 +02:00
Erik Ekman
776e612872
Remove extra newlines in LWIP_ASSERT messages
2020-07-01 20:52:12 +02:00
Erik Ekman
ec5f3a1563
ip6: Add ipv6 fragmentation test
...
Seems to work the same as ipv4, and that I was just confused by all the
loops when reading the code.
2020-07-01 20:17:29 +02:00
Erik Ekman
0bda621d3d
ip4: Verify ipv4 fragmentation sends all chunks right away
...
Ahead of investigation how ipv6 code behaves.
2020-07-01 20:16:24 +02:00
Erik Ekman
2faa2d7009
ip6: Rename pbuf in unit test
...
../../../../src/../test/unit/ip6/test_ip6.c: In function ‘test_ip6_dest_unreachable_chained_pbuf’:
../../../../src/../test/unit/ip6/test_ip6.c:314:16: error: ‘main’ is usually a function [-Werror=main]
struct pbuf *main = pbuf_alloc(PBUF_RAW, sizeof(udp_hdr), PBUF_ROM);
^~~~
cc1: all warnings being treated as errors
2020-07-01 10:46:33 +02:00
Erik Ekman
8fe567b86f
ip6: Fix incorrect assert in ip6_frag()
...
New test case now passes.
Fixes bug #57374 (Found by Hiromasa Ito).
2020-06-30 01:27:37 +02:00
Erik Ekman
e2ae25d158
ip6: Add test for fragmenting special packet
...
Reproduces bug #57374 (Found by Hiromasa Ito).
2020-06-30 01:27:32 +02:00
Erik Ekman
90b3e45c31
pbuf: Add pbuf_copy test operating on chained pbufs
...
With the payload lengths not matching between source and destination.
Also remove redundant allocation check in other test, it is now done
in the test setup code.
2020-06-29 19:45:18 +02:00
Erik Ekman
a49c347b7e
pbuf: Update documentation for pbuf_copy
...
Remove detail from when the method was called pbuf_take
which worked on packet queues.
2020-06-25 10:04:43 +02:00
Erik Ekman
488d4ad246
icmp6: Don't copy too much data
...
Fix of the fix for bug #58553
2020-06-24 01:09:37 +02:00
Erik Ekman
bc1da0bddb
pbuf: Remove redundant tests that pbufs are freed
...
Already checked by lwip_check_ensure_no_alloc() in teardown function.
2020-06-24 01:00:12 +02:00
Erik Ekman
489405839a
icmp6: Fix copying of chained pbuf in reply
...
Fixes bug #58553 , and the newly added unit test.
The pbuf_take_at loop should probably be made into a pbuf library
function, which would avoid this mistake in the future and provide
a simpler implementation of pbuf_copy.
2020-06-24 01:00:12 +02:00
Erik Ekman
dd913250a9
icmp6: add test case for returning copy of chained pbufs
...
Currently fails due to bug #58553
2020-06-24 01:00:12 +02:00
Erik Ekman
b58e0061e0
unit: Improve message when the mem heap has usage
...
Show "mem heap still has 216 bytes allocated"
instead of "Assertion 'lwip_stats.mem.used == 0' failed"
2020-06-24 01:00:02 +02:00
Erik Ekman
ff67ce6e07
unit: Improve message when a memp pool has entries
...
Show "memp pool 'PBUF_REF/ROM' still has 2 entries allocated"
instead of "Assertion 'lwip_stats.memp[i]->used == 0' failed"
2020-06-22 00:51:09 +02:00
Daniel Pauli
0b370fbade
add API function mdns_resp_netif_active() that can be used to test if an MDNS responder is active for a given network interface.
...
Signed-off-by: Erik Ekman <erik@kryo.se >
2020-06-19 16:23:34 +02:00
Erik Ekman
e80d4ff2cc
tcp: Fix double free in tcp_split_unsent_seg()
...
Fixes bug #57377 (found by Hiromasa Ito).
2020-06-19 15:39:15 +02:00
Erik Ekman
ea111c511e
unit: Support check v0.13.0 and later
...
Function name no longer needs to be fed separately when adding tests.
Also fix collision of non-static net_test variables in dhcp and netif
tests.
2020-06-19 15:39:15 +02:00
Erik Ekman
9b1056ef0e
fuzz: Fix compile error in simulated glibc rand
...
When using LWIP_RAND_FOR_FUZZ_SIMULATE_GLIBC:
fuzz_common.c: In function ‘lwip_fuzz_rand’:
fuzz_common.c:683:11: error: comparison of integer expressions of different signedness: ‘int’ and ‘long unsigned int’ [-Werror=sign-compare]
683 | if (idx >= sizeof(rand_nrs)/sizeof((rand_nrs)[0])) {
| ^~
cc1: all warnings being treated as errors
2020-06-19 13:26:58 +02:00
Erik Ekman
0ed8f754c5
Restore travis-ci link in README
2020-06-07 13:59:31 +02:00
Erik Ekman
897bcb7d4e
Update README
...
Remove text about contrib as separate git repo
Remove link to old travis-ci setup
Update links to https
2020-06-06 18:49:08 +02:00
Sylvain Rochet
3f47b04f16
PPP: add FIXME about removing netif_set_up() call later
...
User application code should be responsible to call netif_set_up() but
let's not break compatibility for now.
Signed-off-by: Sylvain Rochet <gradator@gradator.net >
2020-04-09 03:52:47 +02:00
Sylvain Rochet
c8fda8d46c
PPP: use netif_set_up() instead of setting NETIF_FLAG_UP flag
...
NETIF_FLAG_UP flag is not supposed to be set by netif init callback
anymore, call netif_set_up() instead.
Sure it would be better to let user application code call netif_set_up()
by itself as it is now meant to be but let's not break compatibility for
now and add a FIXME for next release with allowed behavior break.
Signed-off-by: Sylvain Rochet <gradator@gradator.net >
2020-04-09 03:45:44 +02:00
Sylvain Rochet
cfe5ce9d49
init: raise an error if PPP CCP_SUPPORT==1 but MPPE_SUPPORT==0
...
Building PPP CCP support without adding any compressor support serve
no real use case. Forbid doing so instead of bloating the code with
more ifdef.
Signed-off-by: Sylvain Rochet <gradator@gradator.net >
2020-04-09 03:17:30 +02:00
Sylvain Rochet
cd140b1105
Revert "ppp: fix compiling with CCP_SUPPORT=1 but MPPE_SUPPORT=0"
...
This reverts commit 6e7ea92d56 .
We better forbid building configurations that does not make sense instead
of bloating the code with more ifdef. Here building CCP support without
adding any compressor support serve no real use case.
2020-04-09 03:05:30 +02:00
Hannes Gredler
f36e51e9c9
tcp_out: fix tcp_output_fill_options() arguments
...
Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de >
2020-04-02 20:15:58 +02:00
Simon Goldschmidt
003d34eebd
tcp: fix sequence number comparison
...
This fixes both undefined behavior (see bug #51447 ) as well as a possible bug
where sequence numbers in 31 bit distance may come through.
2020-03-27 22:59:05 +01:00
Simon Goldschmidt
e30d50710d
fuzz: allow overriding LWIP_RAND for fuzz tests
...
Fuzz tests need reproducible code, so we need an "unsafe" version of
LWIP_RAND() in this case...
Also, to reproduce fuzz tests cases from Linux on Windows,
LWIP_RAND_FOR_FUZZ_SIMULATE_GLIBC provides the first 20 random numbers that
glibc would have...
2020-03-27 22:42:06 +01:00
Simon Goldschmidt
003f5cc12d
fuzz: whitespace fixes
2020-03-09 21:50:50 +01:00
Simon Goldschmidt
b795784832
fuzz: make CC overridable from 'afl-gcc'
...
e.g. for debugging crashes
2020-03-09 21:40:30 +01:00
Simon Goldschmidt
412c8d1902
fuzz: fix compiler error "missing prototype"
2020-03-08 20:41:53 +01:00
Simon Goldschmidt
34352e9649
altcp: mbedtls: no need for SYS_ARCH locking
2020-03-05 21:48:08 +01:00
Simon Goldschmidt
33f2b313c7
altcp: mbedtls: coding style fixes
2020-03-05 21:45:20 +01:00
Simon Goldschmidt
87618e2f2a
Revert "altcp_tls_mbedtls: ensure configuration is properly freed"
...
This reverts commit d84a84e5ca .
This commit seemed to be merged in an invalid order
2020-03-05 21:40:23 +01:00
Simon Goldschmidt
21cde5dc9e
altcp: mbedtls: fix compiling altcp_mbedtls_lower_sent()
2020-03-05 21:36:59 +01:00
Simon Goldschmidt
74cd9a8644
ip4: add unit test for ip4addr_aton
2020-03-05 21:28:52 +01:00
Karol Domagalski
2e175a23cb
ip4: ip4addr_aton: fix parsing of the octal IP representation
2020-03-05 21:27:59 +01:00
Simon Goldschmidt
adbc5b5f71
tcp: tighten up checks for received SYN
...
Any malicous segment could contain a SYN up to now (no check).
A SYN in the wrong segment could break OOSEQ queueing.
Fix this by allowing SYN only in states where it is required.
See bug #56397 : Assert "tcp_receive: ooseq tcplen > rcv_wnd"
Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de >
2020-03-05 21:20:35 +01:00
Simon Goldschmidt
a02f34a193
fuzz: add pcap output to help debugging fuzz crashes
2020-03-05 21:00:00 +01:00
Simon Goldschmidt
a9052caf10
fuzz: add debug output to help debugging fuzz crashes
2020-03-05 20:49:41 +01:00
Harrold Spier
0192fe773e
Fix allowing negative offset for snmp_pbuf_stream_seek()
...
Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de >
2020-02-21 17:28:33 +01:00
Simon Goldschmidt
349c077feb
Fix last commit for all netif loopback traffic
2020-02-21 17:25:51 +01:00
Nick Ballhorn-Wagner
349ec76ee5
fix memory leak in netif_loop_output if tcpip_try_callback fails
...
Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de >
2020-02-21 17:17:08 +01:00
Simon Goldschmidt
d05be56a50
fuzz: add more fuzz tests
...
From: Hiromasa Ito <v3hertz@gmail.com >
See bugs #57374-#57380 found by this new test mode.
2020-02-20 21:55:13 +01:00
Simon Goldschmidt
a07e0a82c9
test: split fuzz into different files and binaries
...
This is in preparation to add more fuzzing code...
2020-02-17 22:05:46 +01:00
Simon Goldschmidt
fc85b055d7
sys: add the possibility to fuzz what sys_now() returns
2020-02-17 21:39:46 +01:00
Simon Goldschmidt
9b5a6fe1dc
win32 port: fix LWIP_RAND() being called without sys_init()
...
This can happen in tests...
2020-02-17 21:28:04 +01:00
Simon Goldschmidt
04cf6bbe66
pcapif: add option PCAPIF_RX_READONLY to simulate readonly RX
...
This uses VirtualAlloc/VirtualProtect on windows to simulate RX buffers
that are readonly to lwIP (see task #14807 ).
Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de >
2020-02-16 20:43:33 +01:00
Simon Goldschmidt
ea9726056c
and another codespell fix
2020-02-15 21:54:24 +01:00
Simon Goldschmidt
1ffcc5079c
Fix-more-typos-using-codespell
...
Committing nearly all changes done by 'codespell_check.sh -w'
Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de >
2020-02-15 21:45:53 +01:00
jona
d6a6b661d9
Fix typos using codespell
...
Conservative strategy was used, maybe other typos remain.
Rebased: Simon Goldschmidt <goldsimon@gmx.de >
2020-02-15 21:45:41 +01:00
Simon Goldschmidt
69c4c8a074
codespell: change file names, add possibility to write changes
...
Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de >
2020-02-15 21:45:22 +01:00
jona
8e0c6cd164
Add codespell wrappers : check.sh,changed_files.sh
...
Files adapted from the RIOT project : https://github.com/RIOT-OS/RIOT
Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de >
2020-02-15 21:44:49 +01:00
Simon Goldschmidt
6e7ea92d56
ppp: fix compiling with CCP_SUPPORT=1 but MPPE_SUPPORT=0
...
Even if that might not make much sense, it still shouldn't
result in compiler warnings.
Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de >
2020-02-15 20:53:47 +01:00
Paul Mackerras
d281d3e959
PPP, EAP: ignore received EAP messages when not doing EAP
...
This adds some basic checks to the subroutines of eap_input to check
that we have requested or agreed to doing EAP authentication before
doing any processing on the received packet. The motivation is to
make it harder for a malicious peer to disrupt the operation of pppd
by sending unsolicited EAP packets. Note that eap_success() already
has a check that the EAP client state is reasonable, and does nothing
(apart from possibly printing a debug message) if not.
Signed-off-by: Paul Mackerras <paulus@ozlabs.org >
Signed-off-by: Sylvain Rochet <gradator@gradator.net > (ported to lwIP PPP pcb struct)
2020-02-10 23:37:33 +01:00
Paul Mackerras
2ee3cbe69c
PPP, EAP: fix bounds check in EAP code
...
Given that we have just checked vallen < len, it can never be the case
that vallen >= len + sizeof(rhostname). This fixes the check so we
actually avoid overflowing the rhostname array.
Reported-by: Ilja Van Sprundel <ivansprundel@ioactive.com >
Signed-off-by: Paul Mackerras <paulus@ozlabs.org >
Signed-off-by: Sylvain Rochet <gradator@gradator.net > (compiler warning fix about int vs uint comparisons)
2020-02-10 23:37:25 +01:00
Simon Goldschmidt
5e52d1a4b1
win32: fix 2 compiler warning nits in win32 port
...
Reported-by: Gisle Vanem <gisle.vanem@gmail.com >
2020-02-10 21:55:32 +01:00
Simon Goldschmidt
cc6d5b7a29
ppp: fix compiling eap after changing debug functions
2020-02-06 20:51:02 +01:00
Simon Goldschmidt
d843e47a1d
icmp6: keep to the RFC and send as much as possible with icmp6 error messages
...
See bug 56013
Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de >
2020-02-05 20:43:25 +01:00
Simon Goldschmidt
4f30e0daff
httpd: post example: fix typo in last version
...
See bug #57742
Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de >
2020-02-04 22:25:04 +01:00
Gao Qingshui
a9ac18aebb
ip6: enable ip6_autoconfig_enabled by default
...
See bug #56135
Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de >
2020-02-04 22:23:58 +01:00
Simon Goldschmidt
3034e9fad0
httpd: post example: free pbuf in httpd_post_receive_data
...
See bug #57742
Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de >
2020-02-04 22:12:14 +01:00
Simon Goldschmidt
064d816ea1
altcp: fix altcp_tcp_close for LISTEN pcb
...
See bug #55219
Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de >
2020-02-03 22:13:07 +01:00
Simon Goldschmidt
84228d4f4b
nd6: cache neighbour index for each next hop, not globally
...
See bug #47792
Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de >
2020-02-03 21:53:22 +01:00
Simon Goldschmidt
dc41eabf5f
nd6: check defines for global tables for validity
...
Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de >
2020-02-03 21:49:57 +01:00
Simon Goldschmidt
b3046d938e
nd6: use a pointer where appropriate to make the code more readable
...
Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de >
2020-02-03 21:33:21 +01:00
Simon Goldschmidt
177bb6ca06
nd6: update addr_hint only if the index has actually changed
2020-02-03 20:57:28 +01:00
Simon Goldschmidt
4c15191b1d
snmp: update documentation
2020-02-03 20:35:22 +01:00
Simon Goldschmidt
5de4967f23
ip4: forward: try to fix the build...
...
... by adding a default case
2020-01-30 23:22:00 +01:00
Simon Goldschmidt
38894637e7
ip4: forward: remove invalid const modifiers
...
This should fix the build...
2020-01-30 23:13:07 +01:00
Simon Goldschmidt
61c67fc229
ip_forward: fix IPv4 forwarding with multiple netifs/offloading
...
When we have multiple netifs where at least one has checksum offloading
capabilities, IP forwarding needs to set various checksum fields to 0
to prevent HW algorithms on calculating an invalid checksum.
-> set checksum fields of IP/UDP/TCP/ICMP to 0 in ip4_forward().
See bug #56288
Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de >
2020-01-30 23:02:16 +01:00
Simon Goldschmidt
695c323164
icmp: add a dedicated struct for the standard ICMP header
...
This is just to keep the code clean and prevent using the "echo" header
where any ICMP header is meant.
Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de >
2020-01-30 22:50:25 +01:00
Simon Goldschmidt
75b2db4438
makefsdata: error files must start with "<errnr>." to match HTTP status
...
This is to prevent files like "4001.jpg" getting HTTP status 400 instead
of 100.
See bug #56290 .
Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de >
2020-01-30 21:22:36 +01:00
Simon Goldschmidt
0f5bf0aa37
httpd: error files must start with "<errnr>." to match HTTP status
...
This is to prevent files like "4001.jpg" getting HTTP status 400 instead
of 100.
See bug #56290 .
Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de >
2020-01-30 21:22:03 +01:00
Patrick Schlangen
8d7e436a9d
Fix select_waiting not being decremented for sockets closed while in lwip_select()
...
See bug #57445 . Short version of the description there: lwip_select() failed
to decrement 'select_waiting' of a socket since that code part failed on
'free_pending' sockets. However, the code does not have to check that as it
has marked the socket to be in use itself earlier.
Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de >
2020-01-30 21:04:37 +01:00
Simon Goldschmidt
32a72b1a20
sntp: ensure sntp_retry_timeout reaches the configured limit
...
See bug #57620
Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de >
2020-01-30 20:47:19 +01:00
Felix Werner
3b2d7e289a
Additional Debug-Print in api_msg.c
...
Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de >
2020-01-30 20:43:56 +01:00
Simon Goldschmidt
a4b578b483
pbuf: avoid using multiple PBUF_POOL buffers for IPv6
...
Use 'PBUF_IP_HLEN+PBUF_TRANSPORT_HLEN' instead of '40' to calculate
PBUF_POOL_BUFSIZE (the size of each PBUF_POOL buffer) since the former
can be 60 when IPv6 is enabled.
See bug #56355
Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de >
2020-01-30 20:42:15 +01:00
Simon Goldschmidt
dae8eb8d6e
adapt unit test to new netif ext callback reason
2020-01-13 19:37:59 +01:00
Simon Goldschmidt
d6b5b5222f
opt: make LWIP_IPV6_SEND_ROUTER_SOLICIT default to LWIP_IPV6
...
This ensures struct netif doesn't contain 'rs_count' if LWIP_IPV6
is disabled but LWIP_IPV6_SEND_ROUTER_SOLICIT is at its default.
See bug #56509
2020-01-12 20:34:18 +01:00
Simon Goldschmidt
8a8058a436
netif: add IPV4_ADDR_VALID ext status callback reason
...
This ext-callback reason is always issued when an IPv4 config
has been set, even if it has not changed (e.g. DHCP reboot)
See bug #55121
2020-01-12 20:30:38 +01:00
Simon Goldschmidt
bb31fbd737
ip6: fix printing rx packet headers
...
The call to ip6_debug_print needs to be moved before the
next-header parsing code.
See bug #56708
2020-01-10 23:10:49 +01:00
Simon Goldschmidt
bf1285e3c9
ppp: don't link debug functions if disable
...
This converts all ppp_*() debug functions to ppp_*(()) macros that
ensure the code is left out by the linker if the corresponding debug
setting is disabled.
Downside is that many lines of code are touched, but since these
already differ to upstream PPP sources, I figured that's ok...
See bug #55199
Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de >
2020-01-10 21:42:45 +01:00
Simon Goldschmidt
827b60c155
debug: split debug enable checks from LWIP_DEBUGF to LWIP_DEBUG_ENABLED
...
In order to reuse the debug-enable checks for PPP debug macros,
move the flag and level checks from LWIP_DEBUGF to a new macro
that can be used elsewhere.
2020-01-10 20:50:25 +01:00
Simon Goldschmidt
b43f081b9a
sockets: ioctl: fix _IO macros for 16 bit platforms
...
See bug #57565
2020-01-10 20:46:23 +01:00
David Girault
5c2887a241
sntp: remove existing timeout before creating new
...
This prevents sntp using more than 2 timeouts.
See bug #56431
2020-01-10 20:42:17 +01:00
Axel Lin
555812dcec
netif_find: correctly check if atoi means '0' or error
...
Fixes: 4528215c99 ("netif_find: check if atoi means '0' or error")
Signed-off-by: Axel Lin <axel.lin@ingics.com >
2019-12-12 09:23:11 +08:00
Simon Goldschmidt
f857260e29
fix compiling fuzz test under Linux after merging contrib to main repo
2019-12-11 22:20:14 +01:00
David Girault
2be031e238
altcp_tls: ensure no memory leaks and entropy counter is protected
2019-12-11 21:22:42 +01:00
David Girault
dc7ba26e69
altcp_tls: use ERR_CLSD only for handshake error
...
This allow better handling of handshake error in application.
2019-12-11 21:22:42 +01:00
David Girault
316dbc792f
altcp_tls: call the application sent() callback with usefull len
...
First calculate and sum TLS overhead when altcp_mbedtls_write() is called.
Then take care of it when calling application sent callback. Give reveived
len from inner_conn, minus calculated overhead.
2019-12-11 21:22:41 +01:00
David Girault
f97dacd014
altcp_tls: support for saving/restoring session information
...
According to mbedTLS source code and documentation, calls to
`mbedtls_ssl_conf_session_cache` and `mbedtls_ssl_conf_session_tickets_cb`
are only available if mbedTLS is configured for server mode (ie. MBEDTLS_SSL_SRV_C
is defined). This cannot be used on client mode to resume a previous session.
To allow session reuse in client mode, application must save session parameters
(including tickets provided by the server if any) after successfull connection
and restore them before attemting to reconnect. Since `alctp_close()` free the
structure, it cannot be used to store the required information.
So, two new API were added, directly wrapped to mbedTLS functions, allow application
to do that by itself.
Also added full declaration of `struct altcp_tls_session` in altcp_tls.h to allow
easier usage in application when using mbedTLS port.
2019-12-11 21:22:41 +01:00
David Girault
d84a84e5ca
altcp_tls_mbedtls: ensure configuration is properly freed
2019-12-11 21:22:41 +01:00
Simon Goldschmidt
44a3f631b3
inet: added missing IN6_IS_ADDR_* macros
2019-12-11 21:11:55 +01:00
Simon Goldschmidt
a9e73bc412
ip6addr_aton: support scoped address strings (via '%')
...
See task #15393
Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de >
2019-12-11 20:43:28 +01:00
Simon Goldschmidt
4528215c99
netif_find: check if atoi means '0' or error
...
Since atoi() returns 0 on error, we need to check if name[2] is '0'.
If it's not, atoi() failed.
2019-12-11 20:42:36 +01:00
Simon Goldschmidt
fbe032d05d
mdns: fix clang warning about documentation error
2019-12-11 20:23:14 +01:00
David Girault
4baf17d5b2
mdns: restart probing when IP addresses has changed
...
Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de >
2019-12-11 20:13:10 +01:00
David Girault
4ca115a08e
mdns: move MDNS_PROBE_DELAY_MS to mdns_opts.h to allow customisation
...
In some noisy WiFi environment, it may be necessary to increase this value to
300ms to accomodate WiFi latencies which may result in less than the required
250ms between two probe frames received by the Apple BCT application.
Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de >
2019-12-11 20:13:10 +01:00
David Girault
2441c6fa3f
mdns: abort packet analysis if conflict detected
...
Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de >
2019-12-11 20:13:10 +01:00
David Girault
6302423d7f
mdns: handle tiebreaking loose like conflict
...
- Count tiebreaking loss in num_conflicts to include them in rate limit detection
- Restart probing using mdns_resp_restart allowing rate limiting for those cases
This ensure rate limiting is well activated during Apple Bonjour Conformance Tests.
Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de >
2019-12-11 20:13:10 +01:00
David Girault
9301225895
mdns: support for multi-packet known answer (questions with TC bit)
...
This allow Apple Bonjour Conformance Test to not fail with the following tests:
- DISTRIBUTED DUPLICATE SUPPRESSION
- MULTIPLE QUESTIONS - DISTRIBUTED DUPLICATE SUPPRESSION
Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de >
2019-12-11 20:13:01 +01:00
David Girault
e85e473838
mdns: remove service TXT record from probe packets
...
TXT records isn't required to be unique in network, so it shouldn't be
included in probe packets.
Additionnaly, when TXT record is present, the Bonjour Conformance Test
from Apple Inc. always fail because generated probe nevert have TXT record.
Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de >
2019-12-11 20:12:26 +01:00
David Girault
710b7fc158
mdns: add mdns_resp_restart_delay to allow re-probe delay selection
...
Called with `MDNS_INITIAL_PROBE_DELAY_MS` or `MDNS_PROBE_DELAY_MS` according to
needs.
When `mdns_resp_restart_delay()` called by `mdns_resp_rename_(netif|service)()`
functions, it is assumed this is because a conflict. So we should not use
`MDNS_INITIAL_PROBE_DELAY_MS` because the Bonjour Conformance Test will
complain like this:
```
START (PROBING)
NOTICE 16:40:09.501911: conflicting probe:
smarTrEMotE-f8d0a4.Local.
ERROR 16:40:09.607288: Device did not provide a sufficient time gap between receiving a conflicting probe and reprobing.
ERROR 16:40:09.607333: expected_time_gap=237,actual_time_gap=105
```
Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de >
2019-12-11 20:12:04 +01:00
David Girault
cd278c426d
mdns: remove duplicate acd_state_enum_t declaration
...
Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de >
2019-12-11 20:11:13 +01:00
David Girault
aa79b90d3c
mdns: update probe conflict function to provide service in conflict
...
- Send service slot index to the mdns result function. In case of conflict, the user
will have to remove the service or rename it.
- Break after hostname conflict in order to managed it first, and managed service name
conflict after.
- Provide a function to get the TXT userdata for a service (allowing app to match with
its own data).
Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de >
2019-12-11 20:11:13 +01:00
David Girault
a2498898b0
mdns: increase mDNS output packet size
...
When more than one service (just 2) need to be probed for conflict, generation
of the probe packet fail because pbuf is too small!
So OUTPACKET_SIZE renamed to MDNS_OUTPUT_PACKET_SIZE and moved to mdns_opts.h
to allow configuration. Default configuration raise it to 1450 to have enough
space when MDNS_MAX_SERVICES > 1 else it remain 512.
Extract from RFC 6762, chapter 17, Multicast DNS Message Size:
The 1987 DNS specification [RFC1035] restricts DNS messages carried
by UDP to no more than 512 bytes (not counting the IP or UDP
headers). For UDP packets carried over the wide-area Internet in
1987, this was appropriate. For link-local multicast packets on
today's networks, there is no reason to retain this restriction.
Given that the packets are by definition link-local, there are no
Path MTU issues to consider.
Multicast DNS messages carried by UDP may be up to the IP MTU of the
physical interface, less the space required for the IP header (20
bytes for IPv4; 40 bytes for IPv6) and the UDP header (8 bytes).
Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de >
2019-12-11 20:11:13 +01:00
Simon Goldschmidt
cb3f0a9b17
fuzz: adapt to changes in mdns
...
mdns_resp_add_netif() takes only 3 arguments
2019-12-11 19:50:50 +01:00
Simon Goldschmidt
0caacf82b4
netif_add: zero-init netif->acd_list
2019-12-11 19:49:50 +01:00
Simon Goldschmidt
e0be5a7f6d
default_netif.c: add missing include
...
For sys_msleep(), we need to include sys.h
2019-12-11 19:49:26 +01:00
Joan Lledó
2b6d9a56f7
Contrib: Add kFreeBSD to the Unix port
...
* cc.h:
* Identify kFreeBSD by macros
* Use standard error codes for this OS
Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de >
2019-12-10 21:55:22 +01:00
Christoffer Lind
f47d2ed5fe
sys_arch_mbox_tryfetch not validated correctly
...
sys_arch_mbox_tryfetch() shall return SYS_MBOX_EMPTY or 0 according
to the documentation. Wherever the function is used the return
value is incorrectly compared to SYS_ARCH_TIMEOUT. For now
SYS_MBOX_EMPTY is defined to SYS_ARCH_TIMEOUT so this is not an
issue as long as SYS_MBOX_EMPTY isn't re-defined.
Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de >
2019-12-10 21:46:47 +01:00
Simon Goldschmidt
af0499131f
autoip: fix typo
...
Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de >
2019-12-10 21:43:47 +01:00
David Girault
30d445bd39
acd: inform address is good only when going in ongoing state
...
Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de >
2019-12-10 21:37:03 +01:00
David Girault
05ffe144dd
acd: reset conflict count to ensure fast re-probing after announcing
...
Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de >
2019-12-10 21:37:03 +01:00
David Girault
e09add37c1
acd: fix MAX_CONFLICTS check accorting RFC.
...
As written in RFC5227 in 2.1.1 Probe Details:
A host implementing this specification MUST take precautions to limit
the rate at which it probes for new candidate addresses: if the host
experiences MAX_CONFLICTS or more address conflicts on a given
interface, then the host MUST limit the rate at which it probes for
new addresses on this interface to no more than one attempted new
address per RATE_LIMIT_INTERVAL.
But `acd_restart` restart function check for `acd->num_conflicts > MAX_CONFLICTS`
which allow one more probe than expected.
So this commit change the test to `acd->num_conflicts >= MAX_CONFLICTS`.
Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de >
2019-12-10 21:37:03 +01:00
Georgy Komarov
eaa8f34f6a
lowpan6.c: fix unuinitialized variable if LWIP_6LOWPAN_IPHC==0
2019-12-10 21:19:53 +01:00
Simon Goldschmidt
fe25ca66af
httpd: makefsdata: fix passing deflate level via commandline
...
See bug #57187
Reported-by: Anton Chasnyk <anton.chasnyk@gmail.com >
Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de >
2019-12-02 21:13:45 +01:00
Simon Goldschmidt
bef201e162
sockets: fix IS_SOCK_ADDR_ALIGNED() for 16 bit platforms
...
See bug 57344
Reported-by: Victor Brzeski <VBrzeski@gmail.com >
Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de >
2019-12-02 20:53:13 +01:00
Simon Goldschmidt
03998f5147
autoip: fix 'autoip_remove_struct()' after changing storage to 'netif_client_data'
...
Reported-by: Amena El Homsi <amena.elhomsi@gmail.com >
Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de >
2019-11-21 22:19:35 +01:00
Dirk Ziegelmeier
79cd89f99d
Fix possible NULL pointer dereference in autoip_start()
...
autoip variable is dereferenced (autoip->state) before it is checked for NULL pointer
2019-08-28 07:24:31 +02:00
Joan Lledó
7fd158a109
Make socket functions depend on LWIP_SOCKETS
...
* Socket functions definitions moved out of the
#define LWIP_SOCKET_EXTERNAL_HEADERS as all users who
set LWIP_SOCKETS to 1 will need them regardless they use
lwip's or external socket headers.
2019-08-16 10:59:31 +02:00
Joan Lledó
0aad45593f
Unix port: sio module: memset struct sigaction to 0
...
* Use memset to set all struct sigaction fields to 0
instead of doing it field by field, since fields
depend on the architecture.
2019-08-16 10:57:35 +02:00
Joan Lledó
785b7aba3c
Sockets: Unit tests and apps corrections
...
* Include lwip/inet.h in some unit tests and apps
* Since they use htons() and pals.
* test/unit/api/test_sockets.c:
* write() could be declared by external socket headers
* Call lwip_write() instead.
* Code expects fcntl() to return 6
* But O_RDWR could have another value if external
socket headers are present
* Replace 6 by O_RDWR.
* apps/tftp/tftp.c:
* recv() could be declared by external socket headers
* Rename it to tftp_recv()
2019-08-11 20:12:47 +02:00
Joan Lledó
f92d6702bc
Sockets: declare msghdr->msg_iovlen as msg_iovlen_t
...
* Lwip declares msghdr->msg_iovlen as int, but when
using external socket headers, some systems declare
msg_iovlen as size_t or others.
* This patch creates a new type msg_iovlen_t and
expects users to typedef it to the type they need
for their system.
2019-08-11 20:12:02 +02:00
Simon Goldschmidt
c4f33be3f3
fix compiling last commit (save before committing...)
2019-08-06 22:34:17 +02:00
Simon Goldschmidt
19e22f870f
add https example
2019-08-06 22:17:55 +02:00
Joan Lledó
2f5305c259
Unix port: improve support for the Hurd
...
Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de >
2019-08-01 21:10:36 +02:00
Simon Goldschmidt
602a66fe58
sockets: convert _HAVE_SA_LEN to lwip style
2019-08-01 21:04:06 +02:00
Joan Lledó
f126750ccd
Add support for struct sockaddr with no sa_len field.
...
Lwip's struct sockaddr includes sa_len, but some systems
like Linux doesn't have this filed, which produces many
compilation problems when using external headers.
A set of macros has benn added to detect the absence of
sa_len and adapt sockets.c
2019-08-01 20:49:54 +02:00
Simon Goldschmidt
c53a8444e8
dhcp: don't use LWIP_ERROR in dhcp_parse_reply()
...
See bug #56643
Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de >
2019-07-26 20:43:08 +02:00
Simon Goldschmidt
6b3ed88d9c
ALTCP_TLS_MBEDTLS: include mbedtls/net_sockets.h instead of deprecated mbedtls/net.h
...
See patch #9815
Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de >
2019-07-26 20:29:27 +02:00
Joan Lledó
fa6f8054eb
Move LWIP_MARK_TCPIP_THREAD to include/lwip/sys.h
...
* LWIP_MARK_TCPIP_THREAD moved to include/lwip/sys.h
* Unix port macro definitions moved to sys_arch.h
* LWIP_MARK_TCPIP_THREAD
* LOCK_TCPIP_CORE
* UNLOCK_TCPIP_CORE
(goldsimon@gmx.de: fixed unix Makefile build and win32 build)
Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de>
2019-07-26 20:09:40 +02:00
Freddie Chopin
8291ff3dc0
Fix definition of LWIP_NUM_SYS_TIMEOUT_INTERNAL
...
In timeouts.c commit 7d1c26cc0c replaced
timeout for AUTOIP with a timeout for ACD, however the value of
LWIP_NUM_SYS_TIMEOUT_INTERNAL was not updated and still counts
LWIP_AUTOIP instead of LWIP_ACD. If user has AUTOIP disabled (or not
explicitly enabled) and DHCP enabled, then ACD gets automatically
enabled too. In this case there will be one timeout too little for lwIP
and first TCP packet received causes an assertion.
Also add LWIP_IPV6_DHCP6 to the value of LWIP_NUM_SYS_TIMEOUT_INTERNAL,
as it was also not accounted for.
2019-07-26 19:44:35 +02:00
Joan Lledó
9dca4a0211
New function tcpip_callback_wait() * Call a function inside the tcpip thread and block the calling thread until the callback finishes.
...
Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de >
2019-07-13 20:52:48 +02:00
Joan Lledó
3546a0a4a0
IF_NAMESIZE: define it only if it's not defined before by system headers
2019-07-13 20:49:48 +02:00
Simon Goldschmidt
5465fdfd69
netconn: add callback arg storage
...
This reuses the member 'int socket' by making it a union containing
both int and void pointer.
See bug #56593 .
Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de >
Suggested-by: Wilfred <wilfrednilsen@hotmail.com >
2019-07-13 20:46:36 +02:00
Simon Goldschmidt
f37925dad2
api_lib: fix duplicate NULL check with sys_sem_valid()
2019-07-10 21:55:28 +02:00
Simon Goldschmidt
2ebebe7287
fix compiling unit tests after adding compile-time check for LWIP_NETCONN_FULLDUPLEX
2019-07-10 21:29:13 +02:00
Simon Goldschmidt
aa545fbbc6
LWIP_NETCONN_FULLDUPLEX is not alpha any more
2019-07-10 21:14:35 +02:00
Giuseppe Modugno
832490eec8
Added the configuration option ALTCP_MBEDTLS_AUTHMODE to set the certificate verification mode.
...
Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de >
2019-06-11 21:15:45 +02:00
Giuseppe Modugno
edeeef0d20
mqtt: fix ping request coming too late
...
See bug #56022 and patch #9813
Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de >
2019-06-11 21:13:05 +02:00
Axel Lin
b3a939417e
sockets: Get rid of sock_set_errno
...
The err field is removed from struct lwip_sock since commit e0a2472706
("netconn/sockets: remove fatal error handling, fix asynchronous error handling, ensure data before RST can be received")
sock_set_errno() simply calls set_errno() now, so use set_errno() instead.
Signed-off-by: Axel Lin <axel.lin@ingics.com >
Acked-by: Dirk Ziegelmeier <dziegelmeier@de.pepperl-fuchs.com >
2019-05-06 19:47:56 +08:00
Dirk Ziegelmeier
0255106d55
Fix bug #56136 : The netif->mtu6 was updated by Router Advertisement abnomally
...
Using patch from Gao Quingahui plus improvement
2019-05-06 12:37:19 +02:00
Our Air Quality
ff17530997
mdns mdns_search_service mdns_search_stop: define the request id as unsigned.
2019-04-30 14:53:58 +02:00
Dirk Ziegelmeier
3d7ff53070
Apply patch for bug #56098 : Support for MQTT over TLS port 443 instead of 8883
2019-04-30 13:22:09 +02:00
Dirk Ziegelmeier
295996f912
Apply patch for bug #56239 : compile fail when disable TCP
2019-04-30 13:16:30 +02:00
Dirk Ziegelmeier
534d3a794c
Minor compile fix for last commit
2019-04-30 13:05:50 +02:00
David Girault
fc8f6e8fd9
mqtt: fix first packet checking which fail if MQTT_VAR_HEADER_BUFFER_LEN > 1516
...
If client reception buffer is bigger than the first frame we receive, the first packet test
will always fail for the second one if it is shorter the the diffence between reception
buffer size and first frame length.
For example, if we receive a PUBLISH message with length = 1517 (payload len = 1514 +
header len = 3), this result in total message length of 1517.
altcp_tls will send MQTT client frame up to 1516 bytes max. This result to PUBLISH
message splitted in two frame: first is 1516 bytes, the second of 1 bytes.
If MQTT_VAR_HEADER_BUFFER_LEN is 1520 (1516 + 4 bytes for stored fixed header), the
second frame of 1 bytes is considered as first publish frame because
client->msg_idx (1517) < MQTT_VAR_HEADER_BUFFER_LEN (1520).
This result in disconnection AND application callback never called for the end of the
payload.
The fix will check `(client->msg_idx - (fixed_hdr_len + length)) == 0` which can be
only true for the first frame of a message.
Below logs showing the bug:
```
April 3rd 2019, 23:14:05.459 lwip_dbg mqtt_parse_incoming: Remaining length after fixed header: 1514
April 3rd 2019, 23:14:05.460 lwip_dbg mqtt_parse_incoming: msg_idx: 1516, cpy_len: 1513, remaining 1
April 3rd 2019, 23:14:05.460 lwip_dbg mqtt_incomming_publish: Received message with QoS 1 at topic: v2/inte...
April 3rd 2019, 23:14:05.461 lwip_dbg mqtt_parse_incoming: Remaining length after fixed header: 1514
April 3rd 2019, 23:14:05.461 lwip_dbg mqtt_parse_incoming: msg_idx: 1517, cpy_len: 1, remaining 0
April 3rd 2019, 23:14:05.461 lwip_dbg mqtt_message_received: Received short PUBLISH packet
```
2019-04-30 12:57:48 +02:00
David Girault
df0699c143
mqtt: support mostly zero-copy message analysis
...
also ensure no parts of message are lost because cpy_len != buffer_space!
2019-04-30 12:57:40 +02:00
Our Air Quality
156bb74d17
mdns_resp_add_service: simplify the max services guard.
2019-04-30 12:41:19 +02:00
Our Air Quality
224b884c1e
mDNS: output search queries to the IP v4 and v6 groups.
...
These had been broadcasting to the *_ANY addresses.
2019-04-30 12:38:07 +02:00
Our Air Quality
c156cd2a33
ND6: add an explicit queue size check.
...
When using the MEMP_MEM_MALLOC option, memp_malloc() can not be relied on to
limit the number of allocations allowed for each MEMP queue, as the ND6 code
had been. This caused the ND6 queue to keep growing until the heap allocation
failed when using the MEMP_MEM_MALLOC option. So add an explicit queue size
check in ND6.
2019-04-30 12:34:43 +02:00
Our Air Quality
46bbfe4ee2
mdns: defined the service slot id as unsigned rather than signed.
2019-04-30 12:33:22 +02:00
Our Air Quality
2229c51704
mdns_search_service: simply the search for a free slot.
2019-04-30 12:29:43 +02:00
Our Air Quality
af5906370f
mDNS: change some debug line terminations to just newlines.
...
Some of there were using carriage-return and newline, yet the
rest of the code base consistently uses only newline.
2019-04-30 12:29:08 +02:00
Freddie Chopin
ec11b289cb
Fix and simplify newlines in doxygen documentation
...
Replace '\n' with '<br>', as this allows doxygen to understand reference
names followed by newline. For some cases just drop the newline if it's
not required.
Doxygen 1.8.15 doesn't like if the name of reference is followed by
anything else than (selected?) punctuation or whitespace.
bug #56004
2019-03-28 08:18:20 +01:00
Freddie Chopin
c594599350
Fix doxygen @ref in altcp.c
...
Doxygen 1.8.15 doesn't like if the name of reference is followed by
anything else than (selected?) punctuation or whitespace.
bug #56004
2019-03-28 08:18:19 +01:00
Dirk Ziegelmeier
53818ad3e4
Add #define for minimum IPv6 MTU length
2019-03-28 08:16:47 +01:00
Dirk Ziegelmeier
bda6909df8
Fix bug #56003 : -Wc++-compat causes build failure when using mbedtls
...
Build without -Wc++-compat when MBEDTLS is included in project
Works around problem in MBEDTLS headers
2019-03-26 20:11:37 +01:00
Dirk Ziegelmeier
ecd8c5b936
Fix bug #55702 : SSI bug
...
Apply patch from Stanislav
2019-03-24 21:47:56 +01:00
Dirk Ziegelmeier
d0d86b5ba1
Fix compile of last patch
2019-03-24 21:46:43 +01:00
Dirk Ziegelmeier
aa7009b2fc
Fix bug #55972 : The Neighbour Solicitation used to do IPv6 address resolution was wrong
...
Apply patch from Gao Qingshui
2019-03-24 21:34:08 +01:00
Dirk Ziegelmeier
4f6fd6c845
Fix bug #55973 : The parsing of max response time in MLD Query message was wrong
...
Apply patch from Gao Qingshui
2019-03-24 21:32:26 +01:00
Dirk Ziegelmeier
ff93961ff4
Update .gitignore for latest VSCode
2019-03-20 20:50:35 +01:00
Dirk Ziegelmeier
4b10b4dab3
Add note about MEMP_NUM_SYS_TIMEOUT in four apps
2019-03-20 20:50:17 +01:00
Dirk Ziegelmeier
a329bdd607
Fix bug #55964 : CMake's LWIP_COMPILER_FLAGS should be split for C and C++
...
CMakeCommon.cmake: Use conditional for flags that only make sense for C code
2019-03-20 11:20:35 +01:00
Simon Goldschmidt
3b5eb7ca90
udp_bind: fix missing parenthesis warning
...
Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de >
2019-02-27 10:29:55 +01:00
Simon Goldschmidt
752cdb1a53
udp: fix udp_bind for IPADDR_TYPE_ANY
...
See bug #55171
Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de >
2019-02-26 14:48:44 +01:00
Dirk Ziegelmeier
e479bd56df
Fix LWIP_ERROR macro - it should never be fatal (LWIP_ASSERT)
...
The only difference should be:
- LWIP_DEBUG enabled -> print a diag message
- LWIP_DEBUG disabled -> NO diag message is printed
2019-02-08 12:29:05 +01:00
Dirk Ziegelmeier
049cae841d
More cleanups to travis.sh - run all test even if some fail
...
Try to get maximum on information in one build run
2019-02-03 09:36:44 +01:00
Dirk Ziegelmeier
a7b06bef5f
Fix iteropts.sh to correctly return error code
2019-02-03 09:31:26 +01:00
Dirk Ziegelmeier
32bc761245
iteropts.sh: -j 4 is sufficient
2019-02-03 09:09:50 +01:00
Dirk Ziegelmeier
8a08c4cd4f
Cleanup travis build script
2019-02-03 09:03:22 +01:00
Dirk Ziegelmeier
71f56714dd
Remove iteropts test errors again, still not working
2019-02-02 23:17:39 +01:00
Dirk Ziegelmeier
95dbe78821
Add bug to iteropts test to check if travis fails now
2019-02-02 23:10:31 +01:00
Dirk Ziegelmeier
c03e949ca9
Try to fix iteropts build, try to make travis fail when iteropts test fails
2019-02-02 23:04:52 +01:00
Dirk Ziegelmeier
3f4e183e3f
Disable documentation warning in iteropts test
...
Fails because some functions have different parameter lists depending on lwIP options (e.g. netif_add())
2019-02-02 22:59:54 +01:00
Dirk Ziegelmeier
78a0a62484
Add missing newline at end of file
2019-02-02 22:58:53 +01:00
Dirk Ziegelmeier
27c226b5d6
Fix a few documentation errors in MDNS
2019-02-02 22:44:57 +01:00
Dirk Ziegelmeier
dc607c5be4
Fix lwip_port_rand()
...
(Didn't stash again after last change)
2019-02-02 22:38:49 +01:00
Dirk Ziegelmeier
aa4668cc47
Add lwip_port_rand() to unix port
2019-02-02 22:37:18 +01:00
Simon Goldschmidt
cbc80a0920
revert accidentally committed files
2019-01-30 21:14:01 +01:00
Solganik Alexander
b1d3dcb8d7
tcp: don't reset dupack count upon non-empty packet receive
...
According to rfc5681:
https://tools.ietf.org/html/rfc5681
Paragraph 3.2. Fast Retransmit/Fast Recovery
The TCP sender SHOULD use the "fast retransmit" algorithm to detect
and repair loss, based on incoming duplicate ACKs. The fast
retransmit algorithm uses the arrival of 3 duplicate ACKs (as defined
in section 2, without any intervening ACKs which move SND.UNA) as an
indication that a segment has been lost. After receiving 3 duplicate
ACKs, TCP performs a retransmission of what appears to be the missing
segment, without waiting for the retransmission timer to expire.
Now consider the following scenario:
Server sends packets to client P0, P1, P2 .. PK.
Client sends packets to server P`0 P`1 ... P`k.
I.e. it is a pipelined conversation. Now lets assume that P1 is lost, Client will
send an empty "duplicate" ack upon receive of P2, P3... In addition client will
also send a new packet with "Client Data", P`0 P`1 .. e.t.c. according to sever receive
window and client congestion window.
Current implementation resets "duplicate" ack count upon receive of packets from client
that holds new data. This in turn prevents server from fast recovery upon 3-duplicate acks
receive.
This is not required as in this case "sender unacknowledged window" is not moving.
Signed-off-by: Solganik Alexander <sashas@lightbitslabs.com >
2019-01-30 21:13:22 +01:00
Simon Goldschmidt
5666f305ce
sntp: obey KoD when using multiple servers
...
See bug #55253 (SNTP retry next server instantly result as a flood of NTP request).
Added 'sntp_getkodreceived()' to check the status.
2019-01-30 20:42:56 +01:00
Simon Goldschmidt
8e86555f93
mdns: fix compiler errors and coding style
2019-01-30 20:15:26 +01:00
David Girault
b4be0d8808
mdns: added support for searching services
...
Two new API:
err_t mdns_search_service(const char *name, const char *service, enum mdns_sd_proto proto,
struct netif *netif, search_result_fn_t result_fn, void *arg,
s8_t *request_id);
void mdns_search_stop(s8_t request_id);
One compilation flags:
LWIP_MDNS_SEARCH
One options flags:
MDNS_MAX_REQUESTS
Some structure declarations moved to allow use by callback result function.
Result domain names are early uncompress before calling application callback
because it cannot be made by application itself.
Allow search services with multiples labels included, like '_services._dns-sd'.
Search for `_services._dns-sd._udp.local.` is handled in a special way.
Only `PTR` answers are send back to the application.
The `mdns_search_service()` function won't assert if no more space in `mdns_request`
table, just return an error if too many simultanous requests.
2019-01-30 20:05:51 +01:00
Ivan Warren
9263d44847
Small documentation fix for TFTP
...
Apparently the TFTP server now also invokes the error() function in the
tftp_context struct.
Some tftp clients (for example Windows 10 TFTP client) will open the
remote file before checking the local file can be opened - and will then
send an error indication to the server to indicate there was an error
opening the local file. When the happens, the LWIP tftp server will
invoke the error() member of the tftp_context.
2019-01-30 19:56:49 +01:00
David J. Fiddes
8f2f43f093
Implement RFC4075 Receive SNTP servers via DHCPv6
...
This adds support for RFC4075 SNTP server configuration via DHCPv6.
The DHCPv6 options transmitted are now conditional on how LwIP is
configured.
A new SNTP application option SNTP_GET_SERVERS_FROM_DHCPV6 is used
to enable. For simplicity this is configured to use the global
LWIP_DHCP6_GET_NTP_SRV configuration setting.
Tests:
- Check the global options now control the DHCPv6 request sent
in Wireshark
- Check against 0, 1 and 3 SNTP servers configured on an odhcpd
server configured to support RFC 4075 SNTP server lists.
Verify that the SNTP server list is updated on connection
establishment on an ESP8266 WeMOS D1.
- Verify that SNTP packets are sent and recieved from a
configured server and that system time is updated.
Signed-off-by: David J. Fiddes <D.J@fiddes.net >
2019-01-30 17:49:18 +01:00
David Girault
3cb6ae7770
altcp_tls: assert in altcp_mbedtls_bio_recv if bad state
2019-01-30 17:42:52 +01:00
David Girault
b04d8a6a6c
altcp: support for setting keepalive parameters
2019-01-30 17:42:46 +01:00
David Girault
b298afabdc
altcp_tls_mbedtls: remove entropy/ctr_drbg from altcp_tls_config struct
...
Use only one entropy/ctr_drbg context for all altcp_tls_config structure allocated.
(Small adjustments before committing: fix coding style, adapt to changes in master)
2019-01-30 17:42:39 +01:00
Simon Goldschmidt
2037ec371c
test: fix compiling unit test on win32
2019-01-30 14:53:41 +01:00
David Girault
2cc420e434
mqtt: remove bad assert in mqtt_message_received()
...
- client->msg_idx can be > MQTT_VAR_HEADER_BUFFER_LEN in long message splitted in multiple pbufs
- renamed fixed_hdr_idx to fixed_hdr_len because it is length of fixed header in rx_buffer, not an index to it
- removed the cpy_start as data always copied right after the fixed header
2019-01-30 14:29:21 +01:00
Simon Goldschmidt
ed561a578b
tcp: improve debug message a little
2019-01-30 14:27:16 +01:00
Simon Goldschmidt
3e59b224fa
tcpecho_raw: fix bogus pbuf_free on error
2019-01-30 14:20:16 +01:00
Dirk Ziegelmeier
4c19a909c2
Fix bug #55537 : Crash in SYN_SENT state when TCP_INPUT_DEBUG logs are ON
2019-01-28 14:21:34 +01:00
Dirk Ziegelmeier
941300c21c
Apply patch #9737 : Fix DHCPv6 DNS server assignment
2019-01-28 14:19:15 +01:00
Dirk Ziegelmeier
3efc43531b
Fix bug #55536 : lwIP 2.1.2: netconn_delete() called twice from lwip_accept()
...
netconn is deleted in free_socket() call
2019-01-28 14:13:52 +01:00
Dirk Ziegelmeier
a215eba50e
Add documentation on how to debug memory pool sizes
2019-01-28 14:05:05 +01:00
Dirk Ziegelmeier
8bf2e21b4d
TCP/UDP documentation: Add reference to PCB mempool #defines
2019-01-28 13:47:03 +01:00
Dirk Ziegelmeier
926e399355
Fix bug #55513 : Uninitialized variable in struct netconn
...
using patch from Karol Domagalski
2019-01-18 20:51:58 +01:00
Dirk Ziegelmeier
ea14b774c8
Replace several occurences of stdint types by lwIPs portability typedefs
...
Fixes bug #55405 : Usage of uint8_t instead of ui8_t in TCP code
2019-01-06 21:19:04 +01:00
Dirk Ziegelmeier
d504e27142
dhcp.c: Fix typo in debug message
2019-01-04 11:08:46 +01:00
Jacob Kroon
2f098c42a7
Fix compile of UDP unit test
...
Fix building unit tests via contrib/ports/unix/check on Debian 9, gcc 6.3.0.
Fixes:
<snip>/ip_addr.h:105:58: error: the comparison will always evaluate as ‘true’ for the address of ‘ip1’ will never be NULL [-Werror=address]
#define IP_SET_TYPE(ipaddr, iptype) do { if((ipaddr) != NULL) { IP_SET_TYPE_VAL(*(ipaddr),iptype); }}while(0)
Signed-off-by: Jacob Kroon <jacob.kroon@gmail.com >
2019-01-03 07:09:51 +01:00
Jacob Kroon
c02fea0961
PPP, PPPoE: use service name and concentrator name
...
Make pppoe_create() actually store the passed service name and
concentrator name, so that they are passed in the PADI/PADR/PADS
packets.
Assume that the user application won't be freeing the strings and just
copy the string pointers, therefore remove the mem_free() in
pppoe_destroy().
Since only the pointers are copied now, make them 'const' in
pppoe_softc.
Signed-off-by: Sylvain Rochet <gradator@gradator.net >
2018-12-20 13:24:04 +01:00
Sylvain Rochet
48615984c7
PPP, PPPoE: remove leftover from PPPOE_SCNAME_SUPPORT support
...
Stupid me managed to push a pending patch, remove it.
Signed-off-by: Sylvain Rochet <gradator@gradator.net >
2018-12-18 22:19:37 +01:00
Jacob Kroon
7eab5947af
PPP, PPPoE: fix build when PPPOE_SCNAME_SUPPORT is defined
...
lwip/src/netif/ppp/pppoe.c:768:24: error: pointer targets in passing argument 1 of ‘strlen’ differ in signedness [-Werror=poin$
l1 = (int)strlen(sc->sc_service_name);
lwip/src/netif/ppp/pppoe.c:772:24: error: pointer targets in passing argument 1 of ‘strlen’ differ in signedness [-Werror=poin$
l2 = (int)strlen(sc->sc_concentrator_name);
sc->sc_service_name and sc->sc_concentrator_name are best defined as
char* because there are passed to libc strings functions which expect
a char*.
Signed-off-by: Sylvain Rochet <gradator@gradator.net >
2018-12-18 22:13:46 +01:00
Sylvain Rochet
96548ede2b
PPP, PPPoE: rename PPPOE_TODO to PPPOE_SCNAME_SUPPORT, prepare service name and concentrator support
...
Rename PPPOE_TODO to PPPOE_SCNAME_SUPPORT because this is the only
feature enclosed by them. Prepare for proper service name and
concentrator name support by moving PPPOE_SCNAME_SUPPORT define to
ppp_opts.h.
Signed-off-by: Sylvain Rochet <gradator@gradator.net >
2018-12-18 22:09:48 +01:00
Dirk Ziegelmeier
2ff0db9a9b
Fix bug #55171 : Binding UDP PCB with different IP type PCBs does not work
...
by additionally checking IP address type
2018-12-06 14:40:57 +01:00
Dirk Ziegelmeier
91037b4c28
Add testcase for bug #55171 : Binding UDP PCB with different IP type PCBs does not work
2018-12-06 14:40:20 +01:00
Jasper Verschueren
75f33081c2
DEF: added lwip_strnistr() for case insensitive matching
2018-12-05 19:59:45 +01:00
Simon Goldschmidt
dcb29c591f
nd6: fix copying more than one DNS server
...
See bug #55163
2018-12-05 19:56:48 +01:00
Simon Goldschmidt
282389a332
altcp_tls_mbedtls: listen: free members of the ssl context
...
The ssl context is not used on listening pcbs. This includes freeing
input/output buffers, so saves ~32KByte by default.
2018-12-03 07:14:02 +01:00
Dirk Ziegelmeier
930eb27ba7
CMake: add debug info only for debug builds
2018-11-28 22:43:21 +01:00
Dirk Ziegelmeier
aaf7f03d95
List supported build types in top-level CMakeLists.txt
2018-11-26 09:26:37 +01:00
Dirk Ziegelmeier
0df4109074
Fix MSVC optimization flags
2018-11-26 08:11:39 +01:00
Dirk Ziegelmeier
781a4ccb62
mdns_domain.c: Fix doxygen comments
2018-11-25 14:39:31 +01:00
Dirk Ziegelmeier
c79af6e53e
Doxygen: Warnings are errors
2018-11-25 14:38:16 +01:00
Dirk Ziegelmeier
982b86fa48
CMake: Add support for Debug/Release builds
2018-11-25 14:25:23 +01:00
Dirk Ziegelmeier
92a18bf638
Fix bug #55078 : Add custom data to pbuf struct
...
Add a #define that users can use to store custom data on a pbuf
2018-11-25 14:01:23 +01:00
Simon Goldschmidt
3f583a1757
altcp_tls: add functions to create servers with multiple certificates
2018-11-24 13:41:34 +01:00
Simon Goldschmidt
6f232b7c3f
altcp_tls_mbedtls: add session tickes, improve configuration for session cache
2018-11-23 22:39:58 +01:00
Simon Goldschmidt
54448559bb
altcp_tls_mbedtls: add debug output of mbedtls library
2018-11-23 22:25:21 +01:00
Simon Goldschmidt
7859c6832b
makefsdata: fix compiling for win32
2018-11-23 12:59:07 +01:00
Axel Lin
d116d235a5
apps/smtp: Remove redundant LWIP_ASSERT checking in smtp_send_mail_bodycback
...
Signed-off-by: Axel Lin <axel.lin@ingics.com >
2018-11-23 19:28:24 +08:00
Dirk Ziegelmeier
b1fbb5ad45
Fix warnings about ignored return values in makefsdata.c
...
These only show up when compiling with -O3
2018-11-22 21:53:12 +01:00
Dirk Ziegelmeier
e31f1b918c
mdns.c: Fix accessing potentially uninitialized variable
...
myprobe_inpkt.pbuf may not be set to NULL in mdns_handle_probe_tiebreaking()
2018-11-22 13:36:20 +01:00
Dirk Ziegelmeier
45a055840d
snmp_traps.c: Portability fix: Don't use non-constant initializers
2018-11-22 13:25:43 +01:00
Dirk Ziegelmeier
5da6c0cfd0
CMake build system: Fix STREQUAL comparisons and set /Wall for MSVC
2018-11-22 13:25:43 +01:00
Craig McQueen
ef76bbe3f0
DNS: Allow a DNS look-up with a trailing dot in the name
...
Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de >
2018-11-22 13:14:41 +01:00
Simon Goldschmidt
9071db11af
snmp: don't allocat outbound msg for GET RESP (inform cb)
2018-11-22 12:54:50 +01:00
Simon Goldschmidt
ed59260b92
snmp: fix coding style
...
no need to initialize global static variables to NULL
2018-11-22 12:51:46 +01:00
Dirk Ziegelmeier
c23aa713f9
Try to fix compile warning in mdns.c
...
src/apps/mdns/mdns.c: In function 'mdns_debug_print_answer':
src/apps/mdns/mdns.c:796:24: warning: ', rdata = ' directive output may be truncated writing 10 bytes into a region of size between 8 and 15 [-Wformat-truncation=]
snprintf(string, 35, "Type = %2d, class = %1d, rdata = ", a->info.type, a->info.klass);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/apps/mdns/mdns.c:796:3: note: 'snprintf' output between 31 and 38 bytes into a destination of size 35
snprintf(string, 35, "Type = %2d, class = %1d, rdata = ", a->info.type, a->info.klass);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2018-11-22 11:37:24 +01:00
Dirk Ziegelmeier
10e0130a4a
netbiosns_name_decode: Take CONST char* as first argument
2018-11-21 21:03:36 +01:00
Jens Nielsen
b0c753da96
Fix netbiosns expecting too large packet
2018-11-21 20:50:35 +01:00
Dirk Ziegelmeier
30b2d07362
Fix compile error with GCC 8 in makefsdata
...
lwip/lwip/src/apps/http/makefsdata/makefsdata.c:929:56: error: ‘snprintf’ output may be truncated before the last format character [-Werror=format-truncation=]
snprintf(qualifiedName, sizeof(qualifiedName), "%s/%s", curSubdir, filename);
/home/dziegel/lwip/lwip/src/apps/http/makefsdata/makefsdata.c:929:3: note: ‘snprintf’ output 2 or more bytes (assuming 257) into a destination of size 256
snprintf(qualifiedName, sizeof(qualifiedName), "%s/%s", curSubdir, filename);
Reduce subdir string length by 3 bytes to make the warning go away. The whole file path including directory AND filename is limited to MAX_PATH_LEN - so it is reasonable to reserve 3 bytes less for directory - the filename won't fit anyway in the remaining 3 bytes.
2018-11-20 20:34:29 +01:00
Jasper Verschueren
ee1bab3411
mDNS: conflict resolution added
...
If the host observes a response (after probing) containing RR's
that he thought were unique to him, there is a conflict. If a host
observes such conflict, it resets back to probing and the probing
procedures will resolve the conflict. (RFC6762 section 9)
2018-11-20 12:49:58 +01:00
Simon Goldschmidt
3bd84aba4b
snmp_v3: use strlen, not strnlen
...
strnlen is not portable.
In this case, it does not matter as we zero-terminate the string before.
Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de >
2018-11-19 20:13:30 +01:00
Axel Lin
4413576494
doc/mdns.txt: Update document for mdns API changes
...
Update mdns.txt for below API changes:
* mdns_resp_add_netif() no longer has dns_ttl argument
* mdns_resp_add_service() no longer has dns_ttl arguemnt
* mdns_resp_add_service() uses enum mdns_sd_proto for proto argument
* Add missing const qualifier at appropriate places
Signed-off-by: Axel Lin <axel.lin@ingics.com >
2018-11-19 23:26:38 +08:00
Dirk Ziegelmeier
aa83bdf490
Fix bug #55034 : apps/smtp.c fails to compile with strict C compatibility because of strnlen
...
by replacing strnlen with strlen. It's a user-supplied string, so we can assume it is correctly \0 terminated (as done several times elsewhere in the code)
2018-11-19 14:43:26 +01:00
Dirk Ziegelmeier
4adcd68ce4
Fix compile of mdns.c
...
Add missing stdio.h for snprintf()
Fix variable declaration in code
2018-11-19 14:32:05 +01:00
Jasper Verschueren
19cbf2a652
mDNS: probe rate limiting if more then 15 conflicts occur in 10s
...
According to RFC6762 section 8.1:
If fifteen conflicts occur within any ten-second period, then the
host MUST wait at least five seconds before each successive
additional probe attempt.
If the host restarts mDNS, instead of a probe wait timeout randomly
chosen between 0 and 250ms, we wait 5s if more then 15 conflicts
occured in 10seconds. This flag is reset from the moment probing
succeeded.
2018-11-19 14:26:25 +01:00
Jasper Verschueren
593c02aed4
mDNS: probe tiebreaking added
...
mDNS: first version probe tiebreaking added
This first version works for our MCU boards but does only compare
the first question and answer. It does not sort the list of answers
and it does not search for answers or questions.
mDNS: improved probe question handling
For every probe question in our packet, we check the presence
in the incomming packet until we find a match. then we perform
the tiebreaking. At the moment we still only look at the first
answer.
mDNS: evaluate all answers in the authoritative section
The authoritative sections of both messages are evaluated.
The records that answer the probe question are sorted in to lists.
Then the lists are compared pairwise. A winner and a loser are
chosen and the host reacts on the outcome (ignore or stop probing).
mDNS: add support for name decompression in rdata when comparing.
For probe tiebreaking we need to compare RR's. It is possible that
the rdata of an RR contains compessed names (SRV record). We need
to decompress it first before we do the comparison.
2018-11-19 14:25:31 +01:00
Jasper Verschueren
a09646c507
mDNS: split probe packet definition and split outpkt creation
...
Probe packet creation -> by splitting the definition and the sending
we can use the definition function for probe tiebreaking.
outpkt creation -> by splitting the creation and sending we can use
the creation function for probe tiebreaking.
2018-11-16 14:52:40 +01:00
Simon Goldschmidt
2a236088ae
add new mdns files to win32 msvc project
2018-11-14 20:33:10 +01:00
Jasper Verschueren
861ce296b9
mDNS: respond to probe via multicast added
...
The host only responded to a probe query via unicast because
according to the RFC, a probe should have the QU bit on.
This is a should and not a must so we need to be careful.
We added multicast probe answering support with the needed timouts.
Avahi for example probes with the QM queries. With this commit the
conflict is resolved.
2018-11-14 16:52:17 +01:00
Dirk Ziegelmeier
530a4ccdce
Fix return value of sys_arch_mbox_tryfetch() in Win32 port
...
It should be SYS_MBOX_EMPTY, not SYS_ARCH_TIMEOUT.
SYS_MBOX_EMPTY is defined to SYS_ARCH_TIMEOUT, so there is no bug.
But for good readability of the code, SYS_MBOX_EMPTY should be used.
2018-11-13 20:35:53 +01:00
Dirk Ziegelmeier
915e923809
Fix bug #55017 : Wrong return value in sys_arch_mbox_tryfetch() in FreeRTOS port
2018-11-13 20:34:18 +01:00
Dirk Ziegelmeier
d386388fb5
Move netif_mdns_data() and get_mdns_pcb() to mdns_priv.h
2018-11-13 12:22:24 +01:00
Dirk Ziegelmeier
2adc6d2687
MDNS: Minor compile fix, declare variables before code
2018-11-13 12:20:57 +01:00
Jasper Verschueren
405fc4d802
Revert "mDNS: authority section of probe message needs to contain all records"
...
This reverts commit e959e6efaf8a1cb57e9a5d4d8e0056c7ea52179f.
2018-11-13 12:18:19 +01:00
Jasper Verschueren
ee7ed8c87d
mDNS: cleanup probing and announcing sequence
...
The implementation was not fully to the standard. This commit adds
a nicer state machine implementation and multiple announce messages
with a minimum of 2.
2018-11-13 12:18:04 +01:00
Jasper Verschueren
65eb36b10d
mDNS: ignore responses with src port != 5353 (rfc6762 section 6)
2018-11-13 12:17:38 +01:00
Jasper Verschueren
16da67bb21
mDNS: source address check added
...
RFC6762 section 5.5 and 11 define that we should check that all
packets originated on the local link.
2018-11-13 12:17:38 +01:00
Jasper Verschueren
331368e3aa
mDNS: add new files to filelists + solve compile errors
...
ttl setting removed from example code.
string.h included where needed.
2018-11-13 12:17:38 +01:00
Jasper Verschueren
201e772e15
mDNS: author comment update + things left to implement update
2018-11-13 12:17:38 +01:00
Jasper Verschueren
4289293061
mDNS: add support for output delaying
...
See below commit messages for more information
mDNS: support for direct and delayed sends
There are two ways to send a response, directly and after a delay.
A probe or an announce msg are now send via the direct way and
all responses are send via the delayed way.
mDNS improved delay vs direct send behavior on questions
All multicast answers are delayed at the moment. While all unicast
answers are send out directly. A unicast answer is send when this
is requested by the QU bit, when a unicast question was send or
when the question originated from a legacy querier.
mDNS: add probe query detection.
If a probe query is detected a direct unicast respond is send.
Independent of the QU/QM bit.
mDNS split delayed multicast msgs into ipv4 and ipv6 buffers.
We are implementing a two resolvers in one (IPv6 and IPv4 together).
For directly send answers, this does not matter. But for delayed
answers, we need to make a separate buffer for both.
mDNS: addr bug, we should not clear full outmsg
memset deleted also the dest_addr and dest_port, which should remain
and is constant. This commit contains a function that resets only the
needed parts of the outmsg struct.
mDNS: do not multicast a rr within one second.
RFC6762 section 6: prevent network flooding. When a multicast packet
is send out, we start a timeout of 1s within this 1 second all
multicast requests are ignored. We do not make a difference between
the records, we set the delay for all records.
mDNS: improved split for unicast vs multicast and direct vs delayed
unicast delayed message are now possible and multicast direct msgs to.
MDNS: changed printfs to lwip debug messages
MDNS: change timeouts from max time to random time
mDNS: send multicast response on QU questions if not multicasted recently.
If a QU question is received, the responder should multicast the
answer if it did not multicast that record within 25% of it's ttl.
we implemented a stripped down version, meaning that we look at the
records as one set and use one timer for all records. So if the
responder multicasted a record within 30s of the QU question it
will respond with a unicast answer. if not, it will respond
multicast.
mDNS: timeouts -> create function for mdns timeout handling
mdns_set_timeout will check if the timer is running or not and will
update the flag to running after starting the timer.
Multicast timeouts were not set everywhere they needed to be. This
is solved.
mulit <-> multi typo fixed.
mDNS: solve commenting and style issues
mDNS: add #if LWIP_IPVx to new code
LWIP_IPV4/6 can be enabled or disabled, all combination should work.
2018-11-13 12:17:37 +01:00
Jasper Verschueren
4ea5110662
mDNS: remove netif from mDNS structs
...
it's more practical to use netif as a wrapper instead of wrapping
netif in the mdns packets. netif contains all information.
Netif is passed along were needed.
2018-11-13 12:17:37 +01:00
Jasper Verschueren
62fb2fd749
mDNS fix TTL bug
...
MDNS_TTL changed to MDNS_IP_TTL for clarity.
The mDNS RR ttl does not need to be settalbe, this is against the
RFC. RFC6762 states that for rr's with the hostname in them
somewhere, the ttl should be 120s. If it's not in their it should
be 75 minutes and if the answer is send to a legacy dns querier,
it should be no more then 10s.
This patch corrects the ttl behavior to the RFC.
2018-11-13 12:17:37 +01:00
Jasper Verschueren
c4321330d0
mDNS: authority section of probe message needs to contain all records
...
see RFC 6762 section 8.2: for tiebreaking to work correctly in all
cases, the Authority section must contain all the records and
proposed rdata being probed for uniqueness.
2018-11-13 12:17:37 +01:00
Jasper Verschueren
3043d9d023
mDNS: move domain related functions and output related funtions
...
mDNS.c needed to become cleaner. Domain related functions are
moved to the mdns_domain.c util module. The output related
functions are split off (clear separation between defining the
packet and generating the packet). The output functions can
now be found in mdns_out.c.
mDNS move probe question packet generation to mdns_send_outpacket
The probe any questions were added to the pbuf in the send_probe
routine. It is better if we move all pbuf generation to the output
function so later on packets can be delayed etc. keep it all in
one place.
mDNS: move legacy question generation to mdns_send_outpacket
It's better to do the pbuf generation in one place.
Especially important for message delaying etc.
mDNS take out domain related functionality and put in other file.
The mDNS file is getting very big and a lot still needs to be added.
For clarity reasons it's better to split these domain functions
from the main mDNS file.
mDNS split off output related functionality and put in other file
A lot of functions are only needed for the generation of the pbuf,
by separating them into another file we clean up the mdns file.
We only need the mdns_send_outpacket function as interface.
Packet definition is now completely separated from packet
generation.
2018-11-13 12:17:36 +01:00
Simon Goldschmidt
1a10a942f2
tcp_recved: fix overflow check
...
Improved fix instead of patch #9699 .
Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de >
(cherry picked from commit 98d1cb1c00 )
2018-11-12 21:01:47 +01:00
Simon Goldschmidt
18b91b2841
Revert "tcp_recved: check for overflow and warn about too big values"
...
This reverts commit 684adaca29 .
It changes the behaviour to assert for applications running good so far.
Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de >
2018-11-12 21:01:05 +01:00
Simon Goldschmidt
a29fc52633
sync CHANGELOG after releasing 2.1.1
2018-11-09 17:23:17 +01:00
Axel Lin
292bd85db6
sockets: Trivial comment fixes
...
lwip_getsockopt_internal/lwip_setsockopt_internal were renamed to
lwip_getsockopt_impl/lwip_setsockopt_impl. Update the comment accordingly.
Signed-off-by: Axel Lin <axel.lin@ingics.com >
2018-11-09 17:14:20 +08:00
Simon Goldschmidt
1d2567c7bf
doc: update our docs for upload to savannah download area
2018-11-08 22:36:59 +01:00
Axel Lin
7bcf0d3334
sockets: Fix missing err_to_errno conversion for ERR_VAL in lwip_recvmsg
...
Signed-off-by: Axel Lin <axel.lin@ingics.com >
2018-11-08 22:43:51 +08:00
Dirk Ziegelmeier
7869d7c5f7
More snmp_traps.c documentation fixes
2018-11-08 08:35:39 +01:00
Dirk Ziegelmeier
98e31f7ba6
SNMP: Simplify two informs functions
2018-11-07 21:23:28 +01:00
Dirk Ziegelmeier
0e3bc53432
Fix comments in new SNMP code
2018-11-07 21:21:23 +01:00
Dirk Ziegelmeier
2e9c60b410
Fix unused variable in snmp_example.c when SNMP is disabled
2018-11-07 21:09:30 +01:00
Dirk Ziegelmeier
65033b6ba5
Apply patch for task #15072 : SNMP support for notifications and informs (v2c)
...
Original author: Ognjen Bjelica
with minor fixes from Dirk Ziegelmeier
2018-11-07 21:04:53 +01:00
Dirk Ziegelmeier
93c3cfd2b1
Fix initialization of mqtt example IP
2018-11-07 21:04:53 +01:00
Dirk Ziegelmeier
0df1559056
Improve comments in setup-tapif
2018-11-07 21:04:53 +01:00
Simon Goldschmidt
f72227aadc
fix compiling ETHARP_SUPPORT_VLAN without LWIP_HOOK_VLAN_SET and LWIP_VLAN_PCP
2018-11-07 10:49:06 +01:00
Simon Goldschmidt
153c295b6f
altcp_tls_mbedtls: use mbedtls_entropy_func for mbedtls_ctr_drbg_seed
...
This is the default way for mbedTLS. Add entropy sources via defines (see
mbedtls_entropy_init).
This removes the use of ALTCP_MBEDTLS_RNG_FN
Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de >
2018-11-06 21:28:45 +01:00
Dirk Ziegelmeier
fe05be110d
Unix port setup-tapif: Add bridge to TAP interface
2018-11-04 08:59:41 +01:00
Dirk Ziegelmeier
feee9d903a
Unix port: Give threads a name on Linux
...
May also work on Darwin, but I can't test it :-)
2018-11-02 20:22:22 +01:00
Dirk Ziegelmeier
ba8d9b0018
lwipopts.h: Raise number of UDP PCBs
...
Was not sufficient when all apps are enabled
2018-11-02 20:21:50 +01:00
Dirk Ziegelmeier
ba705d3f7f
Fix assertions in udpecho.c
2018-11-02 20:19:52 +01:00
Dirk Ziegelmeier
33325bbf3b
Make setup-tapif script executable
2018-11-02 19:32:39 +01:00
Joan Lledó
284659156d
Remove assertion about the end of pollfd array
...
See bug #54933 .
Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de >
2018-11-01 21:56:58 +01:00
Simon Goldschmidt
3c17c1e82e
fix typo in comment
2018-11-01 21:42:09 +01:00
Dirk Ziegelmeier
7c2267b966
Fix bug #54670 : 127.0.0.1 sent out to netif_default?
2018-11-01 21:36:24 +01:00
Dirk Ziegelmeier
48c2056d5b
Implement unit test for bug #54670 : 127.0.0.1 sent out to netif_default?
2018-11-01 21:35:46 +01:00
Dirk Ziegelmeier
0c34597b9e
netif: Add getter for loopif for unit tests
2018-11-01 21:35:06 +01:00
Dirk Ziegelmeier
26a84d9307
Minor: add parenthesis for cleaner code
2018-10-28 21:08:24 +01:00
Dirk Ziegelmeier
5698e57da3
VS code workspace: add unit tests
2018-10-27 22:35:54 +02:00
Florent Matignon
ffbe075d56
bug #54700 : Unexpected expiry of pending ARP table entry
...
New etharp queries should restart the 5 second timeout on the ARP
table entry if it is still pending.
Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de >
2018-10-26 20:59:10 +02:00
Simon Goldschmidt
fa37888da2
altcp_tls_mbedtls: update list of todos
...
Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de >
2018-10-26 20:43:06 +02:00
David GIRAULT
6e994f9df2
bug #54744 : if altcp_close() called from recv() callback, there is some write to freed memory
...
Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de >
2018-10-26 19:56:54 +02:00
Simon Goldschmidt
a352f4e11c
Explicitly check for TCP_MSS to be <= ~16 kByte
...
See bug #54890
Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de >
2018-10-26 19:43:13 +02:00
Simon Goldschmidt
a41c1fcc62
patch #9350 : Sockets API: use OS's sys/socket.h instead of lwip/sock
...
Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de >
2018-10-26 19:33:47 +02:00
Dirk Ziegelmeier
6b92dd6907
CMakeCommon.cmake: Add missing newline
2018-10-24 15:08:02 +02:00
Dirk Ziegelmeier
ec28364a2f
SNMP_ERR_NOTWRITABLE is a more appropriate return value for the last two commits
...
The instance of the SNMP node was found, that's why the functions have been called. So if set_test() and/or set_value() do not exist, it means the SNMP node instance is not writable.
2018-10-24 09:59:06 +02:00
Dirk Ziegelmeier
ee2f5c52d1
Fix the same issue as in snmp_scalar.c in snmp_threadsync.c
2018-10-24 08:54:08 +02:00
Dirk Ziegelmeier
36e2d2255e
Fix wrong return value in snmp_scalar_array_get_value()
2018-10-24 08:34:32 +02:00
Simon Goldschmidt
6a1fbc7433
snmp: fix coding style in last commit
2018-10-23 20:01:06 +02:00
Dirk Ziegelmeier
2e7b4573a5
SNMP: Avoid NULL pointer dereference in snmp_scalar.c
2018-10-23 14:26:29 +02:00
Simon Goldschmidt
ff8d1a384f
httpd: SSI types should be overridable (task #15071 )
...
Add define LWIP_HTTPD_SSI_EXTENSIONS to make the extension list
overridable, clarify documentation of LWIP_HTTPD_SSI_BY_FILE_EXTENSION
a bit.
Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de >
2018-10-23 08:17:45 +02:00
Simon Goldschmidt
f6b728b24c
makefsdata: obey LWIP_HTTPD_SSI_BY_FILE_EXTENSION
...
Don't check SSI extension list if LWIP_HTTPD_SSI_BY_FILE_EXTENSION == 0
Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de >
2018-10-23 08:16:49 +02:00
Simon Goldschmidt
688b0935e2
Try to catch missing std includes on travis
...
By defining LWIP_PLATFORM_ASSERT to a function, we can prevent arch.h
from including stdio.h and stdlib.h
Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de >
2018-10-23 08:00:37 +02:00
Simon Goldschmidt
a6cf42a937
fix compiling win32 port (packet.lib not found)
...
Library search path changed after moving contrib
Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de >
2018-10-23 07:59:00 +02:00
Simon Goldschmidt
ef02b1dc20
fix missing standard includes
...
These were a problem only if arch.h does not include them.
Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de >
2018-10-23 07:46:13 +02:00
Dirk Ziegelmeier
06cc825431
Whitespace cleanup lwIP
2018-10-22 20:53:58 +02:00
Dirk Ziegelmeier
64e0ede1a1
Whitespace cleanup in contrib dir
2018-10-22 20:53:58 +02:00
Simon Goldschmidt
e0e4240875
Revert "Allow the use of external Sockets headers"
...
This reverts commit 413b26a7e1 .
It breaks the build if LWIP_SOCKET is disabled.
Plus it breaks git history for inet.h and sockets.h for no real reason.
Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de >
2018-10-22 20:37:56 +02:00
Dirk Ziegelmeier
3aef9c5305
VSCode cleanups
2018-10-22 19:48:01 +02:00
Dirk Ziegelmeier
f53932d7ca
Travis: Remove "-j 4" command line option - does not make sense for ninja-build
2018-10-22 17:18:34 +02:00
Dirk Ziegelmeier
3f690e0bf0
Improve build system documentation
2018-10-21 20:30:48 +02:00
Dirk Ziegelmeier
95aba99f41
Implement task #11620 : Add outgoing VLAN PCP support for Ethernet level QoS
...
Apply rebased patch from Timmy Brolin
2018-10-19 22:30:17 +02:00
Dirk Ziegelmeier
64bc2c3df7
Fix bug #54805 : IP address can not be obtained over dhcp if PBUF_POOL_BUFSIZE is too small
...
Patch by Christoph Chang
2018-10-19 21:06:15 +02:00
Joan Lledó
413b26a7e1
Allow the use of external Sockets headers
...
New macro LWIP_SOCKET_HEADERS can be used to replace
LwIP sockets headers by OS's headers.
By default LWIP_SOCKET_HEADERS==LWIP_SOCKET, when LWIP_SOCKET==1
and LWIP_SOCKET_HEADERS==0, user must provide their custom headers
by setting LWIP_INCLUDE_SOCKETS and LWIP_INCLUDE_INET.
2018-10-19 20:30:24 +02:00
Dirk Ziegelmeier
5405c3d97d
Cleanup iteropts.sh output a bit
2018-10-18 22:36:59 +02:00
Dirk Ziegelmeier
c05b07c314
Fix iteropts test
2018-10-18 21:59:36 +02:00
Dirk Ziegelmeier
8f8c0d26ef
Try to find out what goes wrong on travis...
2018-10-18 21:22:47 +02:00
Dirk Ziegelmeier
ca8f0254cf
Try to get iteropts test running on Travis
2018-10-18 21:15:48 +02:00
Dirk Ziegelmeier
cf4cefd73c
Try to get ninja-build running on Travis
2018-10-18 11:05:07 +02:00
Dirk Ziegelmeier
23945d2e3f
Try to build documentation on travis, too
2018-10-18 10:58:29 +02:00
Dirk Ziegelmeier
daeceeeca0
Next try to get CMake up and running on Travis
2018-10-18 10:47:51 +02:00
Dirk Ziegelmeier
5840b090d4
Travis: Use CMake from /usr/local/bin
2018-10-18 10:33:35 +02:00
Dirk Ziegelmeier
95eada2119
Revert a change that was made for old cmake version
...
Lets see if it works now on travis...
2018-10-18 10:17:19 +02:00
Dirk Ziegelmeier
2e51e0dc81
Travis: Use newer CMake, install Ninja
2018-10-18 10:05:57 +02:00
Simon Goldschmidt
9171960c11
update ignore list
2018-10-18 09:04:38 +02:00
Simon Goldschmidt
0be3e35bf2
tftp: mode_to_string() should be static
2018-10-17 21:53:04 +02:00
Simon Goldschmidt
f098c4515e
tftp: added example for tftp client
...
Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de >
2018-10-17 21:39:37 +02:00
Simon Goldschmidt
0ee4784d0c
tftp client: pass 'mode' as an enum, not as a string constant
2018-10-17 21:37:46 +02:00
Simon Goldschmidt
4edbec760a
README: put wiki after mailing lists (it's not that good...)
2018-10-17 20:27:00 +02:00
Dirk Ziegelmeier
ee269ceec5
Fix bug #54850 : lwip definition of htonX and ntohX do not properly cast to unsigned when byte order is Big Endian
...
Changes suggested by Ivan Warren
2018-10-17 20:23:28 +02:00
Dirk Ziegelmeier
c2892ed0fb
Travis: Try to use Clang-7
2018-10-15 08:58:43 +02:00
Dirk Ziegelmeier
f99f304c20
Add special compile config for Travis
2018-10-14 09:44:12 +02:00
Dirk Ziegelmeier
8dd931ab27
Fix cyclic linking dependency when using MBEDTLS
2018-10-14 09:43:22 +02:00
Simon Goldschmidt
fa76861481
tftp: fix cast warnings; return all error codes
...
Also keep tftp_mode in tft_state
Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de >
2018-10-13 20:26:06 +02:00
Simon Goldschmidt
f272a75b6a
implement 'keypressed()' in the unix port
...
Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de >
2018-10-13 16:31:01 +02:00
Simon Goldschmidt
7c10065bd2
Revert "Try to implement platform-independent keypressed()"
...
This reverts commit a0d7b01186 .
The new 'keypressed()' wasn't platform-independent but broke
the win32 port.
Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de >
2018-10-13 16:26:25 +02:00
Dirk Ziegelmeier
a0d7b01186
Try to implement platform-independent keypressed()
2018-10-13 11:26:59 +02:00
Dirk Ziegelmeier
c35dd079ee
Adapt launch.json to top-level CMakeLists.txt
2018-10-13 11:26:32 +02:00
Dirk Ziegelmeier
31545ed787
Getting CMake build running on travis
2018-10-13 11:06:00 +02:00
Dirk Ziegelmeier
ea1337d5a2
Travis: Next try for CMake...
2018-10-13 10:57:26 +02:00
Dirk Ziegelmeier
31dbc5722c
Another try to get CMake run on travis
2018-10-13 10:54:54 +02:00
Dirk Ziegelmeier
22c1c4ec8d
Try to get CMake build running on travis
2018-10-13 10:45:58 +02:00
Dirk Ziegelmeier
d03d4c16fb
Travis/LSAN: reenable thread logging, sudo REQUIRED solved the problem
2018-10-13 10:32:37 +02:00
Dirk Ziegelmeier
d33098a8d8
Travis: Try sudo:required
2018-10-13 10:23:42 +02:00
Dirk Ziegelmeier
60afb13e60
Play with LSAN_OPTIONS
2018-10-13 10:00:18 +02:00
Dirk Ziegelmeier
f521d779fb
Work on Travis-CI
2018-10-13 09:49:48 +02:00
Dirk Ziegelmeier
ded63c12f1
Try to use more recent compilers on travis
2018-10-13 09:27:18 +02:00
Simon Goldschmidt
ed999f0195
Update travis-CI URL
2018-10-12 22:57:47 +02:00
Simon Goldschmidt
eeef3f65b8
Add a unit test for bug #54833 (tcp_abort with wrong ports)
...
Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de >
2018-10-12 22:57:24 +02:00
Simon Goldschmidt
a63a7d3c76
Fix bug #54806 (ppp: invalid LWIP_ASSERT_CORE_LOCKED() check)
...
pppos_input() is safe to call from outside tcpip_thread when
PPP_INPROC_IRQ_SAFE == 1, so only check if PPP_INPROC_IRQ_SAFE == 0
Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de >
2018-10-12 22:26:51 +02:00
Dirk Ziegelmeier
06016cc939
Disable CMake build for now, seems I need a newer CMake version
2018-10-12 22:22:35 +02:00
Simon Goldschmidt
426a6004bf
Revert "tcp_abandon: no need to buffer pcb->local_port"
...
This reverts commit 1570dd8ad1 .
Buffering pcb->local_port is needed because TCP_PCB_REMOVE_ACTIVE()
sets it to 0 via tcp_pcb_remove() (comment: "reset the local port
to prevent the pcb from being 'bound'").
Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de >
2018-10-12 22:14:23 +02:00
Dirk Ziegelmeier
1bba969a4a
Next try to fix CMake build on Travis
2018-10-12 22:12:07 +02:00
Dirk Ziegelmeier
1c5c2967e4
Try to fix Travis-CI CMake build
2018-10-12 22:06:10 +02:00
Dirk Ziegelmeier
6826130d6f
CMake: Use include_guard only when CMake >= 3.10.0
2018-10-12 22:01:25 +02:00
Dirk Ziegelmeier
a63b5aeaa7
Rename test.sh to travis.sh
2018-10-12 21:44:47 +02:00
Dirk Ziegelmeier
75bc361156
Add example app to travis (using cmake)
2018-10-12 21:42:41 +02:00
Simon Goldschmidt
0528f68c6d
Fixed the remaining dhcp unit tests after adding ACD
...
Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de >
2018-10-12 21:37:17 +02:00
Simon Goldschmidt
8d05e22f9a
Fix some dhcp unit tests after adding ACD, disable the rest
...
I disabled the yet unfixed tests to test if the new travis
integration works. Still working on them...
Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de >
2018-10-12 21:20:23 +02:00
Simon Goldschmidt
b406a54389
Fix mqtt unit test broken after 684adaca
...
Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de >
2018-10-12 21:18:39 +02:00
Simon Goldschmidt
e3cd915fb9
Fix whitespace error introduced when merging 684adaca
...
Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de >
2018-10-12 21:18:17 +02:00
Simon Goldschmidt
0d4e1beec4
Fix compiling ACD without LWIP_RAND
...
Copy bad rand implementation from old one in autoip.c
Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de >
2018-10-12 21:05:19 +02:00
Dirk Ziegelmeier
e16cc67b70
Fix Makefile-based builds
2018-10-12 20:43:22 +02:00
Simon Goldschmidt
39162c2d0c
Add new files to msvc projects
2018-10-12 20:32:34 +02:00
Dirk Ziegelmeier
5a8ad9d4ba
Make test.sh executable
2018-10-12 20:26:22 +02:00
Dirk Ziegelmeier
a3a4103d66
Start working on Travis-CI integration
2018-10-12 20:09:58 +02:00
Dirk Ziegelmeier
437e0a6756
Fix C++ style comments in TFTP
2018-10-12 14:27:31 +02:00
Jonas Rabenstein
d1da9ec5d3
err.h: move typedef of err_t after enum definition
...
This allows for 'typedef err_enum_t err_t' and thus strong type checking
of the enum in c++.
2018-10-11 07:32:55 +02:00
Jonas Rabenstein
684adaca29
tcp_recved: check for overflow and warn about too big values
2018-10-11 07:31:54 +02:00
Dirk Ziegelmeier
f61e57965f
Minor coding style fix in tftp.c
2018-10-09 09:07:08 +02:00
Dirk Ziegelmeier
27835fd798
Minor build system docs improvments
2018-10-08 22:19:31 +02:00
Dirk Ziegelmeier
ef5bc352fb
Document CMake build system
2018-10-08 22:17:03 +02:00
Dirk Ziegelmeier
65b1a395f4
TFTP: Fix doxygen docs
2018-10-08 22:16:40 +02:00
Dirk Ziegelmeier
a6dc31433e
Restructure CMake build system a bit
...
This should be easier to use for application devlopers
2018-10-08 21:18:18 +02:00
Dirk Ziegelmeier
cba4e1f2a7
CMake: MBEDTLSDIR -> LWIP_MBEDTLSDIR
2018-10-08 21:17:32 +02:00
Dirk Ziegelmeier
2124becd04
Give lwIP a top-level CMakeLists.txt
...
(as it is common in other projects)
This breaks iteropts.sh for now
2018-10-08 21:02:43 +02:00
Dirk Ziegelmeier
abcf42b655
Fix compile of TFTP using GCC
2018-10-08 20:21:32 +02:00
Dirk Ziegelmeier
c8808f69b2
Fix tftp_init_client signature
2018-10-08 12:56:27 +02:00
Dirk Ziegelmeier
5a8bd37509
Improve TFTP comments
2018-10-08 12:48:16 +02:00
Dirk Ziegelmeier
6c2fd2d25d
Improve TFTP implementation
...
- implement server/client mode (API is nicer to use)
- Increase TFTP_MAX_MODE_LEN to be able to contain "netascii" transfer mode
- Adapt tftp_example to changes
2018-10-08 12:45:29 +02:00
Dirk Ziegelmeier
de81e8bf19
VS Code again: Fix tasks.json for windows
2018-10-08 11:42:52 +02:00
Dirk Ziegelmeier
54fc708c76
Apply fix from Axel Lin
...
(Build issue if LWIP_DHCP is set to 0)
2018-10-08 11:42:28 +02:00
Dirk Ziegelmeier
7ba69d875c
Some TFTP cleanups
2018-10-08 11:41:51 +02:00
Ben Wijen
b2713601f0
tftp: Add client functionality
...
* add helper functions
* add tftp_get/tftp_put
* rename files
2018-10-08 09:00:20 +02:00
Joan Lledó
c683427bfd
alloc_socket(): Check for LWIP_SOCKET_POLL when setting select-related variables
2018-10-08 08:51:55 +02:00
Dirk Ziegelmeier
0f100b8c5b
VSCode: Fix windows command line
2018-10-08 08:14:55 +02:00
Dirk Ziegelmeier
ff44049baf
Rename DHCP_DOES_ACD_CHECK ->LWIP_DHCP_DOES_ACD_CHECK
2018-10-05 11:04:48 +02:00
Dirk Ziegelmeier
a3cdf3c4cc
Move two #defines from acd.h to acd.c since they are only useful in there
2018-10-05 10:58:30 +02:00
Dirk Ziegelmeier
015cff75fd
Fix "switch missing default case" in dhcp.c
2018-10-05 10:49:21 +02:00
Dirk Ziegelmeier
7492bfb0dc
Enable DHCP_DOES_ACD_CHECK by default
2018-10-05 08:38:13 +02:00
Dirk Ziegelmeier
67d4fc9ff0
Minor cmake code cleanp
2018-10-05 08:04:22 +02:00
Dirk Ziegelmeier
d9c9b55766
CMake: add an include guard since files are intended to be included in other projects
2018-10-05 08:02:34 +02:00
Dirk Ziegelmeier
1f554efcbb
Add ACD to several documents
2018-10-04 21:13:32 +02:00
Dirk Ziegelmeier
d4c8b3e7e8
Apply patch #9694 : Update prev pointer when skipping entries in tcp_slowtmr to prevent hitting assertion
2018-10-04 17:38:17 +02:00
Dirk Ziegelmeier
5c4ada2098
Add VS Code workspace settings
2018-10-04 17:34:44 +02:00
Dirk Ziegelmeier
562f875533
Work on VS Code settings
2018-10-04 17:34:44 +02:00
Dirk Ziegelmeier
9a80c865b0
Filelists.cmake: Minor message improvement
2018-10-04 17:34:44 +02:00
Dirk Ziegelmeier
9c86302113
acd.h: No "," at last enum element
2018-10-04 17:34:44 +02:00
Dirk Ziegelmeier
f8ed17082d
A few ACD compile and doc fixes
2018-10-04 17:34:44 +02:00
Jasper Verschueren
7d1c26cc0c
ACD module added + update and improve DHCP + AUTOIP behavior
...
Squashed commit of the following:
commit 2d98d8e2ef1941c3824ffb874f1e529d284667fc
Author: Jasper Verschueren <jasper.verschueren@apart-audio.com >
Date: Thu Sep 13 16:15:06 2018 +0200
AUTOIP: correct functionality autoip_supplied_address
It does not mean that if autoip is bound, it also supplied the
netif address. A check is added.
commit 2ca0a2183991ef73860c4207d95799b37acc64cc
Author: Jasper Verschueren <jasper.verschueren@apart-audio.com >
Date: Thu Sep 13 16:06:49 2018 +0200
AUTOIP: keep using the same link local address as much as possible
Only calculate a new link local address at start up or when a
conflict occured. On link up or down -> keep same address.
TODO: in the future a function for persistent storage should be
added.
commit aa70a693351e4c898aa28d8521308794614838f1
Author: Jasper Verschueren <jasper.verschueren@apart-audio.com >
Date: Thu Sep 13 14:43:14 2018 +0200
ACD, AUTOIP & DHCP: make link up & down functions where needed
When the link goes down or up the approriate functions should be
stopped or started again. To accomodate this, network_changed is
adjusted to network_changed_link_up and network_changed_link_down.
DHCP does not need to control AUTOIP. AUTOIP can take care of
itself. The only thing DHCP needs to do is starting it when
discovering is failing. The AUTOIP state variable is removed from
DHCP.
commit ad469eb006b47f8a8c37f7c0de0216f47a8c19c7
Author: Jasper Verschueren <jasper.verschueren@apart-audio.com >
Date: Thu Sep 13 11:25:58 2018 +0200
ACD: add address change listener + passive conflict detection mode
In the case their previously was a LL address on a netif that
is now configured with a routable address, we want the LL
address to be able to keep receiving packets.
for as long as the LL address is available on the interface it
should do ongoing conflict detection. But we cannot defend when
the LL address is not the netif address any more.
An address change listener is added to detect when an ACD module
needs to go from active ongoing conflict detection to passive.
When a conflict is detected autoip is stopped and will not be able
to receive packets any more. Because we have a valid routable
address on the netif, autoip is not restarted.
commit 07c4ec20cea78e2b4a6f5599569abaf075619c62
Author: Jasper Verschueren <jasper.verschueren@apart-audio.com >
Date: Tue Sep 11 16:25:37 2018 +0200
ACD: make module reusable within a netif
DHCP and AUTOIP both have ACD running simultaniously. The ACD
struct is added to the DHCP and AUTOIP structs. In the netif a list
of ACD modules is kept to loop over if functions need to perform
some action on all ACD modules (for example tmr function). With
acd_add a module can be added to the list. ACD_FOREACH loops over
the list similar to NETIF_FOREACH.
commit ee3b4585b7768f5353dd80190a2929bad45f7ff4
Author: Jasper Verschueren <jasper.verschueren@apart-audio.com >
Date: Mon Sep 10 16:36:18 2018 +0200
etharp & acd: add probe and announce functions to etharp.
The new probe and announce functions are independent of
netif->ip_addr. This means we can keep the LL address working
while we start to probe for the newly received routable address.
The netif->ip_addr does not need to be any for probing to work
with this patch.
commit 7d3032bae8f1b8081368a807682388eb642729e0
Author: Jasper Verschueren <jasper.verschueren@apart-audio.com >
Date: Mon Sep 3 13:35:51 2018 +0200
autoip -> unused random function removed + small comment update
commit be749ba4eb26ddc69233c85d532dc035741275c5
Author: Jasper Verschueren <jasper.verschueren@apart-audio.com >
Date: Fri Aug 31 16:37:36 2018 +0200
ACD: update comment in header
commit 4491842991c90b3a58fa327f70aa42f04174546b
Author: Jasper Verschueren <jasper.verschueren@apart-audio.com >
Date: Fri Aug 31 15:44:45 2018 +0200
ACD: subscribe to link down messages to stop the acd process
When the link goes down the acd process should be stopped
independent of the acd client. Otherwise the acd will keep probing
or announcing while their simply is no connection.
commit 71f668aa7583354e132c20b3b50ba2c86bf08738
Author: Jasper Verschueren <jasper.verschueren@apart-audio.com >
Date: Fri Aug 31 13:59:44 2018 +0200
DHCP coop autoip bug fix: wait after last discovery before starting autoip
After the last dhcp discovery we need to give the dhcp server the
time to respond. Currently the discovery message is send and autoip
is started simultaniously. This is changed. Autoip will now be started
after the next discovery timeout.
commit 0da16604ec079195533f2591f0d0f04bdf212a72
Author: Jasper Verschueren <jasper.verschueren@apart-audio.com >
Date: Fri Aug 31 11:23:31 2018 +0200
ACD: rate limit interval bug solved -> first decline then wait then restart.
According the the ACD RFC we need to limit the rate of acquiring
and probing addresses after MAX_CONFLICTS. It is important to first
decline the address and stop the netif from using the address before
the time is started. After this rate limit time, the address acquiring
process can be started again.
To make this possible we had to change the callback function and
the location in the process were the rate limiting is done.
commit a89a0601a251acb14abe270116f38c6d25c2d7a9
Author: Jasper Verschueren <jasper.verschueren@apart-audio.com >
Date: Thu Aug 30 17:27:10 2018 +0200
DHCP: after a succesful dhcp_reboot, the address should be probed.
Reboot means that the connection was gone for some amount of time.
This is seen as a new connection for the ACD module so should be
the address should be probed before use.
commit 853afb448ba35c6e2b35e8238c9c367c599dece7
Author: Jasper Verschueren <jasper.verschueren@apart-audio.com >
Date: Thu Aug 30 17:19:12 2018 +0200
DHCP_DOES_ARP_CHECK changed to DHCP_DOES_ACD_CHECK
small update in opt.h to add the correct dependencies.
commit e28b4766bdef69e76f6170c470c93f5b251c579a
Author: Jasper Verschueren <jasper.verschueren@apart-audio.com >
Date: Thu Aug 30 17:05:43 2018 +0200
DHCP check code replaced by ACD module.
when DHCP_DOES_ARP_CHECK is enabled, the ACD module will take care
of address conflict detection. Via a call back function the DHCP
state machine will continue and bind to an address if no conflicts
are found.
dhcp_arp_reply is obsolete because the ACD module replaces its
function.
commit 52193a0f5d13e8786a4db2fff1f1a8f1367a4eba
Author: Jasper Verschueren <jasper.verschueren@apart-audio.com >
Date: Mon Aug 27 16:05:22 2018 +0200
Issue 2 + 3 from Comment #5 , task #13508 solved
Removed C++ comments and // ----... marks as requested.
commit 7faaf61275d67ccfb88ea7e26c249428c3088536
Author: Jasper Verschueren <jasper.verschueren@apart-audio.com >
Date: Mon Aug 27 15:55:24 2018 +0200
Issue 1 from Comment #5 , task #13508 solved
Comments added to clarify how arp messages are handled.
commit 9348aea22623b705759fd30b873f06a50a104d16
Author: Jasper Verschueren <jasper.verschueren@apart-audio.com >
Date: Tue Jul 24 11:45:35 2018 +0200
acd: add comment for callback function
commit 49fdd1177c05b74d49fa179564dcaa5e650adbcc
Author: Jasper Verschueren <jasper.verschueren@apart-audio.com >
Date: Tue Jul 24 11:42:59 2018 +0200
autoip: Add debugging output and complete comments
commit 591856b82c029687a657a1b1ccc674522e6f4be0
Author: Jasper Verschueren <jasper.verschueren@apart-audio.com >
Date: Tue Jul 24 11:25:18 2018 +0200
Removed autoip from timeouts.c
We do not need a timer anymore. All timing is part of acd.
commit 3b3272fdd14015cfca0b3b6d149505b1cf0e36b6
Author: Jasper Verschueren <jasper.verschueren@apart-audio.com >
Date: Tue Jul 24 11:22:32 2018 +0200
autoip_network_changed -> first bring down the netif and then acd
Make it do what it says in the comment
commit 77b0ccf96efd22774279c6f9b5bade18c5e42c59
Author: Jasper Verschueren <jasper.verschueren@apart-audio.com >
Date: Tue Jul 24 11:21:23 2018 +0200
Simplified the autoIP states + update autoip_start()
commit 96e0581d36857f8b70c4b4cce4fb323fd3dd51ab
Author: Jasper Verschueren <jasper.verschueren@apart-audio.com >
Date: Tue Jul 24 11:10:48 2018 +0200
Deleted unused variables, functions and defines from autoip module
The functionality is now embedded in the acd module so can be
removed from autoip.
commit 9296e2ebb4b51019aaccfc47e8b9f51b265d37cd
Author: Jasper Verschueren <jasper.verschueren@apart-audio.com >
Date: Tue Jul 24 11:07:34 2018 +0200
Bug fix acd -> rate limiting needs to be after MAX conflicts
It was only after MAX conflicts + 1.
commit c55e16903c045d0ea84336b50eccbf24d3d097e9
Author: Jasper Verschueren <jasper.verschueren@apart-audio.com >
Date: Mon Jul 23 17:52:45 2018 +0200
Small intruduction to module added
commit d1498a37293bd9f97f6b938b48e5980ab0a01bd1
Author: Jasper Verschueren <jasper.verschueren@apart-audio.com >
Date: Mon Jul 23 17:49:58 2018 +0200
Copyright information added
I based the copyright text on the other files. I'm not sure this
is how its done. I kept Dominik in their because I copied quite
some code from the autoip module.
commit 359a845ef5e73061832069f364b370634ee0b071
Author: Jasper Verschueren <jasper.verschueren@apart-audio.com >
Date: Mon Jul 23 17:08:44 2018 +0200
Fixing comments in acd.c
commit 100d72549d0ef44157143d031848a727f5dfbe69
Author: Jasper Verschueren <jasper.verschueren@apart-audio.com >
Date: Mon Jul 23 15:43:40 2018 +0200
Probe wait time and Probe interval time made random via lwip_rand
According to the RFC a random amount of time needs to be waited
before probing can be started also a random amount of time
needs to be waited between the probes.
The random time is calculated via the LWIP_RAND function (see
lwipopts and sys_arch).
commit f7f037c32e9416f8b803c3c7af617b871b55ee35
Author: Jasper Verschueren <jasper.verschueren@apart-audio.com >
Date: Tue Jul 17 16:56:48 2018 +0200
autoip will start probing again when the network has changed
commit 1f40f6274195f24aa1b05caf82b79285ad189c2a
Author: Jasper Verschueren <jasper.verschueren@apart-audio.com >
Date: Tue Jul 17 16:55:47 2018 +0200
Duplicate code removed -> already present in autoip_start
commit be59431271da862a8ca330dbca638842c87765bc
Author: Jasper Verschueren <jasper.verschueren@apart-audio.com >
Date: Tue Jul 17 16:52:49 2018 +0200
add rate limiting to acd when too many conflicts are detected.
When more then max conflicts are detected during device on time,
the rate at which probing for a new address starts is limited.
For clarity we combined the conflict counting and the callback into
a new function acd_restart.
commit 91448455e95edb24c1f418c341b6fb306391f4f1
Author: Jasper Verschueren <jasper.verschueren@apart-audio.com >
Date: Tue Jul 17 15:50:01 2018 +0200
ARP packet conflict detection added.
If a conflict is detected between the begin until after announce
wait, a new address needs to be chosen immediatly.
This can occur in two situations:
1) another host already has this ip address
2) another host is also probing for the same address.
If a conflict is detected during announcing or during the ongoing
conflict detection, we defend our ip address once. If a second
conflict occurs during defend interval, we take another ip address.
If not we can keep our address and connections.
When a conflict occurs and it's decided we need a new address,
autoip is simply restarted. To do: test if a acd stop is needed.
This will become more important when DHCP is added I believe.
commit 65f47ba9444d8b9f767dc908319579323eeb8664
Author: Jasper Verschueren <jasper.verschueren@apart-audio.com >
Date: Tue Jul 17 15:33:44 2018 +0200
Update ACD state machine with PROBE_WAIT and and ANNOUNCE_WAIT
By adding the ANNOUNCE_WAIT state, we could remove duplicate code
that was present in the original autoip state implementation.
But because we cannot directly go to ANNOUNCING we needed this
extra state during the wait period. It also makes the different
states clearer.
Their is no need to number the enum because the compiler takes
care of this standard numbering.
Also a indent issue on the state machine code is solved here.
commit 2d9f4414c7b1f2ed35c0b5cea78dabb9c9afee77
Author: Jasper Verschueren <jasper.verschueren@apart-audio.com >
Date: Tue Jul 17 15:28:33 2018 +0200
Added an extra check for etharp responses.
Their is no need to answer a request that is initiated by ourselves.
In my test case, a conflicting request would be seen here as a
request needing a reply. Which off course isn't needed at all.
The acd module will let the requester know that it is using our
ip address.
I could not think of a reason not to add this extra check but please
check if this doesn't break other functionality.
commit f84cc1dba4061219bd1aadb97bd340278db07cd7
Author: Jasper Verschueren <jasper.verschueren@apart-audio.com >
Date: Tue Jul 17 15:27:13 2018 +0200
Redirect all incoming ARP messages to the ACD module.
The ACD module will scan the packets and react on conflicts.
autoip does not need the arp packets any more.
commit 9faf266993cc2df0b9434720b59b5922f17d7d33
Author: Jasper Verschueren <jasper.verschueren@apart-audio.com >
Date: Tue Jul 17 10:08:39 2018 +0200
Initiate acd from autoip implementation.
The state machine in autoip is now replaced by the acd module.
commit 40a5a40d911c98e6ee8566c0adce7716f26f20e0
Author: Jasper Verschueren <jasper.verschueren@apart-audio.com >
Date: Tue Jul 17 10:05:59 2018 +0200
Add simple acd state machine to timer function.
This state machine will be started from acd_start and will go
through the probing and the announcing state. At this moment the
timings are made fixed for easy debugging. Will be made variable
afterwards.
commit 0a2629bf1f7942e80ec11bcc3e163ac1a2b9a580
Author: Jasper Verschueren <jasper.verschueren@apart-audio.com >
Date: Tue Jul 17 09:44:19 2018 +0200
Disable gratuitous ARP send from netif_issue_report when acd is enabled
The acd module needs to be fully under control on what arp messages are
send. It wouldn't be a clean solution if we kept this announce as one
of the announce messages.
So when ACD is enabled, this message will not be send.
commit a7b9a4d5039168723c2043677176c5c8fc69f8df
Author: Jasper Verschueren <jasper.verschueren@apart-audio.com >
Date: Tue Jul 17 09:42:46 2018 +0200
ARP probe and announce functions added.
Both use etharp_requests to send out an arp message.
commit e2f1ce3fa84e2ce01bc944d8049412e156cd7cc7
Author: Jasper Verschueren <jasper.verschueren@apart-audio.com >
Date: Tue Jul 17 09:26:07 2018 +0200
Add conflict callback mechanism to acd module
When starting the acd with acd_start, a conflict callback has to be
provided. After probing when no conflict is detected, the callback
is called with the conflict variable on 0. From the moment a conflict
is detected, it will be called set to 1.
By not making a fixed link between acd, autoip and dhcp but working
with callback functions the user (caller) can easily use it for
fixed ip too. This keeps the acd module completely independent from
the other application layer protocols.
commit 21e7995888d2941601e99873ee129d1ea927e3f7
Author: Jasper Verschueren <jasper.verschueren@apart-audio.com >
Date: Mon Jul 16 14:41:52 2018 +0200
acd_stop function added.
When calling this function the acd state machine will be put in
ACD_STATE_OFF. This will disable the acd functionality until
acd_start is called.
commit 503037fb462504e46a14ce7486bc763dbc6a8690
Author: Jasper Verschueren <jasper.verschueren@apart-audio.com >
Date: Mon Jul 16 14:35:48 2018 +0200
acd_start function added
This function will allocate a struct for the acd module if one wasn't
added with acd_set_struct. It will then initialize the acd struct
and start the probe wait timer (for now fixed).
commit e439f6dffc44e93078a2976783bdebfe17304d8c
Author: Jasper Verschueren <jasper.verschueren@apart-audio.com >
Date: Mon Jul 16 14:22:39 2018 +0200
ACD_DEBUG define added for enabling / disabling debug messages.
commit 80d33e1eaf092934ace1045fac096464cd5be5e9
Author: Jasper Verschueren <jasper.verschueren@apart-audio.com >
Date: Mon Jul 16 11:39:37 2018 +0200
ACD struct added together with set struct function
ACD needs some variables: state, timing, probe counter etc.
We added the struct as netif data. For now one ACD module per netif
is enough. We found some unclarities about ACD with multiple IP
address on one interface. For now, ACD will only be implemented for
the IP address that is going to be used / is being used on the netif.
commit 2c4cca36744973318c3efe7cbae6384b52dc71a8
Author: Jasper Verschueren <jasper.verschueren@apart-audio.com >
Date: Mon Jul 16 11:35:06 2018 +0200
Add acd timer to timeouts.c with interval of 100ms.
This timer will be used for time to wait counting etc.
Very similar to the auto ip timer.
commit e2ed447e00c4df790df21509acb4ab09b5b79e66
Author: Jasper Verschueren <jasper.verschueren@apart-audio.com >
Date: Fri Jul 13 16:56:39 2018 +0200
Add ACD protocol definitions
commit 445733214460eae18817556439bed979e9b3747c
Author: Jasper Verschueren <jasper.verschueren@apart-audio.com >
Date: Fri Jul 13 16:07:58 2018 +0200
Add c++ option (to use C code module in c++)
commit 63d78bc1f77ac6698c3d663a1c67b40a0c297125
Author: Jasper Verschueren <jasper.verschueren@apart-audio.com >
Date: Fri Jul 13 15:57:34 2018 +0200
Added on off option for ACD module
commit d5ec4b69eb4175d4dd569bcfc80ae0e192780015
Author: Jasper Verschueren <jasper.verschueren@apart-audio.com >
Date: Fri Jul 13 15:09:40 2018 +0200
ACD IPv4 module files added
The files for IPv4 ACD or Address Conflict Detection are added
to the lwip source.
2018-10-04 17:34:44 +02:00
Simon Goldschmidt
164210ab73
fix mbedtls with msvc project files after merging contrib
...
Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de >
2018-10-03 15:13:57 +02:00
Martine Lenders
a47d30ffc7
lowpan6.c: Fix IEEE 802.15.4 address setting
...
Reverts a regression introduced in
3a8af612b3 :
Use hardware address fetched from neighbor cache *not* the hardware
address of the interface as destination address.
Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de >
2018-10-03 14:38:58 +02:00
Simon Goldschmidt
a5c00e369d
fix msvc project files after merging contrib
...
Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de >
2018-10-03 14:38:04 +02:00
Dirk Ziegelmeier
787a7bb919
Start creating a VSCode workspace
2018-10-02 20:50:37 +02:00
Dirk Ziegelmeier
730b3d3f86
Add contrib subdir to FILES
2018-10-02 13:15:41 +02:00
Dirk Ziegelmeier
0ef2514b6a
Remove unmaintained contrib/ports/FILES
2018-10-02 13:08:12 +02:00
Dirk Ziegelmeier
7bd2c565e6
CMake: Make MBEDTLSDIR and WPDPACK_DIR (Win32) overridable
2018-10-02 13:06:01 +02:00
Dirk Ziegelmeier
04ff7926e7
CMake build system: It is now sufficient to set LWIP_DIR for build
2018-10-02 12:54:56 +02:00
Dirk Ziegelmeier
4b672a1f3c
Adapt several comments to contrib rep move
2018-10-02 12:42:14 +02:00
Dirk Ziegelmeier
8068aab9f7
Commit new version info in doxygen file and init.h
2018-10-02 12:35:06 +02:00
Dirk Ziegelmeier
0244dc714b
Work on fixing the build (integration of contrib)
2018-10-02 12:34:26 +02:00
Dirk Ziegelmeier
ac46e42aa2
Import lwIP contrib rep
...
... from http://git.savannah.gnu.org/cgit/lwip/lwip-contrib.git/ into contrib/ subdir, STABLE-2_1_0_RELEASE tag
lwIP contrib is now officially frozen
TODO: Fix build
2018-10-02 12:19:13 +02:00
Dirk Ziegelmeier
dd1ab2bf59
lwIP 2.2.0 development cycle start now
2018-09-30 09:02:15 +02:00
Simon Goldschmidt
e6a8415df3
Prepare 2.1.0 release
...
Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de >
2018-09-26 21:11:39 +02:00
Simon Goldschmidt
54a8112eb9
Documentation improvements for 2.1.0 (changelog, altcp)
2018-09-26 14:37:52 +02:00
Simon Goldschmidt
b9fc8cae68
Documentation improvements for 2.1.0 (mainly altcp/altcp_tls)
2018-09-24 22:44:32 +02:00
Simon Goldschmidt
a044c807f8
altcp_tls: rename altcp_tls_new -> altcp_tls_wrap, add altcp_tls_new
...
The new altcp_tls_new() is a type safe version of altcp_tls_alloc()
Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de >
2018-09-24 22:29:54 +02:00
Simon Goldschmidt
6229f9ef71
icmp_send_response: fix parameter order for LWIP_HOOK_IP4_ROUTE_SRC
2018-09-17 21:28:50 +02:00
Simon Goldschmidt
66838a70f3
more documentation preparations for v2.1.0 release
2018-09-17 21:16:58 +02:00
Simon Goldschmidt
dea74a24aa
Fix CHANGELOG consistency from 2.0.3 branch to 2.1.0
2018-09-16 21:41:33 +02:00
Simon Goldschmidt
effdeef2fe
some preparations for v2.1.0 release
2018-09-16 21:17:40 +02:00
Simon Goldschmidt
c18df357d9
some preparations for v2.1.0 release
2018-09-14 21:32:11 +02:00
Simon Goldschmidt
74c5ac7302
cpack: change file name of generated sources file
...
This should match the old release ZIPs: "lwip-x.y.z.zip"
Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de >
2018-09-13 21:54:58 +02:00
Simon Goldschmidt
0189e7b02f
mqtt: allow user + pass longer than 255 chars
...
See bug #54655 :
"MQTT brokers such as Google Cloud IoT Core requires MQTT clients
to send JSON Web Token (JWT) as password field of the MQTT Connect
packet. JWT can be more than 255 bytes.
Currently, the MQTT library restricts password to be less than 256
bytes, thus it prevents connectivity to Google Cloud IoT Core."
Fix that by just converting the local variables for these from u8_t
to u16_t.
Suggested-by: Richmond Umagat <richmond.umagat@brtchip.com >
Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de >
2018-09-13 14:59:08 +02:00
Dirk Ziegelmeier
796f98beb2
Fix no newline at end of http_client.c
2018-09-12 22:41:07 +02:00
Simon Goldschmidt
fc24d4139f
altcp_tls_mbedtls: convert #error on too small TCP_WND to warning
...
Many TLS use cases are OK with a small TCP_WND, so don't prevent these
by having a preprocessor check that cannot be disabled.
2018-09-12 22:24:05 +02:00
Simon Goldschmidt
bbf80b05c8
ppp: fix implicit conversion from size_t to u8_t
...
Found when compiling with VS2017
2018-09-12 22:22:10 +02:00
Simon Goldschmidt
bc48eb512e
Fix bug #54506 (LWIP_CHECKSUM_ON_COPY causes wrong checksum (0xFFFF))
...
one's complement sum was not correctly done, which could result in the
checksum being 0xFFFF instead of 0 in some cases.
2018-09-12 21:56:16 +02:00
Dirk Ziegelmeier
cdfa3dfa9d
http_client.c: Fix compile when TCP is disabled
2018-09-12 08:27:43 +02:00
Dirk Ziegelmeier
be18fa98e4
Fix cleanup of existing documentation of target lwipdocs
2018-09-11 08:16:01 +02:00
Dirk Ziegelmeier
257dc1d6fd
Fix doxygen warnings in altcp_proxyconnect.c
2018-09-10 13:30:50 +02:00
Dirk Ziegelmeier
236d6df495
Fix lwipdocs target in Filelists.cmake
...
EXCLUDE_FROM_ALL is not supported at add_custom_target()
2018-09-10 13:28:01 +02:00
Simon Goldschmidt
93b2074f2b
Remove LWIP_DHCP_CHECK_LINK_UP define as it's useless
...
See bug #54574
Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de >
2018-09-07 21:01:32 +02:00
Simon Goldschmidt
7749088a83
Fix 2way-auth connections for TLS clients
...
TLS clients that need 2-way authentication (e.g. Amazon AWS IoT cloud mqtt)
need to pass a certificate and private key when creating the tls altcp_pcb.
Added a new function altcp_tls_create_config_client_2wayauth() for this that
replaces altcp_tls_create_config_client() for such clients.
See bug #54601 .
2018-09-07 20:59:31 +02:00
Dirk Ziegelmeier
24fc93e12f
Remove checks that the SO_* socket options and SOF_* lwIP-internal flags match
...
not needed any more since commit b0344518e8
"sockets.c: Don't rely on #defines in socket.h to be in sync with ip.h
Map SO_* to SOF_* #defines"
Reported by Joan Lledó on mailinglist 6.Sep.2018
2018-09-07 10:01:59 +02:00
Martine Lenders
264b89764d
Make zepif dependent on LWIP_UDP config
...
Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de >
2018-09-04 22:10:53 +02:00
Sylvain Rochet
fa3826a1d3
PPP: improve randomization of LCP magic number after power-up
...
magic_init() is first time called from ppp_init(), which is called from
lwip_init(). If system has no RTC, sys_jiffies() returns same value in
this moment after every power-up or system reset. This value used in LCP
magic number generation after ppp_connect(), which leads to same magic
number after every restart. Subsequent magic_randomize() calls takes
place in ppp_input(), after magic number generation.
Call magic_randomize() somewhere near start of ppp_connect() (and
ppp_listen()) as it might be called later at a random time.
Signed-off-by: Sylvain Rochet <gradator@gradator.net >
2018-08-31 10:12:50 +02:00
Dirk Ziegelmeier
dac4cb05f7
Fix bug #54569 : Compiler warning in ip4.c: unused parameter dest
2018-08-29 08:55:25 +02:00
Axel Lin
7b7bc349ae
netif/lowpan6_ble: Fix comment for parameter order of ble_addr_to_eui64
...
Signed-off-by: Axel Lin <axel.lin@ingics.com >
2018-08-19 22:47:43 +08:00
Axel Lin
bcd6c8a2d3
apps/sntp: Fix parameter name in doxygen comments
...
Make the parameter name in doxygen comments consistent wit the code.
Signed-off-by: Axel Lin <axel.lin@ingics.com >
2018-08-19 21:41:47 +08:00
Simon Goldschmidt
0674aa60fe
sntp_getservername: fix parameter name in doxygen comments
...
Reported-by: Gisle Vanem <gisle.vanem@gmail.com >
Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de >
2018-08-18 20:23:24 +02:00
Dirk Ziegelmeier
e351937ea4
More cmake build system cleanups
2018-08-09 09:50:29 +02:00
Simon Goldschmidt
e8683ea9df
api_lib: fix NETCONN_MBOX_WAITING_DEC() for LWIP_NETCONN_FULLDUPLEX
...
This was a copy & paste bug from ...INC()
2018-08-07 13:39:41 +02:00
Simon Goldschmidt
6363edc1db
mqtt: fix reference function name in comment
2018-08-07 13:38:39 +02:00
Dirk Ziegelmeier
a19ea8b8d6
Cleanup CMAKE build system
...
Use target-specific commands for compile flags only
2018-08-06 13:05:35 +02:00
Dirk Ziegelmeier
aafc0adfe1
Fix bug #54381 : SNMP RAW_DATA support is broken
2018-07-26 14:16:00 +02:00
Dirk Ziegelmeier
298951c738
Remove .clang-format for now, not sure if we are going to use it
2018-07-24 09:32:26 +02:00
Simon Goldschmidt
258cab1b22
fix bug #54315 (IPV6_V6ONLY socket accepts IPV4 connections)
...
Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de >
2018-07-23 21:47:33 +02:00
Simon Goldschmidt
c3d8b1ca80
add 'extern "C" {}' for cplusplus in ppp headers
2018-07-23 20:04:56 +02:00
Simon Goldschmidt
b5b31d86b2
fix dependencies in lwip/prot/dhcp.h and lwip/prot/igmp.h
2018-07-23 17:33:28 +02:00
Simon Goldschmidt
5bef7ea72f
add 'extern "C" {}' for cplusplus in many headers
2018-07-19 22:05:43 +02:00
Simon Goldschmidt
633205ba78
fix bug #54254 (ppp/utils.c: use lwip_isdigit())
2018-07-19 21:48:04 +02:00
Dirk Ziegelmeier
eeb2218b3d
Revert "Test / RFC: Reformat a few files using clang-format"
...
This reverts commit 8b4a8159a8 .
We do not want to do this shortly before a release. Reformatting (buggy reformatting) may introduce new bugs.
2018-07-18 08:34:01 +02:00
Dirk Ziegelmeier
0985e925a1
Fix bug #54327 : V2.1.0rc1 pbuf.c misses stdint.h include
...
... without reformatting the document (clang-format)
2018-07-18 07:31:47 +02:00
Dirk Ziegelmeier
cffb5cc087
Revert "Fix bug #54327 : V2.1.0rc1 pbuf.c misses stdint.h include"
...
This reverts commit 4e74421dac .
2018-07-18 07:30:41 +02:00
Dirk Ziegelmeier
8b4a8159a8
Test / RFC: Reformat a few files using clang-format
...
Does it compile? Does it look good (enough)?
2018-07-17 21:15:48 +02:00
Dirk Ziegelmeier
4e74421dac
Fix bug #54327 : V2.1.0rc1 pbuf.c misses stdint.h include
2018-07-17 20:45:09 +02:00
Dirk Ziegelmeier
cd1dd4f5b1
Clang-format: Remove "AlignConsecutiveAssignments: true"
...
This seems to be "Dirk Ziegelmeier-Style" not lwIP-Style :-)
2018-07-16 11:00:23 +02:00
Dirk Ziegelmeier
8841fdc8ea
Add .clang-format file that matches lwIP style "close enough"
2018-07-15 11:46:22 +02:00
Dirk Ziegelmeier
02d6716ffd
Remove non-working astylerc
2018-07-15 10:24:13 +02:00
Simon Goldschmidt
07dd2aec23
Prepare v2.1.0.rc1
...
Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de >
2018-07-12 21:18:17 +02:00
Simon Goldschmidt
cf330c50e6
cmake: add .rcX or .dev suffix to LWIP_VERSION_STRING
2018-07-12 21:16:59 +02:00
Axel Lin
d3191e4835
dhcp6: Trivial comment typo fixes
...
Signed-off-by: Axel Lin <axel.lin@ingics.com >
2018-07-12 21:35:38 +08:00
Axel Lin
29364d2a50
sockets: Make socket_ipv4/ipv6_multicast_memberships array static
...
They are only referenced in sockets.c, thus make them static.
Signed-off-by: Axel Lin <axel.lin@ingics.com >
2018-07-12 21:34:01 +08:00
Jasper Verschueren
d65681a7d7
DHCP request send on reboot does not contain hostname option
...
When the network is changed, dhcp is rebooted.
It will send a dhcp request again to verify it's lease.
DHCP requests are send out in selecting state, rebinding, renewing
and rebooting. But in the rebooting state the hostname option is
not included. This means that after reboot, the hostname will be
unknown to the DNS.
Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de >
2018-07-11 19:55:49 +02:00
Simon Goldschmidt
7b8a784c4f
fix 2 small bugs found by coverity
2018-07-11 10:57:57 +02:00
Axel Lin
d73efd7d38
dhcp: Prevent NULL pointer dereference in dhcp_select
...
Move the code to make sure netif is not NULL before calling
netif_dhcp_data(netif).
Signed-off-by: Axel Lin <axel.lin@ingics.com >
2018-07-05 21:39:00 +08:00
Simon Goldschmidt
596f742066
etharp: fix using ARP_TABLE_SIZE >= 0x80
2018-07-05 09:13:28 +02:00
Joel Cunningham
2bd1e313b9
etharp: cast netif_addr_idx_t to u16_t to match format type
...
This fixes an issue seen on MacOS with Clang 9.0.0:
../../../../lwip/src/core/ipv4/etharp.c:1069:142: error: format specifies type 'unsigned short' but the argument has type 'netif_addr_idx_t'
(aka 'unsigned char') [-Werror,-Wformat]
LWIP_DEBUGF(ETHARP_DEBUG | LWIP_DBG_TRACE, ("etharp_query: dropped previously queued packet %p for ARP entry %"U16_F"\n", (void *)q, i));
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~
../../../../lwip/src/core/ipv4/etharp.c:1074:120: error: format specifies type 'unsigned short' but the argument has type 'netif_addr_idx_t'
(aka 'unsigned char') [-Werror,-Wformat]
LWIP_DEBUGF(ETHARP_DEBUG | LWIP_DBG_TRACE, ("etharp_query: queued packet %p on ARP entry %"U16_F"\n", (void *)q, i));
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~
By default, netif_addr_idx_t is u8_t, so cast up to u16_t to match the format type
2018-07-04 16:11:46 -05:00
Simon Goldschmidt
341623c8be
opt.h: more indent fixes, remove unnecessary brackets
2018-07-04 15:07:28 +02:00
Simon Goldschmidt
dccdbdd309
opt.h: fix indents
2018-07-04 14:57:54 +02:00
Axel Lin
82fc0e8937
apps/netbiosns: Make *netbiosns_pcb static
...
It's only referenced by netbiosns.c, thus make it static.
Signed-off-by: Axel Lin <axel.lin@ingics.com >
2018-07-04 16:51:18 +08:00
Simon Goldschmidt
2d65251c6c
mdns: add config option to use netif ext callback
...
e.g. if the calling stack should not invoke the mdns functions due
to high stack usage, disable the option and trigger it yourself.
Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de >
2018-07-03 21:09:33 +02:00
Simon Goldschmidt
b398a2a394
fix implicit cast warnings in IAR and others
...
See bug #54190
Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de >
2018-07-03 20:53:32 +02:00
Simon Goldschmidt
eeee2b1c55
dhcp: adapt unit test to ignoring packets without END
2018-07-03 20:47:49 +02:00
Axel Lin
9b638e7c05
apps/netbiosns: Convert to use lwip_isupper instead of open-coded
...
Also remove additonal (cname == '\0' || cname == '.') check because
it's covered by !lwip_isupper(cname) test.
Signed-off-by: Axel Lin <axel.lin@ingics.com >
2018-07-03 22:55:59 +08:00
Axel Lin
58be2b1573
Add define for lwip_isupper when LWIP_NO_CTYPE_H=0
...
lwip_isupper is not defined when LWIP_NO_CTYPE_H=0, add it.
Signed-off-by: Axel Lin <axel.lin@ingics.com >
2018-07-03 22:55:07 +08:00
Dirk Ziegelmeier
e942818940
Filelists.cmake: Remove old documentation before generating new one to avoid orphaned files
2018-07-03 13:26:59 +02:00
Dirk Ziegelmeier
88ef663334
Add CMakeLists.txt to generate source distribution file
2018-07-03 12:54:17 +02:00
Simon Goldschmidt
fd0af07d2d
tcp/udp bind: small code restructuring for IPv6-only
...
See bug #54229
2018-07-02 20:31:38 +02:00
Simon Goldschmidt
1e24f9c9cd
dhcp: 2 small code improvements
...
See bugs #54226 and #54228
2018-07-02 20:27:12 +02:00
Simon Goldschmidt
19a929f5fb
dhcp: fix parse error with chained pbfus
...
If a chained pbuf starts with DHCP_OPTION_PAD, an overflow check
triggers and the packet is ignored.
Fix this by changing the way the offset is increased for PAD.
Also ignore a packet that is missing the END option.
Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de >
2018-07-02 20:25:42 +02:00
Simon Goldschmidt
cc8995823a
mdns: implement random time for initial probing
2018-06-28 22:10:45 +02:00
Simon Goldschmidt
af2cbad64a
mdns: add 2 RFC constants
2018-06-28 22:07:23 +02:00
Simon Goldschmidt
8090afa4f9
mdns: minor coding style cleanup
2018-06-28 22:04:57 +02:00
Simon Goldschmidt
4506db4331
mdns: fix implicit cast warnings (size_t to u8_t)
2018-06-28 21:58:15 +02:00
Simon Goldschmidt
814341a6ed
mdns: use an u8_t instead of an enum for mdns_hos::probing_state
...
This saves some bytes only, but it is actually more common in lwip code
2018-06-28 21:56:59 +02:00
Simon Goldschmidt
11e82e5355
UPGRADING: remove mdns_resp_announce() requirement after probing was added
2018-06-28 21:54:25 +02:00
Simon Goldschmidt
6067edfed3
mdns: add defines for mdns_name_result_cb_t result parameter
2018-06-28 21:52:58 +02:00
Jens Nielsen
9f1196fb53
MDNS send probes to verify domain before use
...
Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de >
2018-06-28 21:41:10 +02:00
Simon Goldschmidt
8223a8c73c
docs: reference the nongnu archive, not nabble
2018-06-28 21:15:57 +02:00
Simon Goldschmidt
b1487e6480
ip4_reass: fixed duplicat NULL check
...
See bug #54197
Rerported-by: Andrey Vinogradov <andrey.vinogradov@teplomonitor.ru >
Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de >
2018-06-27 20:56:05 +02:00
Simon Goldschmidt
0610b34372
httpd: fixed duplicate NULL check
...
See bug #54196 .
Reported-by: Andrey Vinogradov <andrey.vinogradov@teplomonitor.ru >
Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de >
2018-06-27 20:53:30 +02:00
Simon Goldschmidt
0c209dba4b
ethernet_input: fixed duplicate check for p->len
...
See bug #54195 .
Reported-by: Andrey Vinogradov <andrey.vinogradov@teplomonitor.ru >
Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de >
2018-06-27 20:51:10 +02:00
Simon Goldschmidt
f3e14585ad
tcp_out: fix duplicate check of tcp snd_queuelen
...
Can be combined into a single check using LWIP_MIN.
See bug #54194
Reported-by: Andrey Vinogradov <andrey.vinogradov@teplomonitor.ru >
Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de >
2018-06-27 20:44:01 +02:00
Simon Goldschmidt
8435fbb048
doc: IP_REASS_MAX_PBUFS is used for ipv6, too
...
Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de >
2018-06-27 20:44:01 +02:00
Axel Lin
4027a2ae58
Introduce lwip_toupper and use it in netbiosns.c
...
This fixes build error when LWIP_NO_CTYPE_H=1.
Signed-off-by: Axel Lin <axel.lin@ingics.com >
Acked-by: Simon Goldschmidt <goldsimon@gmx.de >
2018-06-27 23:16:03 +08:00
Axel Lin
a56e61c942
Fix compiling with LWIP_NOASSERT defined
...
Signed-off-by: Axel Lin <axel.lin@ingics.com >
2018-06-24 18:18:35 +08:00
Simon Goldschmidt
d80e84864e
httpd deduplicate code in http_send_data_ssi
...
Keep lead-in/lead-out tag in an array
2018-06-22 22:23:26 +02:00
Lucas Vinicius Hartmann
0acf37fd75
Added JavaScript-friendly ssi /*#tag*/.
2018-06-22 22:06:14 +02:00
Simon Goldschmidt
58f928a181
lwiperf: remove the comments that this is IPv4 only
...
IPv6 works (tested against iperf version 2.0.9 on linux)
Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de >
2018-06-22 06:39:04 +02:00
Simon Goldschmidt
b9b74b2d92
lwiperf: make tradeoff client mode work
2018-06-21 22:06:36 +02:00
Axel Lin
fb21bc1609
tcp_priv.h: LWIP_TCP_OPT_LENGTH: Enclosing macro argument in parentheses
...
Fix below build error:
In file included from
../../../../lwip/src/../test/unit/tcp/test_tcp.c:3:0:
../../../../lwip/src/../test/unit/tcp/test_tcp.c: In function
‘test_tcp_rto_timeout_syn_sent_impl’:
../../../../lwip/src/../test/unit/tcp/test_tcp.c:1246:113: error: suggest parentheses around arithmetic in operand of ‘|’ [-Werror=parentheses]
const u16_t tcp_syn_opts_len = LWIP_TCP_OPT_LENGTH(TF_SEG_OPTS_MSS|TF_SEG_OPTS_WND_SCALE|TF_SEG_OPTS_SACK_PERM|TF_SEG_OPTS_TS);
^
../../../../lwip/src/include/lwip/priv/tcp_priv.h:305:4: note: in definition of macro ‘LWIP_TCP_OPT_LENGTH’
(flags & TF_SEG_OPTS_MSS ? LWIP_TCP_OPT_LEN_MSS : 0) + \
^~~~~
Signed-off-by: Axel Lin <axel.lin@ingics.com >
2018-06-21 09:11:14 +08:00
Simon Goldschmidt
9992b48e90
fix compiling with LWIP_NOASSERT defined
...
See bug #54157
2018-06-20 20:56:20 +02:00
Simon Goldschmidt
824ebbe0e9
tcp: fix RTO timer not working if link is down
...
... and added some test cases for this situation
See bug #54139
Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de >
2018-06-19 22:48:06 +02:00
Simon Goldschmidt
3cdfc67dd8
ip4_frag: fix assertion on wrong pbuf
...
see bug #54117
Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de >
2018-06-19 21:29:16 +02:00
Simon Goldschmidt
7577e587be
lwip_itoa: fix implicit conversion warning
2018-06-18 12:15:37 +02:00
Sylvain Rochet
ce16f8c498
PPP: remove unknown define references to PPP_NUM_TIMEOUTS when PPP_SUPPORT is disabled
...
Fail to build if PPP_SUPPORT is disabled because PPP_NUM_TIMEOUTS
references defines that are unknown if PPP_SUPPORT == 0. Move
PPP_NUM_TIMEOUTS to PPP_SUPPORT block and set a default value to 0
if PPP_NUM_TIMEOUTS is still not defined at the end of ppp_opts.h.
Fixes: e4e0fc4193 ("PPP: set PPP_NUM_TIMEOUTS_PER_PCB value to computed number of simultaneous timers")
Signed-off-by: Sylvain Rochet <gradator@gradator.net >
2018-06-18 10:17:58 +02:00
Simon Goldschmidt
871f27628b
lwiperf: fix unused function warning/error
2018-06-18 07:24:42 +02:00
Sylvain Rochet
e4e0fc4193
PPP: set PPP_NUM_TIMEOUTS_PER_PCB value to computed number of simultaneous timers
...
A deep analysis of simultaneously running timers showed we can use a
slightly smaller value for PPP_NUM_TIMEOUTS_PER_PCB, value which was
arbitrarily chosen to a safe value based on the number of enabled PPP
features. Add the boring and long analysis to the end of our internal
header file and use the result in ppp_opts.h.
Signed-off-by: Sylvain Rochet <gradator@gradator.net >
2018-06-18 01:15:35 +02:00
Simon Goldschmidt
58b5a5fc5a
lwiperf: implemented "dual" client mode
2018-06-17 21:04:57 +02:00
Simon Goldschmidt
a057caee45
lwiperf: start implementing iperf client
...
Only the transmission side works for now (todo: dual and tradeoff mode).
Also, only a 10 second timeout mode is implemented for now.
Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de >
2018-06-15 22:26:32 +02:00
Simon Goldschmidt
dbc16e6765
minor whitespace cleanup
2018-06-15 21:19:19 +02:00
Sylvain Rochet
f31160a6cb
PPP, PPPoL2TP: properly ack receipt of duplicate packets
...
Managed to find the spirit behind the RFC. Looks like we need to send
a ZLB packet with counters as is to the packet (ZLB or not) we
previously sent to ack the message. Luckily we don't need more than
received NS/NR counters to forge the resent ack.
Signed-off-by: Sylvain Rochet <gradator@gradator.net >
2018-06-15 17:29:50 +02:00
Sylvain Rochet
738a2fe846
PPP, PPPoL2TP: stop ICCN timeout when receiving ICCN ack
...
Remove spurious and hitless timeout function call once L2TP reach "data"
state.
Signed-off-by: Sylvain Rochet <gradator@gradator.net >
2018-06-15 15:45:15 +02:00
Sylvain Rochet
5278202f66
PPP: remove now unnecessary null PPP IP4 output handler
...
netif_null_output_ip4 dummy handler appeared in netif core, remove our
own from PPP stack.
Signed-off-by: Sylvain Rochet <gradator@gradator.net >
2018-06-15 14:41:19 +02:00
Sylvain Rochet
98008cb1ab
PPP, PPPoL2TP: use expected peer NS instead of current peer NS
...
We never use the current peer NS value but always the next expected peer
NS value (current value plus one).
Signed-off-by: Sylvain Rochet <gradator@gradator.net >
2018-06-15 14:08:03 +02:00
Sylvain Rochet
a56519032e
PPP, PPPoL2TP: drop unexpected packets from peer
...
Conform a little bit more to the RFC by dropping duplicate received
packets. It might help discover Ns sequence issues.
Signed-off-by: Sylvain Rochet <gradator@gradator.net >
2018-06-15 14:02:58 +02:00
Sylvain Rochet
047c3c6528
PPP, PPPoL2TP: take care of Ns/Nr wraparounds
...
It can't be an issue since we only send and receive a few L2TP control
packets and we don't care about anything received next other than
sending Ack packet. For the sake of correctness properly handle Ns/Nr
counters wraparounds, it doesn't add more code anyway.
Signed-off-by: Sylvain Rochet <gradator@gradator.net >
2018-06-15 01:33:07 +02:00
Sylvain Rochet
5b8760601b
PPP, PPPoL2TP: wait for ICCN ack before starting PPP
...
L2TP tunnel is really UP only once we received the ICCN Ack packet,
generally with a ZLB packet. We actually drop all data packets until
we reach the "data" L2TP state, which is a sane thing to do, therefore
it makes no sense at all to start the PPP session a bit earlier.
Signed-off-by: Sylvain Rochet <gradator@gradator.net >
2018-06-15 00:47:29 +02:00
Sylvain Rochet
b9fe13c105
PPP, PPPoL2TP: fix ZLB packets Ns value
...
Our Ns counter is the current slot rather than the next to ease packet
retransmission. Therefore we increment the Ns counter before using the
next slot instead of after. The RFC is written with post-increment in
mind rather than pre-increment, thus when the RFC says that Ns in not
incremented for ZLB packets it actually means that ZLB packets are sent
with the next Ns without post-incrementing the Ns value, meaning the
ZLB packet does not take a slot. Since we are using a pre-incremented
value for real slots we need to send ZLB packets with our current Ns
value plus one.
Signed-off-by: Sylvain Rochet <gradator@gradator.net >
2018-06-14 23:42:29 +02:00
Sylvain Rochet
a48ff4aaf2
PPP, PPPoE: fix trivial build error
...
lwip/src/netif/ppp/pppoe.c: In function ‘pppoe_send_padt’:
lwip/src/netif/ppp/pppoe.c:1048:108: error: ‘sc’ undeclared (first use in this function)
sc is not passed to ‘pppoe_send_padt’ function because it might be
called to terminate unknown sessions.
Fixes: d4047ea1d1 ("Try to fix issues reported by coverity")
Signed-off-by: Sylvain Rochet <gradator@gradator.net >
2018-06-14 19:58:41 +02:00
Axel Lin
a51c92b617
tcp_out: Fix trivial build error
...
Fixes: 6ac21515ca ("Add missing null checks")
Signed-off-by: Axel Lin <axel.lin@ingics.com >
2018-06-14 22:47:28 +08:00
Matthias Hofmann
6ac21515ca
Add missing null checks.
...
Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de >
2018-06-14 16:20:47 +02:00
Simon Goldschmidt
e61b925709
try to fix compiling with gcc & clang
2018-06-14 15:01:57 +02:00
Simon Goldschmidt
944f286d87
fix bug in RA MTU validation
...
Also fix that RA could change IPv4 MTU.
See bug #53696
Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de >
2018-06-14 12:55:18 +02:00
Simon Goldschmidt
39faa8f61d
added tests for ip6addr_ntoa_r
2018-06-14 12:30:14 +02:00
Simon Goldschmidt
313664c59c
ip6addr_ntoa_r: correctly generate ipv4 mapped addresses
2018-06-14 12:29:40 +02:00
Axel Lin
7c03f4cf46
Silence lwip_tolower compiler warning
...
Fix gcc build warning: array subscript has type 'char' [-Wchar-subscripts].
Signed-off-by: Axel Lin <axel.lin@ingics.com >
2018-06-14 09:47:19 +08:00
Simon Goldschmidt
b0e5eeb7d2
udp: prefer correctly bound pcbs when receiving broadcast
...
See bug #53301
Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de >
2018-06-13 22:01:18 +02:00
Simon Goldschmidt
1bdc669b45
udp: restructure udp_input uncon_pcb selection in preparation for fixing bug #53301
2018-06-13 21:59:04 +02:00
Simon Goldschmidt
47ebb2b267
dns: add a comment about case insensitivity
2018-06-13 15:10:47 +02:00
Simon Goldschmidt
a9d6ea5953
introduce 'lwip_tolower' and use it in dns.c
...
Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de >
2018-06-13 15:08:11 +02:00
armink
66f7f06601
fix DNS resolution to not case insensitivity
...
See patch #9654
Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de >
2018-06-13 15:04:46 +02:00
Matthias Hofmann
8e23b8d903
Correct UDP rebind check.
...
Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de >
2018-06-13 15:00:21 +02:00
Simon Goldschmidt
a75332a407
ip4_frag: correctly refragment packets that already have MF set
...
see patch #9645
Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de >
2018-06-13 14:56:18 +02:00
Simon Goldschmidt
25497bb387
bridgeif/slipif/zepif: check that input callback is not NULL
2018-06-13 10:53:50 +02:00
Simon Goldschmidt
38614e4f3e
unit tests: remove dummy netif input function
...
This partly reverts a26a2e13 after removing that NULL check again.
Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de >
2018-06-13 10:46:44 +02:00
Axel Lin
61e3f49f69
netif: Don't return error if pass NULL netif_input_fn to netif_add
...
The new NULL checking against netif_input_fn make ppp stop working
because in ppp_new() it calls netif_add with NULL netif_input_fn.
Signed-off-by: Axel Lin <axel.lin@ingics.com >
Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de >
2018-06-13 10:39:38 +02:00
Simon Goldschmidt
3f2227f04c
Fix pppos after changing PBUF_POOL to PBUF_RAM
...
This partly reverts 31bc2f9b which broke pppos tx as 'pppos_output_append'
implements a custom scheme of checking available pbuf size.
Added a comment why PBUF_POOL is ok for tx in this special case.
See bug #51908
Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de >
2018-06-13 09:38:04 +02:00
Simon Goldschmidt
392c676ef5
fix bug #53273 : IPv6 link-local address generation for non-ethernet type netif does not convert byte order
2018-06-13 08:57:17 +02:00
Simon Goldschmidt
0c5133d7cf
fix ip6addr_aton for non-shortened ipv4 mapped addresses
2018-06-12 21:48:32 +02:00
Simon Goldschmidt
eb91fdd861
httpd: fix missing null termination when searching for a default file in file system folder
2018-06-12 20:14:04 +02:00
Simon Goldschmidt
a26a2e1340
adapt unit tests to additional NULL checks
2018-06-12 13:47:13 +02:00
Simon Goldschmidt
1bf323e12f
remove 2 NULL checks which are wrong
2018-06-12 13:46:44 +02:00
Simon Goldschmidt
e7c0619189
fix NULL checks (compiler error, tcp_rst allows pcb==NULL)
2018-06-12 13:32:12 +02:00
Simon Goldschmidt
31bc2f9b20
fixed bug #51908 : PPPOS uses PBUF_POOL in transmit pathway
...
Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de >
2018-06-12 10:39:46 +02:00
Matthias Hofmann
342d0eadfb
Add null pointer checks for TCP, UDP and netif
...
Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de >
2018-06-12 10:24:08 +02:00
Simon Goldschmidt
6ea2483546
ip4_canforward(): don't route multicast packets
...
Added LWIP_HOOK_IP4_CANFORWARD to still implement multicast routing.
See bug #52914
Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de >
2018-06-12 06:45:30 +02:00
Axel Lin
1fd145fbc9
Fix trivial copy-n-paste mistake in ip4_debug_print
...
Fixes: 288d3c2802 ("fixed bug #54006 : Two compiler warnings on IAR when debug is enabled")
Signed-off-by: Axel Lin <axel.lin@ingics.com >
2018-06-12 11:36:05 +08:00
Simon Goldschmidt
2837bb310c
fix ip6addr_aton handling IPv4-mapped addresses
...
... and added a unit test for it
Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de >
2018-06-11 22:21:31 +02:00
Simon Goldschmidt
288d3c2802
fixed bug #54006 : Two compiler warnings on IAR when debug is enabled
2018-06-11 20:11:47 +02:00
Simon Goldschmidt
f8e7cccf21
add new ip6 tests to (c)make list files
2018-06-10 19:23:02 +02:00
Simon Goldschmidt
31e07f90bd
send router solicitations every 4 seconds
...
See bug #53973
Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de >
2018-06-08 23:09:13 +02:00
Simon Goldschmidt
4fa33c17bc
add reference to the RFC for the last commit...
2018-06-08 22:54:02 +02:00
Simon Goldschmidt
1a294622d0
ipv6 router solicitation: "ensure at least one solicitation is sent"
...
Fix the case where nd6_send_rs() fails: send one solicitation here,
not LWIP_ND6_MAX_MULTICAST_SOLICIT.
Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de >
2018-06-08 22:45:55 +02:00
Simon Goldschmidt
fd050b8a97
fix bug #53971 Lwip sends Router Solicitation on address changes
...
... and add a unit test for it.
Moved resetting netif->rs_count from all reports to link-up and netif-up only.
While at it, clean up the interface a bit so that netif->rs_count is touched
from nd6.c only.
Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de >
2018-06-08 22:18:50 +02:00
Simon Goldschmidt
d4845abac6
test_etharp: fix compiler warning
2018-06-08 20:03:51 +02:00
Simon Goldschmidt
ab922582dc
docs: use ETH_HWADDR_LEN, not sizeof(netif->hwaddr)
2018-06-07 20:48:18 +02:00
Simon Goldschmidt
b1ffb3a8d3
Try to fix bug #53952 (ip4_addr_debug_print_val unaligned structure reference compiler warning)
2018-05-24 23:13:27 +02:00
Dirk Ziegelmeier
d996d0f486
Apply patch #9629 : tftp_cleanup() should clean up more
...
By Jens Nielsen
2018-05-21 09:27:31 +02:00
Simon Goldschmidt
11c294e973
fix type conversion errors introduced with last commit
2018-05-17 22:35:12 +02:00
Simon Goldschmidt
0c2fdfcf42
Fix bug #53667 : ARP table max size is to small
...
arp table functions, nd6 destination cache and struct netif_hint
can now be u16_t or u8_t depending on table size, so up to 32K
entries can be used in these tables (s16_t)
Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de >
2018-05-17 21:52:01 +02:00
Simon Goldschmidt
0f165ff136
etharp: use generic types in external access to ARP table
...
This should hide the internal type used for access to the ARP table
which currently is s8_t or u8_t, depending on the use case.
Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de >
2018-05-17 21:16:06 +02:00
goldsimon
8f3df7c862
tcp: fix const warning for LWIP_NETIF_HWADDRHINT==1
2018-05-17 20:57:02 +02:00
Axel Lin
ec8c764fcb
apps/smtp: Fix build warning when !(SMTP_SUPPORT_AUTH_PLAIN || SMTP_SUPPORT_AUTH_LOGIN)
...
Fix build warning: ‘smtp_base64_encode’ declared ‘static’ but never defined.
Signed-off-by: Axel Lin <axel.lin@ingics.com >
2018-05-17 19:50:17 +08:00
Axel Lin
795f05c5d3
apps/smtp: Fix build warning when SMTP_CHECK_DATA==0
...
Fix build warning: 'smtp_verify' declared 'static' but never defined.
Signed-off-by: Axel Lin <axel.lin@ingics.com >
2018-05-17 17:06:31 +08:00
Joel Cunningham
ffaee59f3e
loopif: only schedule poll when first packet is enqueued
...
This optimizes the netif_loop_output to only schedule a call to poll when
the first packet is enqueued. This ensures netif_poll is ran once per
burst of packets that are sent (which is typical in a TCP transfer)
The old behavior scheduled a call to poll for every packet that was
enqueued and this lead to exhaustion of the MEMP_TCPIP_MSG_API memory pool
and tcpip_mbox (if port is using static mbox size). The extra callbacks are
wasted work because netif_poll drains the entire queue when ran
This issue presented itself when large TCP transfer go across the loopback
netif
2018-05-02 09:16:01 -05:00
Joel Cunningham
070e449690
loopif: disable checksums
...
This disable checksum generation and checking for the loopback netif
when LWIP_CHECKSUM_CTRL_PER_NETIF is enabled
Checksums are not needed for the loopback adapter and this will increase
performance for loopback communication
2018-05-02 09:16:01 -05:00
goldsimon
a445172661
makefsdata: fix hiding local variable 'i'
2018-05-02 10:05:24 +02:00
Dirk Ziegelmeier
059bc952f6
Revert Filelists.mk to original state - it is not really useful to generate it from Filelists.cmake
2018-05-02 09:40:36 +02:00
Dirk Ziegelmeier
f116bc37d1
Cleanups in CMake files
2018-04-30 22:29:07 +02:00
Dirk Ziegelmeier
9672b4c3af
Work on CMake build system - restructure to use included cmake files, this is more flexible
2018-04-30 21:35:12 +02:00
Dirk Ziegelmeier
ab5bc1e766
Work on CMake build system - add Filelists.cmake for unit tests
2018-04-27 23:58:36 +02:00
Dirk Ziegelmeier
d40c3251d7
Work on CMake build system
...
Always configure files, doesn't hurt and makes CMakeLists.txt more readable
2018-04-26 23:31:31 +02:00
Dirk Ziegelmeier
ad8e08a08b
Continue workin on CMake build system
...
Split lwip lib into lwIP core and lwIP apps
Compile makefsdata only when NOT cross-compiling
2018-04-26 22:33:53 +02:00
Dirk Ziegelmeier
c61a0570b1
Work on CMake build system
2018-04-25 22:44:30 +02:00
goldsimon
2291f9a8fa
tftp: decrease TFTP_TIMER_MSECS
...
This timeout is used to measure TFTP_TIMEOUT_MSECS fine enough.
Calling tftp_tmr at a 50ms interval to handle a 1 seconds timeout
produces way too much cpu load (and prevents sleep).
Signed-off-by: goldsimon <goldsimon@gmx.de >
2018-04-25 21:27:58 +02:00
goldsimon
e05a96550f
etharp: fix bogus ifdef regions
...
(after separating etharp and ethernet)
2018-04-25 21:17:47 +02:00
goldsimon
b2ef9d9046
netbiosns: fix bug #53747 (need to verify received packet length)
2018-04-25 20:56:34 +02:00
Our Air Quality
373bf8c36d
Quieten a toupper() compiler warning.
...
Gcc complains that an array index is a 'char' when passing a 'char' to
toupper(). Quieten this by coercing to an 'unsigned char'.
Signed-off-by: goldsimon <goldsimon@gmx.de >
2018-04-25 20:39:25 +02:00
Jens Nielsen
c34120e855
TFTP server handle retransmit Data packets
...
Signed-off-by: goldsimon <goldsimon@gmx.de >
2018-04-25 20:29:31 +02:00
Dirk Ziegelmeier
91bc7a02c9
Fix indent in CMakeLists.txt (Tabs -> Spaces)
2018-04-24 08:06:27 +02:00
Dirk Ziegelmeier
4355a23ad2
Cleanups in CMake build files
2018-04-23 23:30:01 +02:00
Dirk Ziegelmeier
b60df2df20
Start working on a CMAKE build system
2018-04-23 22:56:35 +02:00
Dirk Ziegelmeier
b2948c08f7
Merge branch 'master' of ssh://git.sv.gnu.org:/srv/git/lwip
2018-04-22 06:57:28 +02:00
Dirk Ziegelmeier
d4ee483280
Enable IPv6 fragmentation by default
2018-04-22 06:57:05 +02:00
Axel Lin
9fd8222479
etharp: Cast the return value of etharp_find_entry to s8_t instead of err_t
...
etharp_find_entry() returns s8_t rather than err_t.
Signed-off-by: Axel Lin <axel.lin@ingics.com >
2018-04-21 08:22:51 +08:00
Dirk Ziegelmeier
9980d09bc8
Add note about NETIF_FLAG_MLD6 netif flag
2018-04-20 08:59:36 +02:00
Dirk Ziegelmeier
4b3e996617
Add note to MLD6 that allnodes group multicasts must be received
2018-04-20 08:57:01 +02:00
goldsimon
4a22d6d5a2
sockets_stresstest: fix typo (&1, not %1)
2018-04-20 07:52:35 +02:00
Ben Wijen
7d1c6ba549
dhcp: Fix BOOTP_FILE bug
...
The comment in dhcp_handle_ack for 'offered_si_addr' states:
'boot file name copied in dhcp_parse_reply if not overloaded'
However this code was never reached if the packed was not 'overloaded'
Signed-off-by: goldsimon <goldsimon@gmx.de >
2018-04-19 22:18:56 +02:00
goldsimon
d320b27a5f
fix compiling sockets.c for SYS_LIGHTWEIGHT_PROT==0
2018-04-19 08:23:10 +02:00
goldsimon
ef3073aaf9
LWIP_ALLOW_MEM_FREE_FROM_OTHER_CONTEXT: 'lfree' mus be volatile
2018-04-18 22:12:46 +02:00
goldsimon
71c13c6079
Improve the socket stress test to better test fullduplex
2018-04-18 22:03:11 +02:00
goldsimon
3abc8ae161
LWIP_NETCONN_FULLDUPLEX: unblock rx threads on close
...
Threads blocked on the rx mbox are counted and on close,
one "netconn closed" message per thread is posted to the mbox
to ensure all threads are woken.
The netconn can then be safely deleted. In socket API, "fd_used"
and "fd_free_pending" help with auto-deleting the netconn.
Signed-off-by: goldsimon <goldsimon@gmx.de >
2018-04-18 21:51:34 +02:00
goldsimon
41fea4ad7d
sockets: change closing: netconn is freed when socket is closed, not before
...
This is necessary to implement fullduplex sockets that are closed asynchronously:
the netconn in the socket must not be freed before all threads have given up
using it.
We now call the first part of 'netconn_delete()' (moved to 'netconn_prepare_delete()')
from lwip_close() and only actually end up calling 'netconn_free()' from
'free_socket()', which might be called later if LWIP_NETCONN_FULLDUPLEX is enabled.
Signed-off-by: goldsimon <goldsimon@gmx.de >
2018-04-18 20:55:49 +02:00
goldsimon
1090e9cdec
LWIP_NETCONN_FULLDUPLEX: prevent taking recursive sys arch lock
...
Calling SYS_ARCH_PROTECT() could happen twice in 'free_socket()' if
that free was executed delayed (e.g. in 'done_socket_locked()').
Signed-off-by: goldsimon <goldsimon@gmx.de >
2018-04-18 20:55:49 +02:00
goldsimon
b1fe8cf4b8
netbiosns: check question type before generating an answer
2018-04-18 08:17:10 +02:00
goldsimon
f65911a84b
netbios: fix response length of node status response
2018-04-18 07:28:41 +02:00
Dirk Ziegelmeier
66800925cf
Fix indent in netbiosns.c
2018-04-17 14:08:59 +02:00
Dirk Ziegelmeier
533c97f0c3
Fix bug #53626 : NetBIOS Responder generates malformed packet responding to "*" name
...
Implement corrected answer packet
2018-04-16 10:40:05 +02:00
Axel Lin
e935faf2bc
tcp_priv.h: Fix compile warnings when TCP_DEBUG_PCB_LISTS is set
...
Signed-off-by: Axel Lin <axel.lin@ingics.com >
2018-04-10 17:48:47 +08:00
goldsimon
fa55458c42
netconn_accept: reduce number of ifdefs
2018-04-06 22:37:20 +02:00
goldsimon
4cc953d0e3
httpd: fixed compiling makefsdata.c
2018-04-04 21:45:47 +02:00
Dirk Ziegelmeier
ffdd44ec74
Fix bug #53559 : IPv4 to IPv6 filtering not freeing PBUFs
...
Add missing pbuf_free() call
2018-04-04 21:04:14 +02:00
Ray Abram
b0ae967660
NetBIOS Responder should respond to "*" names
...
See bug #53325
Signed-off-by: goldsimon <goldsimon@gmx.de >
2018-04-03 22:19:18 +02:00
Tom Ferrin
82d8f08451
Add "server reachability" register to SNTP
...
Guarded with SNTP_MONITOR_SERVER_REACHABILITY (sntp_opts.h).
See patch 9581
Signed-off-by: goldsimon <goldsimon@gmx.de >
2018-04-03 21:56:33 +02:00
Tom Ferrin
e46b9ad4ac
sntp: store server IP address after DNS lookup
...
See patch #9612
Signed-off-by: goldsimon <goldsimon@gmx.de >
2018-04-03 21:16:05 +02:00
Giuseppe Modugno
2d4da92eeb
makefsdata: added options to skip and avoid compressing some extensions
...
See patch #9605
Signed-off-by: goldsimon <goldsimon@gmx.de >
2018-04-03 21:08:25 +02:00
Axel Lin
81acaf0ff1
tcp_out: Fix updating remainder_flags in tcp_split_unsent_seg
...
The code to migrate flags from original segment updating wrong variable
so both remainder and remainder_flags may be incorrect. Fix it.
Fixes: f582c88339 ("tcp: persist timer re-work (bug #50837 )")
Signed-off-by: Axel Lin <axel.lin@ingics.com >
Acked-by: Joel Cunningham <joel.cunningham@me.com >
2018-03-31 11:20:03 +08:00
goldsimon
b693056bb6
lowpan6_ble: local address is required for compression/decompression, too
2018-03-27 21:20:01 +02:00
goldsimon
97a9fe1b10
Fix compiling lowpan6_ble.c on travis
2018-03-22 08:48:53 +01:00
Axel Lin
e9ee3c4b58
add lowpan6_common.c to Filelists.mk
...
Signed-off-by: Axel Lin <axel.lin@ingics.com >
2018-03-22 08:39:20 +08:00
goldsimon
8adfc730ec
lowpan6_ble.c: use common functions from lowpan6_common.c
2018-03-21 22:57:45 +01:00
goldsimon
ac03107036
lowpan6_common.c: add comments from ble version
2018-03-21 22:53:08 +01:00
goldsimon
a4b9beef04
Move common 6LoWPAN code to new file lopwan6_common.c
...
This is mainly IPHC (de)compression.
TODO: adapt the 6LoWPAN-over-BLE netif to this.
Signed-off-by: goldsimon <goldsimon@gmx.de >
2018-03-21 20:55:05 +01:00
goldsimon
c974fc9d43
http_client: fix compiling if mem_size_t is smaller than size_t
2018-03-21 09:33:00 +01:00
goldsimon
c881c48eed
netif_add: check that the new netif is not already added
2018-03-21 09:32:39 +01:00
Axel Lin
600527dde7
apps/http: httpd: Fix unused parameter warning if !LWIP_HTTPD_SUPPORT_V09
...
Signed-off-by: Axel Lin <axel.lin@ingics.com >
2018-03-21 15:05:33 +08:00
Axel Lin
e19d908f0e
apps/http: Fix httpd_structs.h build error
...
Fixes: bug #53382 : HTTPD_ADDITIONAL_CONTENT_TYPES doesn't compile
Reported-by: Giuseppe Modugno <giuseppe.modugno.loqed@gmail.com >
Signed-off-by: Axel Lin <axel.lin@ingics.com >
2018-03-19 21:08:17 +08:00
Dirk Ziegelmeier
104a629a51
zepif: Convert to dual-stack
2018-03-15 09:21:32 +01:00
goldsimon
d79416eee6
lowpan6: move a function to delete one prototype
2018-03-14 16:59:20 +01:00
Axel Lin
6070a7ef6a
netif: Add netif_do_ip_addr_changed function to reduce duplicated code
...
As the common code to call tcp/udp/raw_netif_ip_addr_changed is called
by multiple places, add netif_do_ip_addr_changed() to call them.
Signed-off-by: Axel Lin <axel.lin@ingics.com >
Acked-by: Simon Goldschmidt <goldsimon@gmx.de >
2018-03-14 22:59:17 +08:00
goldsimon
08bcfa2b29
netif: initialize netif->output with a dummy function for IPv6 only netifs
2018-03-13 20:29:37 +01:00
goldsimon
0074022bb5
minor: fix typos and spaces
2018-03-13 20:28:59 +01:00
Axel Lin
10ae311a93
lowpan6: Rework to speed up dequeue datagram process
...
Current implementation iterates the lowpan6_data.reass_list every time
dequeue_datagram() is called.
We can get previous lrh in all the context calling dequeue_datagram().
By adding a prev arguemnt to dequeue_datagram(), we can speed up the
dequeue datagram process.
All the callers never check return value of dequeue_datagram() as it
always return ERR_OR, thus make it return void instead.
Signed-off-by: Axel Lin <axel.lin@ingics.com >
Acked-by: Simon Goldschmidt <goldsimon@gmx.de >
2018-03-13 08:16:35 +08:00
Axel Lin
909037c2ca
api_lib: Remove superfluous #if LWIP_TCP in netconn_recv_data_tcp
...
netconn_recv_data_tcp() will be built only when LWIP_TCP=1.
Signed-off-by: Axel Lin <axel.lin@ingics.com >
2018-03-11 16:47:14 +08:00
goldsimon
16afe566ff
lowpan6: fix doc warning in clang
2018-03-09 13:40:15 +01:00
goldsimon
253fcc8dcd
http_client: call tcp_recved for header bytes
...
Without this, closing the connection after successful transfer resulted
in a RST being sent because the window was not fully marked as 'recved'.
Signed-off-by: goldsimon <goldsimon@gmx.de >
2018-03-09 11:30:23 +01:00
goldsimon
8d8572354b
lowpan6: fix bug #47291 (wrong datagram size for fragmentation)
...
Fragment datagram_size and datagram_offset should be calculated from the uncompressed datagram.
We did this on the compressed size and thus were not compatible to other implementations.
Now my test setup communicates with contiki sicslowpan.
Signed-off-by: goldsimon <goldsimon@gmx.de >
2018-03-09 11:28:35 +01:00
goldsimon
b86f9b97e0
lowpan6: refactor decompression to not allocate a pbuf
2018-03-09 06:37:59 +01:00
goldsimon
61a1b98cc9
various IPv6-only compile fixes
2018-03-07 20:55:00 +01:00
goldsimon
972f32dd47
zepif: fix compiling with IPv4 disabled
2018-03-07 19:58:09 +01:00
Axel Lin
971404ff90
http_client.h: Include lwip/pbuf.h
...
struct pbuf is used by httpc_headers_done_fn, thus need to include
lwip/pbuf.h.
Signed-off-by: Axel Lin <axel.lin@ingics.com >
2018-03-07 15:24:14 +08:00
Axel Lin
0411332856
api_msg.h: Fix build error when LWIP_NETIF_API && !LWIP_SOCKET && !LWIP_NETCONN
...
netifapi related lwIP internal definitions should be guarded
by #if LWIP_NETIF_API rather than #if LWIP_NETCONN || LWIP_SOCKET.
Fix below build errors:
cc -g -DLWIP_DEBUG -Wall -pedantic -Wparentheses -Wsequence-point -Wswitch-default -Wextra -Wundef -Wshadow -Wpointer-arith -Wcast-qual -Wc++-compat -Wwrite-strings -Wold-style-definition -Wcast-align -Wmissing-prototypes -Wredundant-decls -Wnested-externs -Wunreachable-code -Wuninitialized -Wmissing-prototypes -Wredundant-decls -Waggregate-return -Wlogical-not-parentheses -Wlogical-op -Wc90-c99-compat -Wtrampolines -I. -I../../.. -I../../../../lwip/src/include -I../../../ports/unix/port/include -I../../../../mbedtls/include -Wno-redundant-decls -DLWIP_HAVE_MBEDTLS=1 -c ../../../../lwip/src/api/netifapi.c In file included from ../../../../lwip/src/api/netifapi.c:46:0:
../../../../lwip/src/include/lwip/netifapi.h:76:50: error: unknown type name 'netifapi_void_fn'; did you mean 'netif_init_fn'?
err_t netifapi_netif_common(struct netif *netif, netifapi_void_fn voidfunc,
^~~~~~~~~~~~~~~~
netif_init_fn
../../../../lwip/src/include/lwip/netifapi.h:77:29: error: unknown type name 'netifapi_errt_fn'; did you mean 'netif_input_fn'?
netifapi_errt_fn errtfunc);
^~~~~~~~~~~~~~~~
netif_input_fn
../../../../lwip/src/api/netifapi.c: In function 'netifapi_do_netif_add':
../../../../lwip/src/api/netifapi.c:67:22: error: dereferencing pointer to incomplete type 'struct netifapi_msg'
if (!netif_add( msg->netif,
^~
Fixes: 30a2283993 ("Move netifapi private definitions to priv/api_msg.h")
Signed-off-by: Axel Lin <axel.lin@ingics.com >
2018-03-07 07:58:10 +08:00
goldsimon
b6d9bb6b2a
http_client: check current state when receiving FIN
2018-03-06 21:51:13 +01:00
goldsimon
91a2d9e237
zepif: fix comment for calling netif->input()
2018-03-05 08:40:51 +01:00
goldsimon
5474498f7e
zepif: call netif->input instead of tcpip_6lowpan_input for rx packets
...
This allows reusing zepif e.g. with contiki 6LoWPAN code for testing.
2018-03-05 06:43:57 +01:00
Joel Cunningham
b28e979739
unit: write out XML file
...
This writes out the results of the unit tests in an XML file called
lwip_unittests.xml in the same directory as the unittests executable.
See https://libcheck.github.io/check/doc/check_html/check_4.html#XML-Logging
for an example of the ouput. Of particular use is the duration field, for
each test and for the entire test run.
2018-03-04 10:42:54 -06:00
Axel Lin
53ddb9244b
apps/sntp: Trivial build warning fix
...
Fix below build warning:
../../../../lwip/src/apps/sntp/sntp.c: In function ‘sntp_servermode_dhcp’:
../../../../lwip/src/apps/sntp/sntp.c:726:3: warning: ISO C90 forbids mixed declarations and code [-Wc90-c99-compat]
u8_t new_mode = set_servers_from_dhcp ? 1 : 0;
^~~~
Signed-off-by: Axel Lin <axel.lin@ingics.com >
2018-03-04 19:18:26 +08:00
Joel Cunningham
b1258bf8e6
unit: speed up test_pbuf_queueing_bigger_than_64k
...
Speed up test_pbuf_queueing_bigger_than_64k by using memcmp rather than
a byte by byte comparision. This allows using word aligned compares
within the memcmp implementation
This fixes a unit test timeout on my Windows 10 box with WSL which was
taking longer than 4 seconds for the unix port unit test to complete
See failure details in https://savannah.nongnu.org/patch/index.php?9579
2018-03-03 17:43:23 -06:00
Dirk Ziegelmeier
91038e4979
Improve 6LoWPAN documentation
2018-03-03 11:09:57 +01:00
Dirk Ziegelmeier
08bf8b7121
Improve documentation for 6LOWPAN BLE and ZEPIF
2018-03-03 11:00:04 +01:00
goldsimon
282e1601ef
finally got zepif running
2018-03-02 13:01:05 +01:00
goldsimon
ab0e457066
lowpan6: change the name of 2 members to indicate usage for tx
2018-03-01 22:17:12 +01:00
goldsimon
a137e16ff8
lowpan6.c: fix referenced RFCs
2018-03-01 12:44:18 +01:00
goldsimon
6e62baaa6c
sockets.h: include <string.h> for memcpy in FD_ZERO
2018-03-01 09:05:29 +01:00
goldsimon
cb746a1aea
zepif: fix destination IP (default should be broadcast, not 0.0.0.0)
2018-03-01 07:08:03 +01:00
goldsimon
fcccc47be4
lowpan6.c: fix clang doc warnings
2018-03-01 07:00:32 +01:00
goldsimon
002ba1a66b
zeoif: ZEPIF_LOOPBACK should be 0 default, not 1
2018-03-01 06:15:55 +01:00
goldsimon
43778e5334
add zepif.c to Filelists.mk
2018-02-28 23:00:08 +01:00
goldsimon
43a55003da
Added a netif encapsulating 6LowPAN in ZEP (ZigBee Enxapsulation Protocol)
...
This protocol is sent over a 2nd netif via UDP/IP and can used to analyze
6LoWPAN with a Wireshark dissector.
Signed-off-by: goldsimon <goldsimon@gmx.de >
2018-02-28 22:58:48 +01:00
goldsimon
d9770d2c5f
tcpip_thread: TCPIP_MSG_INPKT: free input pbufs if the input function returns an error
...
This simply wasn't the case until 6LoWPAN. However, since tcpip_input is like this, we
should stay with that pattern.
Adapted documentation in netif.h
Signed-off-by: goldsimon <goldsimon@gmx.de >
2018-02-28 22:48:56 +01:00
goldsimon
3a8af612b3
lowpan6.c: handle 6-byte MAC addresses on netif, too
2018-02-28 22:46:55 +01:00
goldsimon
2a5b66c9b1
lowpan6.c: tiny whitespace fix
2018-02-28 22:32:58 +01:00
goldsimon
3a93029e92
lowpan6.c: implement software CRC (e.g. required for use with ZEP)
2018-02-28 21:39:38 +01:00
goldsimon
fe68fa49f7
lowpan6.c: refactor parsing and writing the ieee 802.15.4 header to separate function
2018-02-28 21:38:49 +01:00
goldsimon
5e91cd47c9
lowpan6.c: ensure netif->hwaddr_len == 8 (to not create invalid frames)
2018-02-28 21:09:55 +01:00
goldsimon
4f059fea76
fix some IEEE_802154_FC_ bit definitions
2018-02-28 21:03:40 +01:00
goldsimon
569464ffd3
lowpan6.c: move static variables declared inside lowpan6_frag into lowpan6_data
2018-02-28 20:42:31 +01:00
Axel Lin
6e6eb620df
tftp_opts.h: Make TFTP_DEBUG default OFF
...
TFTP_DEBUG should be enabled only when it's necessary to debug tftp,
make it default OFF.
Signed-off-by: Axel Lin <axel.lin@ingics.com >
2018-02-28 13:49:44 +08:00
Axel Lin
3c71e3fc77
lowpan6_ble_opts.h: Make LWIP_RFC7668_DEBUG default OFF
...
Signed-off-by: Axel Lin <axel.lin@ingics.com >
2018-02-27 18:04:36 +08:00
Axel Lin
2e2c607727
lowpan6.c: Fix ‘lowpan6_context_lookup’ defined but not used build warning
...
Fix build warning with LWIP_6LOWPAN_NUM_CONTEXTS==0.
lowpan6_context_lookup() is only used when LWIP_6LOWPAN_IPHC &&
LWIP_6LOWPAN_NUM_CONTEXTS > 0.
Signed-off-by: Axel Lin <axel.lin@ingics.com >
2018-02-27 18:01:18 +08:00
goldsimon
49acdae8d0
lowpan6.c: fix building with LWIP_6LOWPAN_NUM_CONTEXTS==0
2018-02-27 10:07:15 +01:00
goldsimon
7db978ca03
lowpan6.c: rework lowpan6_input processing of the ieee 802.15.4 header
...
This should fix bug #48825 (lowpan6: source PAN ID is skipped without
checking PAN ID compression flag)
2018-02-26 21:47:24 +01:00
goldsimon
731b83ac5f
lowpan6.c: a netif input function must return ERR_OK only if the input pbuf was freed
2018-02-26 20:51:13 +01:00
goldsimon
fb5bbca1d9
lowpan6.c: move IEEE 802.15.4 definitions to their own header file
...
This is mainly a preparation to merge the two 6LoWPAN netifs
2018-02-26 20:38:41 +01:00
goldsimon
a022590f40
lowpan6.c: move netif-specific data to a common struct
2018-02-26 20:32:39 +01:00
Axel Lin
c28aa02820
lowpan6_ble: Convert to use pbuf_remove_header instead of pbuf_header
...
Signed-off-by: Axel Lin <axel.lin@ingics.com >
2018-02-26 10:20:05 +08:00
goldsimon
e7766297de
dhcp6_disable: need to set pcb_allocated to zero
...
See bug #53224 : dhcp6_disable() pcb_allocated need set to zero.
2018-02-25 13:20:28 +01:00
Axel Lin
265f6f5047
lowpan6_ble: Fix build warning if LWIP_RFC7668_LINUX_WORKAROUND_PUBLIC_ADDRESS==0
...
Fix unused parameter ‘public_addr’ build warning if
LWIP_RFC7668_LINUX_WORKAROUND_PUBLIC_ADDRESS==0.
Signed-off-by: Axel Lin <axel.lin@ingics.com >
2018-02-25 12:05:24 +08:00
Axel Lin
7697a45405
lowpan6_ble_opts.h: Add #ifndef guard for LWIP_RFC7668_LINUX_WORKAROUND_PUBLIC_ADDRESS
...
Avoid "LWIP_RFC7668_LINUX_WORKAROUND_PUBLIC_ADDRESS" redefined build
warning if it's set to 0 by lwipopts.h.
Signed-off-by: Axel Lin <axel.lin@ingics.com >
2018-02-25 12:01:01 +08:00
Our Air Quality
59e98ccb19
tcp_output_fill_options: account for the SACKS length in assertion.
2018-02-24 14:46:44 +01:00
goldsimon
56124bf53b
Add check in init.c: altcp does not work with LWIP_EVENT_API
2018-02-24 14:43:51 +01:00
goldsimon
a3034a442b
lowpan6_ble: fix compiling with LWIP_RFC7668_NUM_CONTEXTS==0
2018-02-24 11:39:31 +01:00
goldsimon
2ce3c79ec5
lowpan6_ble.c: travis complains...
2018-02-23 14:00:56 +01:00
goldsimon
a8d789e7b3
add lowpan6_ble.c to Filelists.mk
2018-02-23 13:19:27 +01:00
goldsimon
c510e92cf4
get lowpan6_ble.c to compile
2018-02-23 13:16:14 +01:00
goldsimon
69eaafecca
lowpan6_ble.c: fixed whitespace & indentation
2018-02-23 13:08:00 +01:00
Benjamin Aigner
10209ee788
Added a RFC7668 netif.
...
Works as expected, but some features are not implemented yet.
(See patch #9364 : RFC7668 - 6lowpan over Bluetooth Low Energy -- a new netif)
(I've change the file names only; sg)
Signed-off-by: goldsimon <goldsimon@gmx.de >
2018-02-23 13:07:31 +01:00
Dirk Ziegelmeier
f595445ec0
Some fixes to DHCPv6 documentation
2018-02-23 12:54:51 +01:00
Dirk Ziegelmeier
aa04944ae0
Add DHCPv6 to documentation
2018-02-23 12:35:45 +01:00
goldsimon
d2ee10977f
dhcp6: try to fix docs (clang complains)
2018-02-23 10:26:19 +01:00
goldsimon
7ad680c2bf
Try to fix dhcp6.c on travis
2018-02-23 09:54:04 +01:00
goldsimon
7d007cfee5
DHCPv6: make LWIP_IPV6_DHCP6_STATELESS==LWIP_IPV6_DHCP6 by default
2018-02-23 09:26:46 +01:00
goldsimon
8600259a78
tiny cleanup in dhcp.c
2018-02-22 22:33:48 +01:00
goldsimon
76a13054ee
add initial support for stateless DHCPv6
...
Signed-off-by: goldsimon <goldsimon@gmx.de >
2018-02-22 22:33:16 +01:00
goldsimon
37b4494921
http_client: fix function documentation
2018-02-22 09:55:32 +01:00
goldsimon
0ee0393936
fix compiling http_client and altcp_proxyconnect with gcc
2018-02-22 09:12:51 +01:00
Axel Lin
fe3bb8bb78
etharp: Remove superfluous assert checking in free_etharp_q
...
The same checking is done while iterating the list in the while loop.
Signed-off-by: Axel Lin <axel.lin@ingics.com >
2018-02-22 11:27:29 +08:00
Axel Lin
e93cecf527
Fix build error for http files
...
The HTTPDFILES is renamed to HTTPFILES now.
Fixes: 1f0867299d ("add new http files to Filelists.mk")
Signed-off-by: Axel Lin <axel.lin@ingics.com >
2018-02-22 09:21:33 +08:00
goldsimon
1f0867299d
add new http files to Filelists.mk
2018-02-21 22:17:51 +01:00
goldsimon
7b9e145fc5
http_client: change user-agent and make it overridable
2018-02-21 20:18:29 +01:00
goldsimon
2753eb1fb1
add an altcp layer for http proxy connect (e.g. to tunnel TLS through a http proxy)
...
Signed-off-by: goldsimon <goldsimon@gmx.de >
2018-02-21 20:18:05 +01:00
goldsimon
a0e900dd02
makefsdata: update usage output to code
2018-02-21 14:42:47 +01:00
goldsimon
325cdf3c0b
altcp_tls_mbedtls: restructure upper callbacks to prevent double-free
...
This fixes bug #53192 : use-after-free in altcp_mbedtls
Signed-off-by: goldsimon <goldsimon@gmx.de >
2018-02-21 14:20:34 +01:00
goldsimon
a7b43dae49
altcp: default shutdown for both sides is close
2018-02-21 12:50:42 +01:00
goldsimon
d66c0e3381
altcp: mbedtls: move freeing state->rx from close to dealloc (catch-all)
2018-02-20 22:12:11 +01:00
goldsimon
bcff67b00e
altcp_tls_alloc: need to close inner conn instead of freeing it
2018-02-20 17:08:00 +01:00
goldsimon
3bd87e3815
doc: altcp: keep altcp_alloc/altcp_free out of the docs
...
Those functions are for implementing altcp layers, not for applications
2018-02-20 14:08:04 +01:00
Dirk Ziegelmeier
333fff3e66
Improve altcp allocator documentation
2018-02-20 13:31:27 +01:00
Dirk Ziegelmeier
fc3c186289
Improve altcp allocator documentation
2018-02-20 13:25:50 +01:00
goldsimon
3a41f4fe8a
altcp_alloc: add to Filelists.mk
2018-02-20 11:21:32 +01:00
Axel Lin
e9bd31b190
icmp6: Fix "LWIP_ICMP6_DATASIZE" redefined build warning if it was set to 0
...
Need to undefine LWIP_ICMP6_DATASIZE before change the setting.
While at it, also remove the unneeded #ifndef LWIP_ICMP6_DATASIZE
checking because it is set in lwip/opt.h.
Signed-off-by: Axel Lin <axel.lin@ingics.com >
2018-02-20 17:54:49 +08:00
Axel Lin
a894140bb0
igmp: Use angle brackets for including string.h
...
Use angle brackets(<>) for including system header files.
Signed-off-by: Axel Lin <axel.lin@ingics.com >
2018-02-20 15:20:14 +08:00
goldsimon
842b9f4429
altcp: simplify creating different types by adding an allocator concept
...
This is done with an example in the http_client
Signed-off-by: goldsimon <goldsimon@gmx.de >
2018-02-19 21:41:48 +01:00
Dirk Ziegelmeier
5b33d33e34
Add HTTP client to documentation
2018-02-19 09:01:44 +01:00
Dirk Ziegelmeier
2501913cde
Move ethernetif.c from lwIP main rep to contrib examples directory where it has a chance to be actually found by users
2018-02-19 07:46:56 +01:00
Dirk Ziegelmeier
47c55c3d96
Improve documentation for 6LOWPAN and SLIPIF
2018-02-18 17:49:54 +01:00
goldsimon
ef29f2d401
http_client: httpc_tcp_recv did not return inner_conn's recv return value
...
Signed-off-by: goldsimon <goldsimon@gmx.de >
Reported-by: Our Air Quality <info@ourairquality.org >
2018-02-18 09:02:00 +01:00
goldsimon
ca0a356221
sockets_stresstest: don't compile when LWIP_SOCKET is disabled
2018-02-18 08:56:57 +01:00
goldsimon
e6f0700c81
fuzz: fix compile error, ignore 0 length pbufs
2018-02-18 08:56:23 +01:00
goldsimon
b5448a86fd
ip4_reass: free datagram entry if p == NULL
2018-02-18 08:55:11 +01:00
Dirk Ziegelmeier
5b459c1282
dns.h depends on err.h
2018-02-17 16:53:03 +01:00
goldsimon
2b09c18c4e
altcp_tls.h: minor whitespace cleanup
2018-02-16 13:59:00 +01:00
goldsimon
2648d30843
altcp_tls_mbedtls.c: tiny function rename
2018-02-16 13:57:38 +01:00
goldsimon
bd656efd64
http client: add https support, fix parsing header with chained pbufs
2018-02-16 12:29:40 +01:00
goldsimon
e87392cc85
http client: fix proxy support
2018-02-16 09:18:35 +01:00
goldsimon
3dafa72ec8
apps: add http client
...
Signed-off-by: goldsimon <goldsimon@gmx.de >
2018-02-15 22:10:29 +01:00
goldsimon
d4c4b0eec5
rename folder 'src/apps/httpd' to 'http'
...
Signed-off-by: goldsimon <goldsimon@gmx.de >
2018-02-15 20:13:25 +01:00
goldsimon
58de2af5f2
test/fuzz: add some applications, add an experimental multi-packet mode
...
The experimental multi-packet mode splits input bytes depending on a length
decoded from the first 2 bytes and does that until the end of input.
To use this mode, compile with "make D=-DLWIP_FUZZ_MULTI_PACKET"
Signed-off-by: goldsimon <goldsimon@gmx.de >
2018-02-15 14:35:08 +01:00
goldsimon
cd1516e2e4
mqtt: rewrote check for topc_len so that coverity is happy...
2018-02-15 09:15:40 +01:00
goldsimon
216f21dcd1
simple whitespace cleanup
2018-02-15 06:41:16 +01:00
Axel Lin
5d5b8fbb46
Fix trivial copy & paste mistake for comment in header files
...
Signed-off-by: Axel Lin <axel.lin@ingics.com >
2018-02-14 22:49:12 +08:00
goldsimon
133bf70ab5
mqtt: slightly change some overflow checks
2018-02-14 12:37:35 +01:00
goldsimon
eea95459c9
mqtt: add more length validity checks in mqtt_message_received
...
This also (but not only) fixes bug #52345 ("MQTT buffer length check seems wrong")
2018-02-14 12:08:15 +01:00
goldsimon
546a8c4860
Revert "vj_compress_tcp: help coverity to see we're not accessing out of bounds (this is a union)"
...
This reverts commit 2390eb6826 .
I've already marked other issues like this as 'invalid', so do this here, too.
Although I don't like the code, there's not much use in fixing this in one place only.
2018-02-14 07:34:05 +01:00
goldsimon
e926779510
netif_alloc_client_data_id: only present if LWIP_NUM_NETIF_CLIENT_DATA
...
In contrast to netif_get_client_data, netif_alloc_client_data_id() is only
available if LWIP_NUM_NETIF_CLIENT_DATA > 0, not for DHCP etc.
This is correct in netif.c but wrong in netif.h
2018-02-14 07:19:46 +01:00
goldsimon
731336223f
mqtt: add comments in mqtt_parse_incoming
2018-02-14 06:54:56 +01:00
Joel Cunningham
618a28fc53
memp: remove include of sockets.h
...
Socket memory pool types have been migrated to sockets_priv.h so we
no longer need to include sockets.h
2018-02-13 14:04:01 -06:00
goldsimon
2390eb6826
vj_compress_tcp: help coverity to see we're not accessing out of bounds (this is a union)
2018-02-13 12:47:00 +01:00
goldsimon
5ee77262bc
mem plug_holes: fix copy& paste error
2018-02-13 12:24:10 +01:00
goldsimon
bcb6819715
dns_compare_name: change check for u16_t overflow
...
check upper border (0xFFFF) instead of checking for 0 after overflow
2018-02-13 12:23:50 +01:00
goldsimon
d4047ea1d1
Try to fix issues reported by coverity
2018-02-13 12:10:19 +01:00
goldsimon
e20e9bc3d4
Try to fix issues reported by coverity
2018-02-13 12:09:18 +01:00
Dirk Ziegelmeier
d5d635cdce
Minor DNS documentation improvement
2018-02-13 10:58:32 +01:00
Axel Lin
47946a29e9
memp: Remove include of lwip/netifapi.h from memp.c
...
struct netifapi_msg is defined in lwip/priv/api_msg.h rather than
lwip/netifapi.h. Thus remove include of lwip/netifapi.h from memp.c.
Signed-off-by: Axel Lin <axel.lin@ingics.com >
2018-02-13 16:52:18 +08:00
goldsimon
b5e67f142a
tcp: LWIP_CHECKSUM_ON_COPY: fix adding data to retx segment
...
See bug #50914( TCP_CHECKSUM_ON_COPY when adding data to
retransmission): when adding data to an already transmitted segment
that has an uneven length, the checksum was wrong.
To fix this, tcp_output_segment has to restore seg->chksum_swapped
before returning.
2018-02-12 12:38:17 +01:00
goldsimon
7b6d2870ca
test: add a unit test for TCP_CHECKSUM_ON_COPY with retransmissions
...
This triggers bug #50914 (TCP_CHECKSUM_ON_COPY when adding data to
retransmission) when data is added to an already transmitted segment
with an uneven length of tcp data.
2018-02-12 12:34:45 +01:00
goldsimon
cff31ba5de
test: enable LWIP_CHECKSUM_ON_COPY and TCP_CHECKSUM_ON_COPY_SANITY_CHECK
...
To find and verify bug #50914 (TCP_CHECKSUM_ON_COPY when adding data to
retransmission), enable checksum-on-copy for the unit tests.
2018-02-12 12:32:40 +01:00
Dirk Ziegelmeier
093adf8322
Fix typo in MQTT port #define
2018-02-11 11:57:22 +01:00
goldsimon
8fa55e32d2
add MEM_OVERFLOW_CHECK and combine code with MEMP_OVERFLOW_CHECK
...
This moves untouched memory check and defines from memp.c and memp_priv.h
to mem.c and mem_priv.h (which is new).
2018-02-09 13:44:10 +01:00
goldsimon
010b0210ba
netif: ext_callback: make LWIP_NSC_ defines, not an enum; fix mdns accordingly
...
Re-applied after reverting d6e58d02a6
2018-02-08 12:36:26 +01:00
goldsimon
f201d261b2
Revert "MDNS send probes to verify domain before use"
...
This reverts commit d6e58d02a6 .
Erik seems to have commit this by accident. Let's discuss this first
(see patch #9555 )
2018-02-08 12:28:04 +01:00
goldsimon
3cf906e073
Revert "netif: ext_callback: make LWIP_NSC_ defines, not an enum; fix mdns accordingly"
...
This reverts commit 6934bb4428 .
Need to revert commit d6e58d02a6 first, and that one produced merge conflicts.
2018-02-08 12:26:16 +01:00
Joel Cunningham
d785561eae
tcpip: guard tcpip_msg enum/struct member with !CORE_LOCKING
...
enum tcpip_msg_type and struct tcpip_msg have members which are only
used when core locking and/or core locking input are disabled. Remove
these from the union to reduce the size. Remove from enum to prevent
usage when these are options are disabled
A quick sizeof test with MSVC 2013 showed a 4 byte size reduction for
struct tcpip_msg (16 bytes -> 12bytes) for the following configuration:
LWIP_TCPIP_CORE_LOCKING 1
LWIP_TCPIP_CORE_LOCKING_INPUT 1
LWIP_TCPIP_TIMEOUT 0
2018-02-07 16:03:41 -06:00
goldsimon
f7be3d10ae
httpd: create "connection" and "content-length" headers when file is ready
...
see patch #9500
2018-02-07 21:27:42 +01:00
goldsimon
e8d7e82c8c
httpd: fix simple typo
2018-02-07 21:19:07 +01:00
goldsimon
f9300c1fb0
netif: ext_callback: clean up netif_set_addr after last change
2018-02-07 20:37:29 +01:00
goldsimon
6934bb4428
netif: ext_callback: make LWIP_NSC_ defines, not an enum; fix mdns accordingly
2018-02-07 20:35:49 +01:00
Joel Cunningham
030ffdee82
sockets: remove ERR_CLSD case after data receive
...
With the changes introduced in b1b6275110
it's no longer possible to get ERR_CLSD from netconn_recv_tcp_pbuf_flags
after we've received data because of the NETCONN_NOFIN flag, so remove
handling for this case. Further the NETCONN_EVT_RCVPLUS stays active in
netconn_recv_data_tcp when the NETCONN_NOFIN flag is used
2018-02-05 13:50:16 -06:00
goldsimon
b1b6275110
socket/netconn recv: FIN should only be reported once
...
FIN should only be reported once (as '0' for sockets, as 'ERR_CLSD' for
netconns). Before this change, ERR_CLSD was returned forever...
This is the 2nd try. First try (commit ebcae98ae6 )
was buggy in that it could drop the FIN if it was read together with data
(reverted in commit ebcae98ae6 ).
This version fixes this by adding an apiflag and a netconn flag to keep
track of this.
2018-02-04 20:16:53 +01:00
goldsimon
fe828634ac
socket unit test: check receiving FIN together with data works
2018-02-04 20:14:02 +01:00
goldsimon
dc882801bb
tcp: document TCP_EVENT_ERR exception for SYN_RCVD
2018-02-04 14:19:39 +01:00
goldsimon
2a4dd0dc7b
altcp: priority-based pcb/conn allocation required
...
altcp_tcp_new_ip_type: allocate the tcp pcb first to invoke the
priority handling code if we're out of pcbs
2018-02-04 14:00:23 +01:00
goldsimon
f9bc3cae5d
docs: make hook documentation a little nicer
2018-02-04 13:36:41 +01:00
goldsimon
c6b5527710
Improve LWIP_ASSERT_CORE_LOCKED documentation a bit
2018-02-04 13:20:55 +01:00
goldsimon
9d087ad2d2
Add LWIP_ASSERT_CORE_LOCKED() to ppp (see task #14780 )
...
Signed-off-by: goldsimon <goldsimon@gmx.de >
2018-02-03 22:13:32 +01:00
goldsimon
ea2e628ac3
httpd: get_http_headers: refactor decision for add_content_len
2018-02-03 21:58:45 +01:00
goldsimon
1a75112b47
httpd: ensure hs->keepalive is 0 if content length is not sent
...
Connections for custom files without the persistent flag were not
closed without this change.
Signed-off-by: goldsimon <goldsimon@gmx.de >
2018-02-03 21:53:44 +01:00
goldsimon
053a5e6e13
httpd: get_http_headers: fix content length check for custom files
...
Headers are never included here or else get_http_headers would not
have been called.
As a result, custom files need to set FS_FILE_FLAGS_HEADER_PERSISTENT
in file->flags if file->len is the correct length of the file.
See also patch #9500
Signed-off-by: goldsimon <goldsimon@gmx.de >
2018-02-03 21:51:33 +01:00
goldsimon
d5d30d49f2
httpd: check that file data is present when dynamic read is disabled
...
Signed-off-by: goldsimon <goldsimon@gmx.de >
2018-02-02 21:31:36 +01:00
Erik Ekman
23c933fd16
Fix annotation in function documentation
...
clang failed to build:
../../../../lwip/src/include/lwip/tcp.h:180:11: error: parameter 'ERR_OK' not found in the function declaration [-Werror,-Wdocumentation]
* @param ERR_OK if OK, any error if connection should be dropped
^~~~~~
2018-02-02 11:13:35 +01:00
Jens Nielsen
d6e58d02a6
MDNS send probes to verify domain before use
2018-02-02 11:10:09 +01:00
goldsimon
6706b3778e
httpd: add "struct file*" parameter to httpd_cgi_handler() callback
2018-02-02 09:29:52 +01:00
Giuseppe Modugno
ab281cb750
httpd: move httpd_cgi_handler() call
...
This patch moves in advance httpd_cgi_handler() call, before assigning
variables like hs->file and hs->left.
In this way, CGI handler could prepare the reply data and set the
"file properties", like file->data and file->len. At the exit, hs->file
and hs->left is correctly assigned.
The handler prototype says it can't access file pointer, however it is
simple to obtain it after setting LWIP_HTTPD_FILE_STATE that enables a
"file state" pointer. It is sufficient to assign file->state to file
itself in fs_open_custom().
For example, I have the request GET /login.cgi?user=admin&pwd=admin and
I have to reply with some JSON data. The answer depends on parameters
user and pwd passed in the query string.
2018-02-02 09:12:42 +01:00
goldsimon
7edbd95b50
tcp_out: fix unused parameter when all options are off
2018-02-02 09:01:21 +01:00
Axel Lin
31c71fee46
doc/savannah.txt: Use RSA instead of DSA
...
The documentation on savannah recommends using only RSA keys, not DSA.
(reference http://savannah.gnu.org/maintenance/SshAccess/ )
Thus update the doc/savannah.txt to us RSA instead.
Signed-off-by: Axel Lin <axel.lin@ingics.com >
Acked-by: Simon Goldschmidt <goldsimon@gmx.de >
2018-02-02 12:29:47 +08:00
goldsimon
fa9082116f
tcp: add 2 hooks to add custom options to outgoing tcp segments
...
Signed-off-by: goldsimon <goldsimon@gmx.de >
2018-02-01 09:31:15 +01:00
goldsimon
77d0ee0961
tcp: add LWIP_HOOK_TCP_INPACKET_PCB
...
This hook is called from tcp_input() for all kinds of input pcbs when
selected to receive a pbuf (LISTEN, TIME_WAIT, rest). I can parse or
drop an rx pbuf.
Signed-off-by: goldsimon <goldsimon@gmx.de >
2018-02-01 09:19:16 +01:00
goldsimon
0e85582bc0
tcp: introduce ext_args per pcb
...
This introduces the concept of ext (external/extended) arguments per
tcp_pcb (also for listening pcbs) to store more data than just one
"void *arg" per pcb. The "arg" is for use to applications, whereas
the ext_args may be used by frameworks and leave "arg" untouched.
In addition to a void pointer, callbacks are added to help frameworks
migrate arguments from listen pcb to connection pcb and to free args
when the pcb is freed.
Signed-off-by: goldsimon <goldsimon@gmx.de >
2018-02-01 09:19:16 +01:00
goldsimon
ebe782ba16
tcp: centralize freeing tcp pcbs to memp_free
...
This should make it easier to add debugging messages or other hooks
to the point where tcp pcbs are deallocated.
Signed-off-by: goldsimon <goldsimon@gmx.de >
2018-02-01 09:19:15 +01:00
goldsimon
ce79811bce
sockets: add hooks to implement additional socket options
...
LWIP_HOOK_SOCKETS_SETSOCKOPT() and LWIP_HOOK_SOCKETS_GETSOCKOPT()
are introduced to implement additional socket options. The hooks
are always called first and report back if they handled the option
or not.
Signed-off-by: goldsimon <goldsimon@gmx.de >
2018-02-01 09:19:15 +01:00
goldsimon
61671d6df0
tcp_out: make some more pointers const
2018-02-01 09:18:24 +01:00
goldsimon
9fb86f6e4b
tcp: add a define for maximum option bytes
2018-02-01 09:14:22 +01:00
Axel Lin
2c3c578475
apps/smtp: Fix wrong sizeof for memset s->bodydh
...
Use sizeof(struct smtp_bodydh_state) to zero all fields of s->bodydh.
Signed-off-by: Axel Lin <axel.lin@ingics.com >
2018-01-31 09:07:48 +08:00
Joel Cunningham
64a351cbe0
tcp_out: remove CHECKSUM_GEN_TCP case from tcp_send_empty_ack
...
CHECKSUM_GEN_TCP support was moved to tcp_output_control_segment
so we can remove usage of tcphdr and the extra set of #if/#endif
This fixes https://travis-ci.org/yarrick/lwip-merged/builds/335348098
2018-01-30 17:35:40 -06:00
goldsimon
0ee7a39594
tcp: add comments about usage of options
2018-01-30 22:01:54 +01:00
goldsimon
424c33bcb7
tcp_out: combine the tx path of the 4 direct tx functions
...
tcp_rst, tcp_send_empty_ack, tcp_keepalive and tcp_zero_window_probe
all execute the same instructions to send a segment pbuf.
Combined into tcp_output_control_segment().
2018-01-30 21:50:41 +01:00
goldsimon
9128a51944
tcp_out: make tcp_output_alloc_header generic enough for tcp_rst
2018-01-30 21:46:48 +01:00
goldsimon
1570dd8ad1
tcp_abandon: no need to buffer pcb->local_port
2018-01-30 21:43:18 +01:00
goldsimon
fdbc9f9b32
tcp_out: move around functions to group them together
...
This file has been a mess regarding the order of the functions.
By moving them around, they can be grouped into functions taking
part in normal data transmission (via unsent/unacked) and control
segments (which are allocated, directly sent and freed).
Signed-off-by: goldsimon <goldsimon@gmx.de >
2018-01-30 21:06:44 +01:00
goldsimon
dd6c43ecbd
tcp_out: documentation update
2018-01-30 20:49:47 +01:00
goldsimon
ad3937df58
tcp: tiny doc update (mention tcp_output)
2018-01-30 20:20:22 +01:00
goldsimon
c597cfd6ca
tcp_create_segment: rename arg 'flags' to 'hdrflags'
...
The argument name 'flags' is too unspecific because there is another
argument named 'optflags'.
2018-01-30 12:26:13 +01:00
Dirk Ziegelmeier
40997c4a08
Apply (modified) patch #9552 : tftp_cleanup() for cleanup and filename buffer zeroing to prevent filename bugs
...
... without the memset to zero out the filename
2018-01-29 06:59:47 +01:00
goldsimon
83ff2014ae
tcp_enqueue_flags: no need to check pcb->snd_queuelen
...
We only allow SYN or FIN in this functions and FIN shall always come
through, so no need to check pcb->snd_queuelen
2018-01-28 20:57:53 +01:00
goldsimon
d6cf8a3e38
tcp_out: improved some comments
2018-01-28 20:56:52 +01:00
goldsimon
93f9c56c32
fix bug #52976 : lwip_ioctl() FIONREAD crash
2018-01-27 14:45:17 +01:00
goldsimon
05ba509e33
mdns: clarify usage of ip_addr_cmp_zoneless()
2018-01-26 06:32:35 +01:00
goldsimon
de68c5bed6
altcp_mbedtls_sndbuf: use mbedtls_ssl_get_record_expansion()
2018-01-25 13:15:49 +01:00
goldsimon
6606c4013f
bug #52893 : Add 'old_stat' save in LWIP_NSC_IPV6_ADDR_STATE_CHANGED callback message
2018-01-25 13:05:33 +01:00
goldsimon
fe2c249fb7
bug #52937 : raw_input() must tell ip4/6_input() if protocol has been received
...
This also moves "raw_input" and "raw_netif_ip_addr_changed" to a new file
raw_priv.h
2018-01-25 12:51:46 +01:00
goldsimon
ebda5cb04e
ip_addr.h: add IP_ADDR_RAW_SIZE() to know the memcpy size of an IP
2018-01-23 06:53:45 +01:00
goldsimon
5b75ad9019
Fix bug #52949 : udp_input() checksum error for LWIP_CHECKSUM_CTRL_PER_NETIF
2018-01-22 19:51:45 +01:00
Mike Kleshov
84fcd6290e
[patch #9548 ] Add .json to list of SSI file extensions
...
Signed-off-by: goldsimon <goldsimon@gmx.de >
2018-01-22 19:49:10 +01:00
Mike Kleshov
76826c1622
[patch #9547 ] Bring some comments in httpd.h up to date
...
Signed-off-by: goldsimon <goldsimon@gmx.de >
2018-01-22 19:47:16 +01:00
goldsimon
9dbfa9ca0a
lwiperf: enable TCP over IPv6 connections
...
tested against iperf 2.0.10
redefine LWIPERF_SERVER_IP_TYPE if you don't want both IP versions
2018-01-19 21:08:51 +01:00
goldsimon
a696b2b515
lwiperf: fix testing against iperf 2.0.10 (bug #52901 )
2018-01-17 20:54:16 +01:00
goldsimon
a7a8d9273c
sockets_stresstest: replace printf with LWIP_DEBUGF, fix unused arg
2018-01-17 19:46:32 +01:00
goldsimon
9cf6bbf573
memp_std.h: make MEMP_PBUF a normal pool
...
No need to use LWIP_PBUF_MEMPOOL here since this pool never contains
pbufs with payload included.
2018-01-17 12:54:00 +01:00
goldsimon
2fd2b6810e
memp_std.h: fix LWIP_PBUF_MEMPOOL element size for MEMP_OVERFLOW_CHECK
...
The LWIP_PBUF_MEMPOOL define used MEMP_ALIGN_SIZE instead of
LWIP_MEM_ALIGN_SIZE to calculate the element size of PBUF_POOL pbufs.
This is wrong for MEMP_OVERFLOW_CHECK, since MEMP_ALIGN_SIZE adds
MEMP_SANITY_REGION_AFTER_ALIGNED. This should be only added during
pool_base buffer allocation but for PBUF_POOL, it changed the size
of the pool elements.
2018-01-17 12:51:49 +01:00
goldsimon
d12d6abae8
minor whitespace/indentation cleanup
2018-01-17 12:27:17 +01:00
Joel Cunningham
f3c289d966
sockets: add core lock assert to select_check_waiters
...
Assert the requirement that the core is locked in select_check_waiters
2018-01-16 18:52:45 -06:00
goldsimon
8a27408eb2
altcp_tls_mbedtls: hide allocation strategy in altcp_tls_create_config()
2018-01-16 21:41:44 +01:00
David Girault
42f14a96fb
altcp_tls: avoid use of static in altcp_tls_config
...
cert and pkey are allocated with the altcp_tls_config structure.
Signed-off-by: goldsimon <goldsimon@gmx.de >
2018-01-16 21:03:43 +01:00
David Girault
c7106cc57f
altcp_tls: fix pbuf leaked when handshake failed
...
Signed-off-by: goldsimon <goldsimon@gmx.de >
2018-01-16 20:56:15 +01:00
goldsimon
30ddfe1a98
Make LWIP_VERSION work with the preprocessor again.
2018-01-16 20:37:10 +01:00
Dirk Ziegelmeier
51369854b5
Fix bug #52911 : SNMPv3 time window check is not the same as RFC3414
2018-01-16 13:30:31 +01:00
Dirk Ziegelmeier
72fc4a6ca5
Documentation - "Common pitfalls": Add some words about buffer alignment
2018-01-16 10:59:42 +01:00
goldsimon
2fd83c9d2e
lwiperf: fix double-free of pbufs on recv error
2018-01-16 06:54:28 +01:00
Dirk Ziegelmeier
330793d94d
Fix bug #52880 : ethernet_output() Compile error.
2018-01-14 09:24:41 +01:00
goldsimon
28c8693683
mqtt: fix documentation error (remove ':' after param name)
2018-01-13 16:09:17 +01:00
goldsimon
f343a67b40
netif unit test: add some more tests for ext callbacks
2018-01-13 15:22:09 +01:00
goldsimon
e645d00484
netif unit test: fix -Werror=c++-compat
2018-01-13 15:16:12 +01:00
goldsimon
4a99721751
netif: try to fix gcc error (-Werror=c++-compat)
2018-01-13 09:38:18 +01:00
goldsimon
734b6ab57a
netif: ensure netif_set_addr() only results in one "ext_status_callback"
...
This can be used e.g. in mdns to create one, not multiple "changed" triggers
if IP address and netmask change at the same time.
2018-01-12 23:11:38 +01:00
goldsimon
fa75ffed9d
unit tests: added test_netif (checking ext_callbacks only, for now)
2018-01-12 22:27:15 +01:00
goldsimon
452c6a5378
netif: add netif_remove_ext_callback() (counterpart to netif_add_ext_callback())
2018-01-12 22:25:34 +01:00
goldsimon
d115b28057
netif: change netif_nsc_reason_t to flags (preparation only)
2018-01-12 22:24:45 +01:00
goldsimon
0b2b22338a
tcpip_thread_poll_one: remove invalid comment in this function
2018-01-12 20:41:11 +01:00
goldsimon
eb51b683ed
fix copy & paste error in comment
2018-01-12 20:29:12 +01:00
Dirk Ziegelmeier
94ad523357
Update lwip.Doxyfile to doxygen 1.8.13
2018-01-12 15:01:14 +01:00
Dirk Ziegelmeier
46cb0a796b
Forgot to add LWIP_ASSERT_CORE_LOCKED() to http_continue function
2018-01-12 13:35:20 +01:00
Dirk Ziegelmeier
653313cb37
Work on task #14780 : Add debug helper asserts to ensure threading/locking requirements are met
...
Add LWIP_ASSERT_CORE_LOCKED() to several more places
2018-01-12 13:15:36 +01:00
Dirk Ziegelmeier
67ad6e45db
Add assertion that checks for a maximum msecs value for sys_timeout()
2018-01-12 12:38:25 +01:00
Dirk Ziegelmeier
990c25d4f3
Add unit test for a long running timer
2018-01-12 12:37:16 +01:00
David Girault
6ccd12b97c
altcp_mbedtls: added altcp_mbedtls_sndbuf implementation
...
Signed-off-by: goldsimon <goldsimon@gmx.de >
2018-01-11 10:34:55 +01:00
goldsimon
eab1b45cba
tcpip: give the tcpip_thread mbox a better name
...
This also fixes shadowing 'mbox' in tcpip_timeouts_mbox_fetch()
2018-01-11 09:56:43 +01:00
Dirk Ziegelmeier
b6b14438b7
Rename lwip_sys_timers_get_next_timout() to sys_timeouts_get_next_timeout()
2018-01-11 09:53:07 +01:00
goldsimon
c257b56a39
move sys_timeouts_mbox_fetch() to tcpip_timeouts_mbox_fetch()
...
This cleans up the code: sys_timeouts_mbox_fetch() was only used from
tcpip.c anyway, so let's move it there.
Signed-off-by: goldsimon <goldsimon@gmx.de >
2018-01-11 09:39:36 +01:00
Axel Lin
39ada6ec0e
ip_addr: Define ip_addr_cmp_zoneless for LWIP_IPV6 only
...
This fixes build error when LWIP_IPV4=0 && LWIP_IPV6=1:
cc -g -Wall -DLWIP_DEBUG -pedantic -Werror -Wparentheses -Wsequence-point -Wswitch-default -Wextra -Wundef -Wshadow -Wpointer-arith -Wcast-qual -Wc++-compat -Wwrite-strings -Wold-style-definition -Wcast-align -Wmissing-prototypes -Wredundant-decls -Wnested-externs -Wunreachable-code -Wuninitialized -Wlogical-op -I. -I../../.. -I../../../../lwip/src/include -I../../../ports/unix/port/include -I../../../../mbedtls/include -Wno-redundant-decls -DLWIP_HAVE_MBEDTLS=1 -c ../../../../lwip/src/apps/mdns/mdns.c
../../../../lwip/src/apps/mdns/mdns.c: In function ‘mdns_recv’:
../../../../lwip/src/apps/mdns/mdns.c:1817:10: error: implicit declaration of function ‘ip_addr_cmp_zoneless’; did you mean ‘ip6_addr_cmp_zoneless’? [-Werror=implicit-function-declaration]
if (!ip_addr_cmp_zoneless(ip_current_dest_addr(), &v6group)) {
^~~~~~~~~~~~~~~~~~~~
ip6_addr_cmp_zoneless
../../../../lwip/src/apps/mdns/mdns.c:1817:10: error: nested extern declaration of ‘ip_addr_cmp_zoneless’ [-Werror=nested-externs]
cc1: all warnings being treated as errors
Signed-off-by: Axel Lin <axel.lin@ingics.com >
2018-01-09 21:24:12 +01:00
goldsimon
2d06483d8e
ip4_frag: don't use LWIP_ERROR where we might depend in input data
...
fuzz test revealed that an ip header with options might land in ip4_frag() via ICMP. In this case, we can't use LWIP_ERROR() to check for not having ip options as that might be defined to assert
2018-01-09 10:25:41 +01:00
Axel Lin
deab51c36d
netif: Remove unnecessary NULL checking in netif_do_set_{ipaddr|netmask|gw}
...
The callers already ensure the ipaddr/netmask/gw won't be NULL, so remove
the duplicated NULL checking in these static functions.
While at it, also move the code saving old_address for netmask/gw as
it's only used when address is actually being changed.
Signed-off-by: Axel Lin <axel.lin@ingics.com >
Signed-off-by: Dirk Ziegelmeier <dirk@ziegelmeier.net >
2018-01-09 08:45:37 +01:00
goldsimon
0795e289eb
ip4_reass: fix double-free of pbuf and wrong ip_reass_pbufcount
...
This was broken by commit f1072fee8a on 07/28/17 when trying to fix bug #51595
2018-01-09 08:19:43 +01:00
Axel Lin
efa90d4294
netif: Add LWIP_ASSERT_CORE_LOCKED() to netif_set_remove_callback
...
Signed-off-by: Axel Lin <axel.lin@ingics.com >
Signed-off-by: Dirk Ziegelmeier <dirk@ziegelmeier.net >
2018-01-09 07:51:18 +01:00
Dirk Ziegelmeier
05ded5516d
Apply patch #9536 : netif: Prevent possible NULL pointer dereference in netif_set_addr in a modified version
...
Replace NULL pointers by IP4_ADDR_ANY4 - at sometime in the future, we make the NULL pointer handling obsolete and we can remove all the NULL pointer checks in the code
2018-01-09 07:51:09 +01:00
goldsimon
1affbb4bd5
unit tests: fixed testing itoa with too small buffer
2018-01-08 21:38:16 +01:00
David Girault
8801cbdb30
core: fix lwip_itoa()
...
See discussion in bug #51729
Signed-off-by: goldsimon <goldsimon@gmx.de >
2018-01-08 21:37:31 +01:00
Dirk Ziegelmeier
d7566216c9
Remove Simon's compile fix in test_timers.c, it is not needed any more. The function is now used.
2018-01-08 13:02:58 +01:00
Dirk Ziegelmeier
bb0ba64fb0
Work on bug #52748 : the bug in timeouts.c - apply Douglas' patch for absolute timeouts with modification to avoid cyclic timer overload situation
2018-01-08 12:48:48 +01:00
Dirk Ziegelmeier
5eced48869
Apply timeouts.c simplification from Douglas
...
Use TIME_LESS_THAN() macro instead of TIME_LESS_OR_EQUAL_THAN, it is more readable and results equivalent
2018-01-08 11:16:51 +01:00
Dirk Ziegelmeier
b6c0c52d66
Fix that one of Douglas' optimizations broke the timers
...
The unit tests failed and I didn't notice it :-(
2018-01-08 09:19:57 +01:00
Dirk Ziegelmeier
b4768f1711
Once again: Fix build warnings in test_timers.c
2018-01-08 08:34:17 +01:00
Dirk Ziegelmeier
bbb2e50327
Fix variable shadowing warning in my last commit
2018-01-08 08:12:33 +01:00
Dirk Ziegelmeier
3f30bfae28
lwipopts.h for unit tests: Increase number of timeouts
2018-01-08 07:34:38 +01:00
Dirk Ziegelmeier
a31f8837b5
Partly apply patch from "Douglas" provided in bug #52748 : the bug in timeouts.c
...
- Fix sys_untimeout implementation should not modify timer values since we are now using absolute timeouts.c
- Cleanup and simplify sys_check_timeouts() implementation
- Implement sys_restart_timeouts to rebase all timeouts based on next timer to expire
Changes by me:
- Rename TIME_LESS_THAN to TIME_LESS_OR_EQUAL_THAN
2018-01-08 07:33:40 +01:00
Dirk Ziegelmeier
eaca067c7d
Make _cyclic_ timers interval more deterministic - next timeout is calculated from last due time instead of relative to current time
...
This eliminates the cyclic timer jitter
2018-01-08 07:16:49 +01:00
Dirk Ziegelmeier
2b4dde84e3
Apply modified patch #9533 : sys_check_timeouts: recalculate the time diff after each handler call
...
Adapted to new timer implementation
2018-01-08 07:16:48 +01:00
Dirk Ziegelmeier
dd3861720f
Fix bug #52748 : the bug in timeouts.c by reimplementing timer logic to use absolute instead of relative timeout values
2018-01-08 07:16:47 +01:00
Axel Lin
da2478b761
netif: Enclosing macro argument in parentheses for NETIF_FOREACH
...
Signed-off-by: Axel Lin <axel.lin@ingics.com >
Signed-off-by: goldsimon <goldsimon@gmx.de >
2018-01-05 21:35:25 +01:00
goldsimon
e415151cf2
minor style change: fixed indentation
2018-01-05 21:30:32 +01:00
goldsimon
40c0f21b9e
Added dummy sys_mbox_trypost to unit test port
2018-01-05 21:30:07 +01:00
goldsimon
c4867b878c
Try to silence unused function warning in travis
2018-01-05 21:12:31 +01:00
goldsimon
8fc20142f7
Added sys_mbox_trypost_fromisr() and tcpip_callbackmsg_trycallback_fromisr()
...
This can be used to post preallocated messages from an ISR to the tcpip thread
when using FreeRTOS, where where calls differ between task level and ISR level.
Signed-off-by: goldsimon <goldsimon@gmx.de >
2018-01-05 21:08:27 +01:00
Dirk Ziegelmeier
1623c3e2cc
Add test for bug 52748
...
Disabled :-) -> travis doesn't complain
2018-01-05 08:20:36 +01:00
Dirk Ziegelmeier
8de4900641
Work on timer unit tests
2018-01-05 07:49:39 +01:00
Dirk Ziegelmeier
8542556a03
Fix build warning in test_def.c
2018-01-04 13:37:29 +01:00
Dirk Ziegelmeier
756b7431a7
Start implementing unit tests for timers
2018-01-04 13:37:05 +01:00
Dirk Ziegelmeier
40fecab313
Introduce LWIP_TESTMODE #define to be able to make functions/variables public etc. for implementing unit tests
2018-01-04 13:20:28 +01:00
Dirk Ziegelmeier
b16f5f0e19
Rename tcpip_trycallback() tcpip_callbackmsg_trycallback() to avoid confusion with tcpip_try_callback()
...
Add tcpip_callbackmsg_new(), tcpip_callbackmsg_delete(), tcpip_callbackmsg_trycallback() to documentation
2018-01-04 08:24:17 +01:00
goldsimon
6b2ef1a89b
httpd: fix typo "kepalive" -> "keepalive"
2018-01-04 06:35:00 +01:00
Axel Lin
2cb220d7fe
netif: Move LWIP_ASSERT_CORE_LOCKED out of static functions
...
The netif_do_set_{ipaddr|netmask|gw} are static functions what won't be called
directly, thus move LWIP_ASSERT_CORE_LOCKED to netif_set_{ipaddr|netmask|gw}.
This avoid duplicated LWIP_ASSERT_CORE_LOCKED checking by netif_set_addr().
Signed-off-by: Axel Lin <axel.lin@ingics.com >
2018-01-03 12:22:36 +01:00
Dirk Ziegelmeier
25f1c6ef2c
Revert "Apply patch #9523 : MDNS responder should reply after a random timeout"
...
This reverts commit fa345b0f22 .
2018-01-03 07:48:23 +01:00
Dirk Ziegelmeier
3b79c60e41
Revert "Fix build warnings in mdns.c introduced in my last commit"
...
This reverts commit 744e69334d .
2018-01-03 07:48:12 +01:00
Dirk Ziegelmeier
01e227d2c0
netif.c: Fix that when using LWIP_NETIF_EXT_STATUS_CALLBACK multiple callbacks instead of only one are fired when netif_set_addr() is used
2018-01-03 07:47:49 +01:00
Axel Lin
913a7e0638
sockets: Simplify #if !LWIP_TCPIP_CORE_LOCKING guard in select_check_waiters
...
Signed-off-by: Axel Lin <axel.lin@ingics.com >
2018-01-03 06:35:02 +01:00
Dirk Ziegelmeier
744e69334d
Fix build warnings in mdns.c introduced in my last commit
2018-01-03 06:31:59 +01:00
Dirk Ziegelmeier
fa345b0f22
Apply patch #9523 : MDNS responder should reply after a random timeout
...
with a few cleanups and coding style fixes
2018-01-02 22:20:25 +01:00
Dirk Ziegelmeier
004b13ca09
Work on task #14780 : Add debug helper asserts to ensure threading/locking requirements are met
...
Update documentation
2018-01-02 21:45:30 +01:00
Joel Cunningham
d569a22c73
tcpip: ensure core is locked for init done function
...
This ensures the core is locked when executing the init done function
passed to tcpip_init
The could manifest as a synchronization issue during early init if
another thread was in the LwIP context at the same time
2018-01-02 13:45:00 -06:00
Erik Ekman
d87740bb96
mdns: Fix multicast destination check for IPv6
...
This broke when IPv6 got scopes added. Scopes/zones are checked
even if none of the compared addresses are link local.
Result of the bug was that IPv6 replies were always sent unicast to
the source instead of to the multicast address.
Add ip-generic version that ignores IP zone info, since the v6 group
address is not tied to any netif.
2018-01-02 20:41:50 +01:00
Our Air Quality
1c7a024297
timers: add core locking assertion to tcp_timer_needed (task #14780 )
2018-01-02 12:13:35 -06:00
Our Air Quality
53499f5e9f
timers: rework the core locking around timers (bug #52719 )
...
Want the core lock held while working on the timer data structures.
2018-01-02 11:54:40 -06:00
Joel Cunningham
04b983b4f3
tcp: handle pcb->snd_queuelen and chained pbufs during segment split (bug #52692 )
...
This fixes a bug in tcp_split_unsent_seg() where a chained pbuf was
not correctly updating pcb->snd_queuelen during trimming and snd_queuelen
would desynchronize if pbuf_realloc() freed some of the chain
Also, use pbuf_clen() for adding the new remaining segment rather than ++.
The new remaining segment should always be one pbuf due to the semantics
of PBUF_RAM, but this follows the best practice of using pbuf_clen()
2018-01-02 09:16:10 -06:00
Dirk Ziegelmeier
f334ac68b6
Work on task #14780 : Add debug helper asserts to ensure threading/locking requirements are met
...
Add LWIP_ASSERT_CORE_LOCKED() in several places
2018-01-02 15:44:08 +01:00
Dirk Ziegelmeier
10c50dffce
tcpip.h: Make functions to lock TCPIP core overridable
2018-01-02 14:06:38 +01:00
Dirk Ziegelmeier
b33b3bb8bb
Start working on task #14780 : Add debug helper asserts to ensure threading/locking requirements are met
2018-01-02 13:44:38 +01:00
Dirk Ziegelmeier
36d160686a
Remove mdnsapi_mdns_resp_announce() again - it is not really needed and declaring it in mdns.h breaks layering between callback-style API and thread-safe API
2018-01-02 12:33:07 +01:00
Dirk Ziegelmeier
dfd6a31ecb
Fixup mdnsapi_mdns_resp_announce() macro - mdns_resp_announce() is a void function!
2018-01-02 11:03:45 +01:00
Dirk Ziegelmeier
a8755b8530
Work on bug #52770 : mdns: move the announcements to a timer callback
...
Don't automatically announce when adding netifs/services
2018-01-02 10:59:20 +01:00
Dirk Ziegelmeier
c20d50acec
Update cache handling in ZeroCopyRx.c - invalidate is faster than flushing
2018-01-02 08:40:23 +01:00
Dirk Ziegelmeier
6c7e7153bc
Fix bug #52704 : DHCP and bad OFFER
...
Stop timeout only if offer is accepted
2017-12-30 12:17:24 +01:00
Dirk Ziegelmeier
b536fd9767
Apply modified version of bug #52747 : mdns resp: separate the announce function and add netifapi support for it
...
Changes made by me:
- Move all error handling code into mdns_resp_announce() so it can be safely used by external code
- Remove mdns_resp_netif_settings_changed() because it is the same as mdns_resp_announce() after my changes
- Declare #define for a "thread-safe" version of mdns_resp_announce in mdns.h instead of netifapi.h - I don't want to intermix netif API with APPs
2017-12-30 12:08:01 +01:00
Our Air Quality
1b57284bb4
mdns: guard against there being no ip4 address.
...
* Avoid announcing to an interface with no ip4addr.
* Avoid emitting A answers if there is no ip4 address.
2017-12-30 11:42:46 +01:00
Joel Cunningham
a98d3a4efb
Add test_def.c to Filelists.mk
2017-12-27 09:13:31 -06:00
Dirk Ziegelmeier
e77099673c
Add flushing CPU cache to zero-copy RX code example
2017-12-24 13:12:32 +01:00
Dirk Ziegelmeier
27ca731242
Improve cache handling notes from my last commit some more
2017-12-24 13:07:35 +01:00
Dirk Ziegelmeier
8f6b876ef9
Common pitfalls document: Add note that lwip writes to ethernet RX buffers (caching issue!)
2017-12-24 13:02:30 +01:00
Axel Lin
61e90d9fc0
Use pbuf_clone to replace pbuf_alloc+pbuf_copy
...
Use pbuf_clone() to simplify the code a bit.
Signed-off-by: Axel Lin <axel.lin@ingics.com >
2017-12-24 12:50:30 +01:00
Dirk Ziegelmeier
4cfef8acab
Apply part from patch 9525: fix lwip_strnicmp in a modified way:
...
Move side effect out of boolean expression
2017-12-24 12:49:28 +01:00
Axel Lin
5b9f79680c
lowpan6: Fix build warning when LWIP_6LOWPAN_IPHC=0
...
Fix below build warning if LWIP_6LOWPAN_IPHC=0.
../../../../lwip/src/netif/lowpan6.c:186:1: error: ‘lowpan6_get_address_mode_mc’ defined but not used [-Werror=unused-function]
lowpan6_get_address_mode_mc(const ip6_addr_t *ip6addr)
^~~~~~~~~~~~~~~~~~~~~~~~~~~
../../../../lwip/src/netif/lowpan6.c:160:1: error: ‘lowpan6_get_address_mode’ defined but not used [-Werror=unused-function]
lowpan6_get_address_mode(const ip6_addr_t *ip6addr, const struct ieee_802154_addr *mac_addr)
^~~~~~~~~~~~~~~~~~~~~~~~
Also correct comment typo: s/LWIP_6LOWPAN_HC/LWIP_6LOWPAN_IPHC/g
Signed-off-by: Axel Lin <axel.lin@ingics.com >
2017-12-24 12:46:11 +01:00
goldsimon
c6887522fe
Fixed lwip_itoa (bug #51729 ) and added unit tests for it
2017-12-23 20:35:18 +01:00
goldsimon
b07a481f66
Fix bug #52686 (pointer 'to' checked for NULL in lwip_sendto() may be dereferenced)
...
Signed-off-by: goldsimon <goldsimon@gmx.de >
2017-12-18 20:09:44 +01:00
goldsimon
7c1f844782
Fix compiling mdns.c after last change (mixed code and declarations)
2017-12-18 20:06:45 +01:00
goldsimon
2505c6019e
httpd: fix the names of some global variables
2017-12-18 20:01:24 +01:00
Mike Kleshov
db68c6df6a
httpd: make global variables static
...
Signed-off-by: goldsimon <goldsimon@gmx.de >
2017-12-18 19:57:07 +01:00
Joel Cunningham
50a5d85f45
tcp: handle segmentation oversize during segment split (bug #52676 )
...
This fixes a bug in tcp_split_unsent_seg where oversized segments were not
handled during the split, leading to pcb->unsent_oversized and
useg->oversize_left getting out of sync with the split segment
This would result in over-writing the pbuf if another call to tcp_write()
happened after the split, but before the remainder of the split was sent in
tcp_output
Now pcb->unsent_oversized is explicitly cleared (because the remainder at
the tail is never oversized) and useg->oversized_left is cleared after it is
trimmed
This also updates the test_tcp_persist_split unit test to explicitly check for
this case
2017-12-18 11:42:13 -06:00
Our Air Quality
31c60775b6
mdns: silence some unused variable warnings.
2017-12-17 22:24:49 +01:00
Axel Lin
0527c1bdf5
apps/smtp: Avoid NULL pointer dereference in smtp_send_body_data_handler
...
Move the code to have NULL test before dereference.
Signed-off-by: Axel Lin <axel.lin@ingics.com >
Signed-off-by: goldsimon <goldsimon@gmx.de >
2017-12-17 22:16:29 +01:00
Axel Lin
df563e74f9
ip4: Fix IPH_OFFSET_BYTES macro
...
Current code only works if the argument happen to be named as fraghdr,
fix it.
Signed-off-by: Axel Lin <axel.lin@ingics.com >
Signed-off-by: goldsimon <goldsimon@gmx.de >
2017-12-17 22:15:10 +01:00
Axel Lin
892e30d8c1
ip4_reass: Use IPH_HL_BYTES instead of open coded
...
Signed-off-by: Axel Lin <axel.lin@ingics.com >
Signed-off-by: goldsimon <goldsimon@gmx.de >
2017-12-17 22:14:27 +01:00
Axel Lin
4c90858482
ip4_reass: Fix build error when IP_REASS_CHECK_OVERLAP=0
...
The goto freepbuf code path is also used when IP_REASS_CHECK_OVERLAP=0.
Thus remove #if IP_REASS_CHECK_OVERLAP around the freepbuf label to fix
below build error:
cc -g -Wall -DLWIP_DEBUG -pedantic -Werror -Wparentheses -Wsequence-point -Wswitch-default -Wextra -Wundef -Wshadow -Wpointer-arith -Wcast-qual -Wc++-compat -Wwrite-strings -Wold-style-definition -Wcast-align -Wmissing-prototypes -Wredundant-decls -Wnested-externs -Wunreachable-code -Wuninitialized -Wlogical-op -I. -I../../.. -I../../../../lwip/src/include -I../../../ports/unix/port/include -I../../../../mbedtls/include -Wno-redundant-decls -DLWIP_HAVE_MBEDTLS=1 -c ../../../../lwip/src/core/ipv4/ip4_frag.c
../../../../lwip/src/core/ipv4/ip4_frag.c: In function
‘ip_reass_chain_frag_into_datagram_and_validate’: ../../../../lwip/src/core/ipv4/ip4_frag.c:412:7: error: label ‘freepbuf’ used but not defined
goto freepbuf;
^~~~
Signed-off-by: Axel Lin <axel.lin@ingics.com >
Signed-off-by: goldsimon <goldsimon@gmx.de >
2017-12-17 22:13:59 +01:00
goldsimon
82483073f0
sntp_send_request: assert that argument 'server_addr' != NULL
2017-12-17 22:13:09 +01:00
Axel Lin
ba270c2414
apps/sntp: Use ip_addr_copy to save server address
...
Use ip_addr_copy instead of ip_addr_set to avoid NULL test for
&sntp_last_server_address. This fixes build warning when
SNTP_CHECK_RESPONSE>=1 && LWIP_IPV4=1 && LWIP_IPV6=1.
In file included from ../../../../lwip/src/include/lwip/apps/sntp.h:41:0,
from ../../../../lwip/src/apps/sntp/sntp.c:52:
../../../../lwip/src/apps/sntp/sntp.c: In function ‘sntp_send_request’:
../../../../lwip/src/include/lwip/ip_addr.h:105:58: error: the comparison will always evaluate as ‘true’ for the address of ‘sntp_last_server_address’ will never be NULL [-Werror=address]
#define IP_SET_TYPE(ipaddr, iptype) do { if((ipaddr) != NULL) { IP_SET_TYPE_VAL(*(ipaddr), iptype); }}while(0)
^
../../../../lwip/src/include/lwip/ip_addr.h:157:36: note: in expansion of macro ‘IP_SET_TYPE’
#define ip_addr_set(dest, src) do{ IP_SET_TYPE(dest, IP_GET_TYPE(src)); if(IP_IS_V6(src)){ \
^~~~~~~~~~~
../../../../lwip/src/apps/sntp/sntp.c:549:5: note: in expansion of macro ‘ip_addr_set’
ip_addr_set(&sntp_last_server_address, server_addr);
^~~~~~~~~~~
Signed-off-by: Axel Lin <axel.lin@ingics.com >
Signed-off-by: goldsimon <goldsimon@gmx.de >
2017-12-17 22:12:32 +01:00
Joel Cunningham
920ee2d07e
sntp: use const for servername
...
This adds const to the sntp servername get/set API and internal storage
SNTP's usage of this name is read only and SNTP only passes it to dns_gethostbyname()
This was found by compiling with GCC -Wwrite-strings which makes the literal
SNTP_SERVER_ADDRESS a const string. This then produced warnings with sntp_init()'s
call to sntp_setservername()
2017-12-13 11:34:48 -06:00
Dirk Ziegelmeier
60063b98e1
Fix bug #52611 : Incorrect use of ctype macros?
...
by applying a modified version of Axel Lin's patch including Mike Kleshov's comments.
2017-12-07 12:01:09 +01:00
Axel Lin
ec9f227eae
apps/altcp_tls: Remove redundant check for altcp_mbedtls_malloc_clear_stats
...
No need to check altcp_mbedtls_malloc_clear_stats twice.
Signed-off-by: Axel Lin <axel.lin@ingics.com >
Signed-off-by: goldsimon <goldsimon@gmx.de >
2017-12-05 06:35:44 +01:00
Axel Lin
eb30dbfdc5
Fix build warning for lwip_isdigit/isxdigit/islower/isspace
...
lwip_isdigit/isxdigit/islower/isspace takes int as argument, so
explicitly cast to int to silence below build warnings.
src/core/ipv4/ip4_addr.c: In function 'ip4addr_aton':
src/core/ipv4/ip4_addr.c:160:5: warning: array subscript has type 'char' [-Wchar-subscripts]
if (!lwip_isdigit(c)) {
^
src/core/ipv4/ip4_addr.c:175:7: warning: array subscript has type 'char' [-Wchar-subscripts]
if (lwip_isdigit(c)) {
^
src/core/ipv4/ip4_addr.c:178:7: warning: array subscript has type 'char' [-Wchar-subscripts]
} else if (base == 16 && lwip_isxdigit(c)) {
^
src/core/ipv4/ip4_addr.c:179:9: warning: array subscript has type 'char' [-Wchar-subscripts]
val = (val << 4) | (u32_t)(c + 10 - (lwip_islower(c) ? 'a' : 'A'));
^
src/core/ipv4/ip4_addr.c:204:3: warning: array subscript has type 'char' [-Wchar-subscripts]
if (c != '\0' && !lwip_isspace(c)) {
^
Signed-off-by: Axel Lin <axel.lin@ingics.com >
2017-12-03 19:34:24 +01:00
Axel Lin
975e23bf5e
bridgeif: Remove redundant port_netif NULL test in bridgeif_send_to_port
...
portif = br->ports[dstport_idx].port_netif;
So no need to have NULL test for both br->ports[dstport_idx].port_netif
and portif.
Signed-off-by: Axel Lin <axel.lin@ingics.com >
Signed-off-by: Dirk Ziegelmeier <dirk@ziegelmeier.net >
2017-11-26 21:13:08 +01:00
Dirk Ziegelmeier
2ceedfe097
Fix bug #52345 : MQTT buffer length check seems wrong
...
Don't try to parse variable length part if it is not contained in message
2017-11-26 21:05:07 +01:00
Dirk Ziegelmeier
ad47a46815
Revert fix for bug #52345 , that was not correct
2017-11-26 20:59:39 +01:00
Axel Lin
32788f2c74
sockets.c: use udp_is_flag_set() instead of udp_flags()
...
Signed-off-by: goldsimon <goldsimon@gmx.de >
2017-11-23 22:12:41 +01:00
goldsimon
f8f31218d1
sockets_stresstest.c: some compile and runtime fixes
2017-11-23 09:19:01 +01:00
goldsimon
6e624f8035
multithreading socket test: implement more code paths
2017-11-22 23:08:57 +01:00
goldsimon
0397ff9ba4
Added initial version of multithreading socket test
2017-11-22 22:03:33 +01:00
Axel Lin
6cbee37a58
apps/httpd: Use LWIP_ARRAYSIZE at appropriate places
...
Signed-off-by: Axel Lin <axel.lin@ingics.com >
Signed-off-by: goldsimon <goldsimon@gmx.de >
2017-11-22 16:54:03 +01:00
Axel Lin
5cd6c38893
apps/snmp: Fix buld error when LWIP_SNMP_CONFIGURE_VERSIONS=1
...
The version check is done in these functions, it should be ok to put
assert in the else clause.
Fix below build errors:
../../../../lwip/src/apps/snmp/snmp_msg.c: In function ‘snmp_version_enabled’:
../../../../lwip/src/apps/snmp/snmp_msg.c:87:1: error: embedding a directive within macro arguments is not portable [-Werror]
#if LWIP_SNMP_V3
^
../../../../lwip/src/apps/snmp/snmp_msg.c:89:1: error: embedding a directive within macro arguments is not portable [-Werror]
#endif
^
../../../../lwip/src/apps/snmp/snmp_msg.c: In function ‘snmp_version_enable’:
../../../../lwip/src/apps/snmp/snmp_msg.c:126:1: error: embedding a directive within macro arguments is not portable [-Werror]
#if LWIP_SNMP_V3
^
../../../../lwip/src/apps/snmp/snmp_msg.c:128:1: error: embedding a directive within macro arguments is not portable [-Werror]
#endif
^
cc1: all warnings being treated as errors
/home/axel/git/lwip/lwip-contrib/ports/unix/../Common.allports.mk:94:
recipe for target 'snmp_msg.o' failed
make: *** [snmp_msg.o] Error 1
Signed-off-by: Axel Lin <axel.lin@ingics.com >
Signed-off-by: goldsimon <goldsimon@gmx.de >
2017-11-22 16:53:00 +01:00
goldsimon
b48106c662
Fixed build errors in makefsdata introduced with the last commit
2017-11-21 20:08:40 +01:00
goldsimon
5500a36b29
... and fix DEBUG string
2017-11-21 12:55:07 +01:00
goldsimon
444dfeada8
task #14600 : tcp_alloc(): kill TF_CLOSEPEND connections before other ESTABLISHED
2017-11-21 12:53:33 +01:00
goldsimon
5dc3072af8
makefsdata: added option "-ssi:<filename>" to control SSI tag checking/insertion through a list of filenames, not by checking the file extension at runtime
...
Signed-off-by: goldsimon <goldsimon@gmx.de >
2017-11-21 12:23:08 +01:00
goldsimon
26f55f1eb3
makefsdata: add information about SSI and about the version of the included header to files
...
Signed-off-by: goldsimon <goldsimon@gmx.de >
2017-11-21 12:23:08 +01:00
goldsimon
839e5ecec6
makefsdata: rework finding arguments, rework printing flags to file
...
Signed-off-by: goldsimon <goldsimon@gmx.de >
2017-11-21 12:23:07 +01:00
Joel Cunningham
cdabdcb00d
test_sockets: disable test for calling recv() after remote closure
...
Re-enable these when calling recv() multiple times after remote closure
returns an error
2017-11-20 14:17:59 -06:00
Joel Cunningham
ebcae98ae6
Revert "socket/netconn recv: FIN should only be reported once (as '0' for sockets, as 'ERR_CLSD' for netconns)"
...
This reverts commit db3a4e3158 .
See description of regression in bug #52417
2017-11-20 13:54:11 -06:00
Joel Cunningham
6af3b4accc
netconn: Add LWIP_HOOK_NETCONN_EXTERNAL_RESOLVE (patch #9427 )
...
This adds a new hook allowing an external DNS resolver to be hooked into
netconn_gethostbyname(). The hook can handle some or all of the queries
One use case for this hook is to run mDNSResponder in the same system as LwIP
(mDNSResponder also uses LwIP's socekt APIs) and have it handle .local queries
while LwIP stack handles unicast DNS queries
2017-11-20 09:59:35 -06:00
goldsimon
2aed2fc215
sockets: prevent nested SYS_ARCH_PROTECT() for LWIP_NETCONN_FULLDUPLEX==1
2017-11-19 14:37:29 +01:00
Axel Lin
8b6bb1a503
apps/httpd: Fix build error when LWIP_HTTPD_TIMING=1
...
Include lwip/sys.h to fix below build error:
../../../../lwip/src/apps/httpd/httpd.c:470:23: error: implicit declaration of function ‘sys_now’ [-Werror=implicit-function-declaration]
u32_t ms_needed = sys_now() - hs->time_started;
^~~~~~~
Signed-off-by: Axel Lin <axel.lin@ingics.com >
2017-11-19 14:17:52 +01:00
goldsimon
f5c37c8cbb
Fix broken MSG_PEEK on TCP sockets (post-2.0.3 bug)
...
MSG_PEEK on TCP sockets was broken since commit b71d4477ea
from 06.03.2017: recv hung in an endless loop and tcp_recved() was called for peeked data
(which would result in a too large window advertised).
Aded TCP MSG_PEEK to socket unit tests
2017-11-18 13:34:20 +01:00
Axel Lin
d99144eef1
tcp: Remove superfluous variable in tcp_netif_ip_addr_changed()
...
Signed-off-by: Axel Lin <axel.lin@ingics.com >
Signed-off-by: goldsimon <goldsimon@gmx.de >
2017-11-17 22:12:09 +01:00
Axel Lin
2ff0ef027e
Use NETIF_FOREACH macro at appropriate places
...
Use NETIF_FOREACH macro to get some optimizations for LWIP_SINGLE_NETIF case.
Signed-off-by: Axel Lin <axel.lin@ingics.com >
Signed-off-by: goldsimon <goldsimon@gmx.de >
2017-11-17 22:09:40 +01:00
goldsimon
8c6884b2db
tcp_close_shutdown: always deallocate the pcb if there is unread data on close (see bug #52403 )
...
We preserved the TIME_WAIT handling before, but it seems this is not correct: we want to issue
a RST later again if someone wants to talk to this port. With TIME_WAIT, this might not always
the case.
2017-11-17 22:04:52 +01:00
goldsimon
0853d1e7d1
sntp: revert 2 -Wconversion changes (see bug #51538 )
2017-11-17 21:39:23 +01:00
goldsimon
db3a4e3158
socket/netconn recv: FIN should only be reported once (as '0' for sockets, as 'ERR_CLSD' for netconns)
2017-11-17 21:22:53 +01:00
goldsimon
2b309bd1ae
socket unit tests: improve basic tests a bit
2017-11-17 21:22:00 +01:00
goldsimon
fa73f130f1
tcp: fix bug #36167 again (fixed in 2014, but when calling shutdown(WR) followed by recv(), this still happened)
2017-11-17 21:06:49 +01:00
goldsimon
926805bcf1
tcp unit test: fix some endless loops for TCP_WND == 0xFFFF
2017-11-17 21:04:33 +01:00
Dirk Ziegelmeier
1e0501c31a
Improve HTTPD documentation
2017-11-17 10:08:35 +01:00
Dirk Ziegelmeier
b0344518e8
sockets.c: Don't rely on #defines in socket.h to be in sync with ip.h
...
Map SO_* to SOF_* #defines
2017-11-17 09:41:26 +01:00
goldsimon
da01bc4d15
httpd: ssi: support selecting ssi files by file flags, not by extension (at runtime) only
2017-11-16 22:29:44 +01:00
goldsimon
8bd670430a
httpd: ssi: move checking file extensions against g_pcSSIExtensions array into its own function guarded by LWIP_HTTPD_SSI_BY_FILE_EXTENSION
2017-11-16 22:24:17 +01:00
goldsimon
5d6b39f1ce
httpd: work on option documentation
2017-11-16 22:17:32 +01:00
Joel Cunningham
c47d161d4a
netifapi: add thread safe ARP APIs (task #14724 )
...
This adds thread safe netifapi ARP cache APIs for add/remove
2017-11-16 13:59:33 -06:00
Axel Lin
40a563cdd3
dns: Use dns_backupserver_available() instead of open-coded
...
Slightly better readability by calling dns_backupserver_available()
instead of open-coded. Also move dns_backupserver_available() function
up to avoid forward declaration.
Signed-off-by: Axel Lin <axel.lin@ingics.com >
Signed-off-by: goldsimon <goldsimon@gmx.de >
2017-11-16 19:48:35 +01:00
Axel Lin
d20a7aba0c
netif: Use ip6_addr_isvalid() at appropriate places
...
Signed-off-by: Axel Lin <axel.lin@ingics.com >
Signed-off-by: goldsimon <goldsimon@gmx.de >
2017-11-16 19:48:24 +01:00
goldsimon
a73eb7ae72
pbuf.c: fix that pbuf_skip_const() was not prototyped for some configurations
2017-11-16 11:37:34 +01:00
David Girault
5290eacf08
altcp_mbedtls: close and error related fixes
...
- call conn->err() instead of conn->recv() if handshake fail and free conn
- close inner_conn and free current conn in altcp_mbedtls_close()
Signed-off-by: goldsimon <goldsimon@gmx.de >
2017-11-15 21:58:12 +01:00
goldsimon
245a6835f3
fixed bug #52403 : netconn: FIN may be sent instead of RST when TCP netconn is closed with pending data in recv_mbox
2017-11-15 21:12:15 +01:00
goldsimon
bd2e820829
Fix double-free when closing mbedTLS connections
...
Partly revert commit 0486100a2b from 07.08.2017 as it breaks layering: every layer must free its own altcp_pcb. Freeing the inner_conn is not the right way.
2017-11-14 22:21:08 +01:00
Dirk Ziegelmeier
6ef5f68c72
Don't forget to save before committing! (compile fix for my previous commit)
2017-11-13 22:53:41 +01:00
Dirk Ziegelmeier
1fdc7571e0
Move DNS_MAX_RETRIES option from dns.c to opt.h
2017-11-13 22:52:39 +01:00
Dirk Ziegelmeier
2c1a152880
Fix bug #52239 : if a DNS request is denied by a DNS server, this DNS request shouldn't be stopped if there is another DNS server to try
...
Apply improved version of Xiaodong Sun's patch
2017-11-13 22:51:08 +01:00
Dirk Ziegelmeier
a56ea1b19f
dns.c: Rename goto label memerr to ignore_packet
...
Label is more descriptive this way
2017-11-13 22:37:38 +01:00
Dirk Ziegelmeier
1a1478551e
Fix bug #52345 : MQTT buffer length check seems wrong
...
(for empty payload in publish message)
2017-11-13 22:29:25 +01:00
Dirk Ziegelmeier
a82054d24f
Follow-up to patch #9472 : tcp_kill_prio: Don't kill active connection that has the same priority
...
Correctly search for connection with lowest prio AND longest inactivity time
2017-11-13 22:13:11 +01:00
goldsimon
1665fcba83
httpd: LWIP_HTTPD_CGI_SSI: complete unfinished documentation for httpd_cgi_handler()
2017-11-13 21:18:15 +01:00
goldsimon
365e031340
httpd: fixed double-free for default 404 file () for LWIP_HTTPD_DYNAMIC_HEADERS==1
2017-11-13 21:04:24 +01:00
Joel Cunningham
1147b9ce38
test_dhcp: set link up on net_test netif
...
DHCP test code didn't set link up on net_test netif (exposed by changes
in 637bce91b4 )
Then during the test_dhcp function, a Gratuitous ARP was not sent during
the call to dhcp_bind() because the link was still down
The sets the link state for all DHCP test functions
2017-11-08 14:42:28 -06:00
Joel Cunningham
637bce91b4
netif: ensure link and admin states are up in issue reports (bug #52353 )
...
This fixes a bug where some callers of netif_issue_reports were not
checking that both link and admin states were up, leading to extraneous
reports when calling one of the following
1) netif_set_ipaddr
2) netif_ip6_addr_set_parts
3) netif_ip6_addr_set_state
The bug has been fixed by placing link and admin state checks in
netif_issue_reports and not requiring the callers to perform this
checking
2017-11-08 13:38:48 -06:00
Dirk Ziegelmeier
d864f8c3a3
Fix bug #52368 : Minor typo in comment
...
I think "Internet checksum functions" is OK
2017-11-08 19:52:40 +01:00
Axel Lin
7a241b6b52
slipif: Fix unbalance SYS_ARCH_PROTECT in slipif_process_rxqueue()
...
Fixes: 3d1a306518 ("SLIP netif: add support for multiple input strategies (threaded, polling, RX from ISR)")
Signed-off-by: Axel Lin <axel.lin@ingics.com >
2017-11-08 19:48:00 +01:00
Axel Lin
a8acca5902
Trivial typo fix
...
s/chekc/check/g
Signed-off-by: Axel Lin <axel.lin@ingics.com >
2017-11-07 13:44:43 +01:00
Joel Cunningham
a78dbb25c5
docs: small clean ups for last couple of commits:
...
* Fix typos in LWIP_NO_CTYPE_H comment block
* Update comment around caller of tcp_kill_prio()
2017-11-06 09:37:10 -06:00
Dirk Ziegelmeier
d8b6cdffcb
Apply patch #9472 : tcp_kill_prio: Don't kill active connection that has the same priority
...
in a modified, IMHO more readable way.
2017-11-06 12:53:08 +01:00
Axel Lin
41cf4012af
pbuf: Simplify pbuf_get_contiguous implementation
...
Use pbuf_skip_const() to simplify the implementation.
Signed-off-by: Axel Lin <axel.lin@ingics.com >
2017-11-06 12:22:32 +01:00
Axel Lin
c1efb9e296
pbuf: Make pbuf_add_header/pbuf_remove_header return error if invalid parameters
...
It does not make sense to return success in p == NULL or
invalid header_size_increment/header_size_decrement cases. Fix it.
Signed-off-by: Axel Lin <axel.lin@ingics.com >
2017-11-06 12:22:30 +01:00
Dirk Ziegelmeier
7eb462867b
Fix follow-up to [bug #52315 ] Minor typo in output of MIB compiler
...
LWIP_SNMP_OBJ_ID_LEN -> SNMP_MAX_OBJ_ID_LEN
2017-11-05 11:51:23 +01:00
Dirk Ziegelmeier
849dfb17c7
The macros in ip6_addr.c are duplicated from ip4_addr.c, so move them to lwIPs portability layer
...
...didn't see that in the first place...
2017-11-05 10:27:46 +01:00
Dirk Ziegelmeier
93f4245e89
ip6_addr.c: Convert several macros to private #defines
...
The macros are functions from ctype.h, but ctype.h declares them as functions, not as #defines
It makes no sense to abstract them in lwIPs portability layer, the functions are of low complexity and they are only used in this file.
2017-11-05 10:13:24 +01:00
Dirk Ziegelmeier
a9a3d473ac
Make xchar() a private #define of ip6_addr.c, it is not standardized in any C header
2017-11-05 10:06:25 +01:00
Dirk Ziegelmeier
de991b1158
Apply patch #9478 : MQTT.c printf warning in debug messages
...
in a modified version that uses lwIP's format string #defines
2017-11-05 09:51:26 +01:00
Joel Cunningham
472f7985b5
Introduce LWIP_PACKED_CAST to fix error issue with ARMCC
...
ARMCC when using __packed structures will not implicitly convert a
pointer to a member of a packed structure to something which does not
have __packed. This results in a compiler error and was found with calls
to icmp6_param_problem
While there is a #pragma pack mode in ARMCC that disables this error, it
does require existing ports to switch over their packing mode and
perform integration
2017-11-01 09:05:06 -05:00
Joel Cunningham
d39e8cd827
docs: replace old reference to TCPIP_APIMSG with netconn_apimsg
2017-10-29 16:52:03 -05:00
Dirk Ziegelmeier
08ec234127
Related to patch #9471 : pbuf: Drop casting to u8_t for increment the reference count
...
Cast to correct type: Needed to avoid warnings about integer cast (-Wconversion)
SYS_ARCH_SET cannot be used here
2017-10-28 15:41:15 +02:00
Dirk Ziegelmeier
4a9e845a53
Fix bug #52300 : Minor type in snmp_opts.h
...
The comments for MIN and MAX need to be swapped
2017-10-28 15:37:22 +02:00
Joel Cunningham
b953bd0393
docs: fix minor mis-spelling in sys.c
2017-10-27 15:33:18 -05:00
goldsimon
283fec0a36
fixed copy&paste bug introduced in last commit
2017-10-26 11:30:26 +02:00
goldsimon
0f685e4fb5
Fixed bug #52279 : httpd.c http_init_file() miss uri
2017-10-25 21:58:53 +02:00
Joel Cunningham
b296d2c7bb
docs: update tcp_kill_prio same priority comments
...
tcp_kill_prio will kill the oldest active connection of same/lower
priority. Update all comments so that it's clear the same priority
can be killed
2017-10-25 09:08:23 -05:00
Joel Cunningham
b18e6a8734
sockets: fix missing break regression in event_callback
...
During the refactoring in c5db278746 , the
previous gotos were removed, but the lack of break statements in
NETCONN_EVNT_RCVMINUS and NETCONN_EVT_SENDMINUS was overlooked, leading
to incorrect fall through behavior
2017-10-23 09:05:57 -05:00
Joel Cunningham
22dacc38c0
Revert "Fix two bad "fall-through" code"
...
This reverts commit a7f2ef4aec .
The fall through is actually a regression
2017-10-23 08:59:43 -05:00
Dirk Ziegelmeier
98d5e06dba
Silence gcc 7 warning about fall-through in case statement by adding a comment
2017-10-22 21:27:32 +02:00
Dirk Ziegelmeier
a7f2ef4aec
Fix two bad "fall-through" code
2017-10-22 21:26:57 +02:00
Dirk Ziegelmeier
ddcf9cc764
Move all rawapi.txt to appropriate doxygen docs
2017-10-20 21:40:23 +02:00
Dirk Ziegelmeier
33ce04019d
Move API description text from rawapi.txt to doxygen docs
2017-10-20 18:44:58 +02:00
Dirk Ziegelmeier
a8edee8268
Move all text from sys_arch.txt to appropriate doxygen places
2017-10-20 18:23:06 +02:00
Joel Cunningham
9c175835d5
sockets: poll Open Group clean ups
...
1) Define remaining Open Group poll constants (values in hex)
2) Switch nfds_t to unsigned int
http://pubs.opengroup.org/onlinepubs/007908799/xsh/poll.h.html
2017-10-19 14:03:56 -05:00
Nate Karstens
1960937df3
Enable support for MSG_DONTWAIT in lwip_recvmsg()
...
Enables support for MSG_DONTWAIT in lwip_recvmsg(). Support already
exists in lwip_recv_tcp() and lwip_recvfrom_udp_raw(); these are both
accessible from lwip_recvfrom(), which already supports MSG_DONTWAIT.
Signed-off-by: Nate Karstens <nate.karstens@garmin.com >
Signed-off-by: Joel Cunningham <joel.cunningham@me.com >
2017-10-19 13:55:25 -05:00
Dirk Ziegelmeier
f41b5b84b1
Try to fix build of bridgeif_fdb.c
2017-10-19 12:16:11 +02:00
goldsimon
cf07fddf96
lwip_poll_dec_sockets_used: remove unused SYS_ARCH_DECL_PROTECT(lev);
2017-10-19 06:52:33 +02:00
Joel Cunningham
8d04f3d622
docs: correct LWIP_IPV6_MLD reference on #endif comment
2017-10-18 11:48:00 -05:00
Dirk Ziegelmeier
4f2dc05c7c
Improve documentation on bridgeif_fdb
2017-10-18 18:31:38 +02:00
Dirk Ziegelmeier
b3a379c239
BridgeIF: Move FDB implementation into a separate file, implementation is easier to understand like this.
2017-10-18 18:27:35 +02:00
Dirk Ziegelmeier
8a46a853d2
Improve system abstraction layer doxygen docs by moving documentation from sys_arch.txt to sys.c
2017-10-17 22:38:18 +02:00
Dirk Ziegelmeier
26b2628f01
Improve system abstraction layer doxygen docs by moving documentation from sys_arch.txt to the corresponding functions
2017-10-17 22:30:51 +02:00
Dirk Ziegelmeier
33f29af0b6
Improve ZeroCopyRx.c code
2017-10-17 22:05:15 +02:00
Dirk Ziegelmeier
84b2a0f55b
Remove raw API TCP/UDP function documentation from rawapi.txt - it is now integrated in doxygen docs.
...
This avoid having a second description for the same stuff that is "bit-rotting" because noone remembers to update this file.
Also remove outdated and misleading zero-copy TX information.
2017-10-17 21:59:34 +02:00
Dirk Ziegelmeier
d020bfc0df
Improve UDP documentation using rawapi.txt texts
2017-10-17 21:50:18 +02:00
Dirk Ziegelmeier
558bd73a6d
Fix comment indent in main_page.h
2017-10-16 23:27:00 +02:00
Dirk Ziegelmeier
001e1f1127
Improve lwIP doxygen documentation by copying several passages from rawapi.txt to the corresponding doxygen places
2017-10-16 23:24:52 +02:00
Dirk Ziegelmeier
921f601b5d
Improve lwIP doxygen documentation by copying several passages from rawapi.txt to the corresponding function documentation
2017-10-16 23:14:28 +02:00
Our Air Quality
4d21d8da23
Allow LWIP_SOCKET_OFFSET with an external FD_SET
...
Signed-off-by: goldsimon <goldsimon@gmx.de >
2017-10-16 17:07:17 +02:00
Joel Cunningham
0882e0ba89
sockets: poll clean ups
...
This makes the following poll cleanups:
1) Add LWIP_ERROR in lwip_poll to check for invalid fds/nfds combinations.
This fixes a possible a NULL fds dereference in lwip_poll_scan()
2) Use has_ copies of the socket events in lwip_poll_should_wake() rather
passing the sock pointer and accessing socket after leaving the critical
section
2017-10-16 08:06:31 -05:00
Dirk Ziegelmeier
653a1e7778
Fix bug #52113 : recv callback: To free or not to free pbuf when returning ERR_ABRT?
...
Change the text according to Ambroz' suggestion
2017-10-16 10:01:45 +02:00
Dirk Ziegelmeier
ada6a84785
Fix documentation on relocating memory pools
2017-10-15 22:37:41 +02:00
Joel Cunningham
5d8d21fcae
Add poll to CHANGELOG
2017-10-13 12:13:55 -05:00
Joel Cunningham
de531131c5
Fix compiler warnings seen with clang 8.1.0 on MacOS
...
This fixes the following warnings:
test_tcp.c:266:5: error: code will never be executed [-Werror,-Wunreachable-code]
pbuf_free(p);
^~~~~~~~~
- The check API 'fail' aborts the test, thus pbuf_free(p) will never be executed
pbuf.c:783:111: error: format specifies type 'unsigned short' but the argument has type 'u8_t' (aka 'unsigned char') [-Werror,-Wformat]
LWIP_DEBUGF( PBUF_DEBUG | LWIP_DBG_TRACE, ("pbuf_free: %p has ref %"U16_F", ending here.\n", (void *)p, ref));
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~
- LWIP_PBUF_REF_T is u8_t by default and doesn't match U16_F, so cast to u16_t. The cast and formatter will need to be changed
if ref is larger than 16 bits
ethernet.c:105:16: error: format specifies type 'unsigned char' but the argument has type 'unsigned int' [-Werror,-Wformat]
(unsigned)ethhdr->dest.addr[0], (unsigned)ethhdr->dest.addr[1], (unsigned)ethhdr->dest.addr[2],
~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- addr[] is type u8_t, formatter is X8_F which should be 8 bits. 'unsigned' is an int, so cast to unsighed char instead
2017-10-13 07:52:34 -05:00
Our Air Quality
0794d88f09
If undefined then define O_NDELAY in terms of O_NONBLOCK.
...
Current newlib does not define O_NDELAY, but it needs to be the same
as O_NONBLOCK rather than using the lwip value of 1.
Signed-off-by: Dirk Ziegelmeier <dirk@ziegelmeier.net >
2017-10-09 12:31:23 +02:00
Dirk Ziegelmeier
856b0c3260
Fix bug #52189 : list add and remove bug in <lwiperf.c>
...
Apply patch from xuyao hong
2017-10-09 12:30:12 +02:00
goldsimon
8fc69c9858
Revert changes of 07434aa73a (accidentally committed local changes)
2017-10-06 11:45:10 +02:00
Dirk Ziegelmeier
de5b693e7d
Reformat netif subdir using astylerc
2017-10-03 21:22:04 +02:00
Dirk Ziegelmeier
47138f92d0
Fix a few doxygen comment issues
2017-10-02 10:08:48 +02:00
goldsimon
ad4358592a
add MEM_SANITY_CHECK (behaves like MEMP_SANITY_CHECK) and ensure 'ram_end->prev' does not get changed
2017-09-26 22:30:18 +02:00
goldsimon
a61aee337b
mem.c: beautify converting between struct mem and heap index (add ptr_to_mem/mem_to_ptr)
2017-09-26 22:13:44 +02:00
goldsimon
1710fc1a89
Fix a corner case of double-free in the heap
2017-09-25 22:29:02 +02:00
goldsimon
f058364d7f
Added two simple unit tests for illegal calls to mem_free()
2017-09-25 21:38:00 +02:00
goldsimon
5e187bb8bc
Tiny typo fix
2017-09-25 20:24:47 +02:00
Jens Nielsen
7115384b15
Clear seg->oversize_left after sending OK
...
Signed-off-by: goldsimon <goldsimon@gmx.de >
2017-09-25 20:21:17 +02:00
Joel Cunningham
6cdfae1245
sockets: cleanup ioctlsocket for LWIP_COMPAT_SOCKETS == 2 (patch #9456 )
...
This makes two cleanups that follows the same organization as close/closesocket:
1) There is no lwip_ioctlsocket. Instead lwip_ioctl should redirect to ioctlsocket
2) With LWIP_POSIX_SOCKETS_IO_NAMES enabled, lwip_ioctl/ioctlsocket should redirect to ioctl
2017-09-22 08:51:48 -05:00
goldsimon
0c2d94a283
sntp: allow SNTP_UPDATE_DELAY to be a function
2017-09-22 06:26:53 +02:00
goldsimon
68d75a58df
sockets: adapt poll to LWIP_MPU_COMPATIBLE; make LWIP_SOCKET_POLL and LWIP_SOCKET_SELECT independent options
2017-09-21 22:18:55 +02:00
Kalle Olavi Niemitalo
1152fd02c0
New sockets function: lwip_poll
...
Signed-off-by: goldsimon <goldsimon@gmx.de >
2017-09-21 21:50:36 +02:00
goldsimon
333f1bf2bd
Fix compiling with LWIP_SOCKET_SELECT==0
2017-09-21 21:49:31 +02:00
Kalle Olavi Niemitalo
983eb8ebb4
Move select_cb list handling to functions (prepare for adding "poll")
...
Signed-off-by: goldsimon <goldsimon@gmx.de >
2017-09-21 21:10:08 +02:00
goldsimon
61e0a42cce
Guard LWIP_COMPAT_SOCKETS definitions of lwip_socket with LWIP_SOCKET_SELECT
2017-09-21 21:05:50 +02:00
goldsimon
60356514c7
Guard struct lwip_select_cb definition with LWIP_SOCKET_SELECT
2017-09-21 20:20:23 +02:00
Our Air Quality
dbd726959c
[PATCH] Replace the OOSEQ max bytes and pbufs constants with functions.
...
Some systems need to take into account an RX buffer pool size when
advising an appropriate number of RX pbufs to queue on the ooseq
list. For some systems there is a practical hard limit beyond which
the rx pool becomes exhausted blocking reception of further buffers
until some are freed.
It also helps to be able to consider the available dynamic memory when
advising an appropriate maximum number of bytes to buffer on the ooseq
list.
These decisions can also benefit from knowing the number already
allocated on a particular pcb, so the ooseq tcp segement is passed to
these functions. For example, if the system only wants to allow the
total number of rx pbufs queued on all the ooseq lists to grow by one
and a pcb already has two then it can return three for this call, but
might return one for another call - supporting a greedy allocation
strategy.
Signed-off-by: goldsimon <goldsimon@gmx.de >
2017-09-21 10:36:21 +02:00
goldsimon
7dcc407c53
tcp_in: favour local variables over ifdef blocks
2017-09-21 10:12:36 +02:00
goldsimon
8f459cc242
Make TCP_OOSEQ_MAX_BYTES and TCP_OOSEQ_MAX_PBUFS work independently
2017-09-21 09:52:51 +02:00
goldsimon
6d2b181cc0
tcp_in: favour code block over #ifdef blocks for local variables only used in TCP_OOSEQ_MAX_BYTES || TCP_OOSEQ_MAX_PBUFS configs
2017-09-21 09:50:47 +02:00
David Girault
f48c71e17f
altcp_tcp: free altcp_pcb struct in altcp_tcp_close()
...
Signed-off-by: goldsimon <goldsimon@gmx.de >
2017-09-20 20:50:03 +02:00
Dirk Ziegelmeier
8faf765632
Fix bug #52059 : httpd/makefsdata assumes UNICODE
...
Patch by Gisle Vanem
And fixup one variable name (currName -> curName)
2017-09-20 12:41:31 +02:00
Jisu Kim
6447a583e2
ipv6 ready: When there are more fragments(Mbit is not zero), payload_length field in IPV6 header must be the multiple of 8 (see patch #9455 )
...
Signed-off-by: goldsimon <goldsimon@gmx.de >
2017-09-19 14:29:27 +02:00
Jisu Kim
fa11461f84
ipv6 ready: Added exception handling to parse a routing header (see patch #9455 )
...
Signed-off-by: goldsimon <goldsimon@gmx.de >
2017-09-19 14:21:10 +02:00
Jisu Kim
675c6e4428
ipv6 ready: Hop-by-Hop and destination option header must be checked more detailed (see patch #9455 )
...
Hop-by-Hop, Destination option header structures consist of 2 unsigned char; next option type and header length field.
And TLV(Type-Length-Value) option headers come by the number in header length field.
If the option type in TLV option header is not recognized and 2 MSB is not 0, it is handled as an exception.
Signed-off-by: goldsimon <goldsimon@gmx.de >
2017-09-19 14:18:38 +02:00
Jisu Kim
72171c12b5
ipv6 ready: Hop-by-Hop and destination option header must be checked more detailed (see patch #9455 )
...
Hop-by-Hop, Destination option header structures consist of 2 unsigned char; next option type and header length field.
And TLV(Type-Length-Value) option headers come by the number in header length field.
If the option type in TLV option header is not recognized and 2 MSB is not 0, it is handled as an exception.
Signed-off-by: goldsimon <goldsimon@gmx.de >
2017-09-19 14:12:10 +02:00
Jisu Kim
acb4b60517
ipv6 ready: icmp6_param_problem() should send an exact offset to point to the error (see patch #9455 )
...
For this, convert 'u8_t nexth' to a pointer and change 'icmp6_param_problem()' to take a pointer, not an offset number
Signed-off-by: goldsimon <goldsimon@gmx.de >
2017-09-19 14:11:30 +02:00
Jisu Kim
7b27df1b83
ipv6 ready: clean up ipv6 header structs and add more header types & defines (see patch #9455 )
...
Signed-off-by: goldsimon <goldsimon@gmx.de >
2017-09-19 14:08:16 +02:00
goldsimon
6d1c067719
tabs -> spaces
2017-09-19 09:20:40 +02:00
Dirk Ziegelmeier
931b5e643c
Reformat core code using astylerc
2017-09-17 20:38:38 +02:00
Dirk Ziegelmeier
8c59be74c1
Reformat IPv4 code using astylerc
2017-09-17 20:33:27 +02:00
Dirk Ziegelmeier
3ed24085fa
Reformat SNMP code using astylerc
2017-09-17 20:29:18 +02:00
Dirk Ziegelmeier
6e7fe4520a
Reformat tftp_server.c using astylerc
2017-09-17 18:08:43 +02:00
Dirk Ziegelmeier
2ab73ad572
Reformat sntp.c using astylerc
2017-09-17 18:07:26 +02:00
Dirk Ziegelmeier
52d65ed1d0
Reformat netbiosns.c using astylerc
2017-09-17 18:05:07 +02:00
Dirk Ziegelmeier
be5bcc172d
Reformat mqtt.c using astylerc
2017-09-17 18:04:29 +02:00
Dirk Ziegelmeier
914a20728e
Reformat mdns.c using astylerc
2017-09-17 18:00:33 +02:00
Dirk Ziegelmeier
014420bfa0
Reformat lwiperf.c using astylerc
2017-09-17 18:00:23 +02:00
Dirk Ziegelmeier
6164f0cd34
Reformat httpd* using astylerc
2017-09-17 17:58:36 +02:00
Dirk Ziegelmeier
c35b1099a4
Reformat altcp_tls_mbedtls* using astylerc
2017-09-17 17:52:44 +02:00
Dirk Ziegelmeier
438cfd3f14
Reformat sockets.c using astylerc
2017-09-17 17:50:24 +02:00
Dirk Ziegelmeier
fa33db1448
Reformat tcpip.c using astylerc
2017-09-17 17:50:24 +02:00
Dirk Ziegelmeier
dc9115334e
Reformat netifapi.c using astylerc
2017-09-17 17:50:24 +02:00
Dirk Ziegelmeier
771ac7ac44
Reformat netdb.c using astylerc
2017-09-17 17:50:24 +02:00
Dirk Ziegelmeier
bfae233e3e
Reformat netbuf.c using astylerc
2017-09-17 17:50:24 +02:00
Dirk Ziegelmeier
3d60024f9b
Reformat if_api.c using astylerc
2017-09-17 17:50:24 +02:00
Dirk Ziegelmeier
75847c8b4d
Reformat err.c using astylerc
2017-09-17 17:50:24 +02:00
Dirk Ziegelmeier
2b977a4a6a
Reformat api_msg.c using astylerc
2017-09-17 17:50:24 +02:00
Dirk Ziegelmeier
30152cea78
Reformat api_lib.c using astylerc
2017-09-17 17:50:24 +02:00
dziegel
cdbba6e0d8
Make astylerc compatible to astyle 2.x
2017-09-17 17:50:24 +02:00
Jisu Kim
bd94297115
icmp6_send_response() sends the pointer in network byte order (see patch #9455 : IPv6 ready test on RFC2460)
...
Signed-off-by: goldsimon <goldsimon@gmx.de >
2017-09-16 22:46:42 +02:00
goldsimon
ab1c9548e0
Increase IPv4 reassembly timeout according to RFC 791
2017-09-16 22:43:12 +02:00
Jisu Kim
27b7ed17fc
First step to passing IPV6 Ready test: time out IPv6 fragments after 60 seconds
...
(added IPV6_REASS_MAXAGE as an option that is independent of the IPv4 setting)
Signed-off-by: goldsimon <goldsimon@gmx.de >
2017-09-16 22:41:35 +02:00
Joel Cunningham
67bf0a6d0a
CHANGELOG: add bug #51990
2017-09-15 08:27:18 -05:00
goldsimon
c5c98cbb00
Fix UPGRADING: slipif change has been released with 2.0.2 already
2017-09-15 13:09:09 +02:00
goldsimon
14919e34a1
icmp_input: fix possibly unused variable (used for debug output only)
2017-09-15 11:44:22 +02:00
Joel Cunningham
5c0054d8ee
Remove double free on select_cb (bug #51990 )
...
This was left over after the refactoring in 92b6f83eb2
2017-09-13 16:51:03 -05:00
goldsimon
7ba479e482
Try to fix clang runtime errors during unit tests (see bug #51652 )
2017-09-12 21:51:50 +02:00
goldsimon
92b6f83eb2
Slightly rework the fix for bug #51990 : allocate select_cb only if we actually need to wait
2017-09-12 21:37:48 +02:00
David Lockyer
72a00ca79c
Fixed bug #51990 : Calling select() from different threads with MPU enabled triggers memory protection fault
...
Signed-off-by: goldsimon <goldsimon@gmx.de >
2017-09-12 21:19:54 +02:00
Joel Cunningham
445eef2b0e
sockets: add readv() implementation (task #14610 )
...
Adds an implementation of readv() that calls recvmsg()
See http://pubs.opengroup.org/onlinepubs/009695399/functions/readv.html
2017-09-11 14:48:33 -05:00
goldsimon
558480a5b9
add bug #51937 to CHANGELOG
2017-09-11 21:37:28 +02:00
goldsimon
630c4a3de3
try to fix building unit test on gcc/clang
2017-09-11 11:10:42 +02:00
Jakub Schmidtke
b7e5de389e
Fixed removing unneeded TCP SACKs
...
TCP SACKs were removed after some changes in the ooseq queue,
but before all unneeded packets were removed from it.
Because of that, we would sometimes include SACKs
for data already delivered in-order.
Signed-off-by: goldsimon <goldsimon@gmx.de >
2017-09-09 21:51:13 +02:00
goldsimon
86abfbe087
Fix bug #51937 by checking TF_CLOSED at the end of all pcb callbacks in tcp_input()
2017-09-09 21:46:41 +02:00
goldsimon
a8ac37f419
refactor tcp_input a bit in preparation of a fix for bug #51937
2017-09-09 21:41:06 +02:00
goldsimon
48c687ea84
tcp_remove_all() (used in tcp test setup/teardown): handle tcp_bound_pcbs, too
2017-09-05 22:20:44 +02:00
goldsimon
cf651e7e0f
add test case that shows what's wrong for bug #51937 (Leaking tcp_pcbs on passive close with unacked data)
2017-09-05 22:19:38 +02:00
goldsimon
fca38fda1a
remove unnecessary lines from last added test case
2017-09-05 22:18:52 +02:00
goldsimon
8c04009357
add unit test case for passive open & (invalid) bug #51941
2017-09-05 21:47:06 +02:00
Our Air Quality
dc7a9c8c37
tcp_in: correct some loops continuing without maintaining a prev pointer.
...
This problem would appear to have only affected systems with multiple
interfaces. It was noted causing tcp resets when the pcb was lost, and there
might have been other associated problems.
Signed-off-by: Dirk Ziegelmeier <dirk@ziegelmeier.net >
2017-09-04 07:48:37 +02:00
Joel Cunningham
28e519b72d
tcp_output: move useg assignment to right before segment while loop
...
There were a couple cases in-between that could cause an exit from
tcp_output which don't use useg. With large send buffers, pcb->unacked
may be large and calculating useg is wasted in these exit cases
Some compilers may be re-ordering this already, but it doesn't hurt to
correctly arrange the code
2017-08-29 16:59:39 -05:00
goldsimon
1d4ca0bff6
Fix bug #51687 (tcp_close(): is it OK to return ERR_MEM if TF_CLOSEPEND is set?)
2017-08-28 21:59:05 +02:00
goldsimon
e749678eed
Fix function signature of fcntl() for LWIP_COMPAT_SOCKETS == 2 && LWIP_POSIX_SOCKETS_IO_NAMES (see bug #51701 )
2017-08-25 22:07:14 +02:00
goldsimon
c7edfdf987
Fix bug #51765 and fix commit 90873d6: call tcp_rexmit_fast() more than once on dupacks since the actual transmission is guarded by TF_INFR, not by pcb->dupacks
2017-08-25 21:16:59 +02:00
Joel Cunningham
f582c88339
tcp: persist timer re-work (bug #50837 )
...
This re-works the persist timer to have the following behavior:
1) Only start persist timer when a buffered segment doesn't fit within
the current window and there is no in-fligh data. Previously, the
persist timer was always started when the window went to zero even
if there was no buffered data (since timer was managed in receive
pathway rather than transmit pathway)
2) Upon first fire of persist timer, fill the remaining window if
non-zero by splitting the unsent segment. If split segment is sent,
persist timer is stopped, RTO timer is now ensuring reliable window
updates
3) If window is already zero when persist timer fires, send 1 byte probe
4) Persist timer and zero window probe should only be active when the
following are true:
* no in-flight data (pcb->unacked == NULL)
* when there is buffered data (pcb->unsent != NULL)
* when pcb->unsent->len > pcb->snd_wnd
2017-08-25 09:35:10 -05:00
Axel Lin
2e4867fcde
api_msg: Remove superfluous NETIF_NO_INDEX checking
...
netif_get_by_index() returns NULL if idx is NETIF_NO_INDEX.
So remove the superfluous NETIF_NO_INDEX checking for msg->msg.jl.if_idx
before calling netif_get_by_index().
Signed-off-by: Axel Lin <axel.lin@ingics.com >
Signed-off-by: Dirk Ziegelmeier <dirk@ziegelmeier.net >
2017-08-24 08:59:49 +02:00
goldsimon
1ed1cfe83a
TCP: simplify trimming left edge & use pbuf_remove_header() instead of pbuf_header()
2017-08-21 22:34:44 +02:00
goldsimon
22ee33951b
TCP: added a unit test for trimming left side of rx segment
2017-08-21 22:34:01 +02:00
goldsimon
bd8709bc82
Simplify pbuf_remove_header() a bit
2017-08-21 22:33:01 +02:00
goldsimon
3c5398403d
fix pbuf_split_64k() for zero-length pbufs
2017-08-21 22:08:53 +02:00
Dirk Ziegelmeier
b9d3812ee8
Add assertion that netif index is within sane range in sockets.h.
...
We can assert here since lwIP only supports <= 255 netifs due to netif index being an u8_t.
2017-08-21 21:27:12 +02:00
Dirk Ziegelmeier
fa51a7225a
lwip_socket_drop_registered_mld6_memberships: Fix if_idx got lost :-(
2017-08-21 09:46:08 +02:00
Dirk Ziegelmeier
6082251854
Use netconn_join_leave_group_netif() in sockets.c, lwip_socket_drop_registered_mld6_memberships to avoid threading issues (reported by Joel Cunningham)
2017-08-21 09:43:34 +02:00
Dirk Ziegelmeier
f457769fe8
Add netconn_join_leave_group_netif() that takes netif index as argument
2017-08-21 09:42:57 +02:00
Dirk Ziegelmeier
d0e0afb46a
sockets.c, lwip_socket_drop_registered_mld6_memberships: Remove membership from socket_ipv6_multicast_memberships even if netif cannot be found
2017-08-21 09:30:23 +02:00
Joel Cunningham
3bdb34886c
sockets IPv6: cast interface index to u8_t
...
Interface indexes are u8_t internally so cast from sockets int representation to u8_t
This was found with MSVC 2013:
1>lwip\src\api\sockets.c(3190): warning C4242: 'function' : conversion from 'const unsigned int' to 'u8_t', possible loss of data
1>lwip\src\api\sockets.c(3698): warning C4242: 'function' : conversion from 'unsigned int' to 'u8_t', possible loss of data
2017-08-17 08:54:50 -05:00
Dirk Ziegelmeier
339ec17cf0
Fixup my last commit
2017-08-16 17:41:46 +02:00
Dirk Ziegelmeier
e58e398267
Implement IPv6 IPV6_JOIN_GROUP/IPV6_LEAVE_GROUP socket options
2017-08-16 17:41:46 +02:00
Dirk Ziegelmeier
9d74883491
Moving eth_type to iana.h was incorrect - these are assigned by IEEE. IANA published a document containing these numbers, but does not assign them. I didn't see that in the first place :-(
...
Now we have ieee.h, too.
2017-08-15 13:50:12 +02:00
Dirk Ziegelmeier
c6fac10b62
Rename eth_type enum in iana.h to be prefixed with lwip_iana_
2017-08-15 13:42:39 +02:00
Dirk Ziegelmeier
aaee7ed1e7
Improve documentation in iana.h
2017-08-15 13:40:37 +02:00
Dirk Ziegelmeier
2013f4cbd4
Move eth_type definition to iana.h
2017-08-15 13:35:30 +02:00
Dirk Ziegelmeier
772bf96752
Fix makefsdata.c on Win32 after moving to tinydir.h
2017-08-14 09:13:36 +02:00
Dirk Ziegelmeier
01bbbdb19f
More makefsdata fixes:
...
- fix lwip_itoa usage was totally messed up
- fix size_t format string was missing % prefix
2017-08-11 22:50:08 +02:00
Dirk Ziegelmeier
8878a042dc
Apply patch #9399 : makefsdata for linux
...
+ some more fixes in compiling under Linux by Dirk Ziegelmeier
2017-08-11 22:50:08 +02:00
Joel Cunningham
9844049cb1
lwip_itoa: fix converting 0 (bug #51729 )
...
lwip_itoa would output the number 0 as \0. This fixes the issue by
adding a special check before the normal conversion loop
This was found via shell cmd idxtoname and win32 port. "lo0" should
be returned for index 1
2017-08-11 13:38:51 -05:00
Dirk Ziegelmeier
0cf405e24f
Fix that the socket option IPV6ONLY can only be set on TCP sockets
...
Reported by Andrej Butok
2017-08-10 09:14:31 +02:00
Joel Cunningham
3d82155d29
tcp: use TCP_WND_INC for dupack > 3 case
...
TCP_WND_INC abstracts the rollover handling and allows the window to
reach it's maximum value
2017-08-09 16:28:55 -05:00
Joel Cunningham
b8a3cf3a4a
tcp: use tcp_set_flags() rather than manually setting flag
2017-08-09 12:15:52 -05:00
Joel Cunningham
ba7a3204cb
tcp: use tcp_ack_now rather than manually setting TF_ACK_NOW
2017-08-09 10:13:41 -05:00
goldsimon
90873d6c71
Continue fixing the spirit of bug #51663 : don't change pcb state if retransmission can't be done because segments are still queued for transmission
...
- add a better-documented static function tcp_output_segment_busy
- try to reduce the number of checks
- tcp_rexmit_rto: iterate pcb->unacked only once
- no need to check for ref==1 in tcp_rexmit_fast when tcp_rexmit does
- call tcp_rexmit_fast if dupacks >= 3 (not == 3) and use TF_INFR flag to guard the fast-rexmit case (that way, it's triggered again on the next dupack)
2017-08-08 23:02:14 +02:00
Our Air Quality
6a01607004
tcp_out rto: delay re-transmission earlier if link writes are deferred.
...
There is already a guard in tcp_output_segment() for a pbuf still being
referenced by the netif driver due to deferred transmission, however the callers
are modifying state even when this gives up.
It seems cleaner to have the callers guard this case and avoid modifying their
state.
tcp_rexmit_rto() might better avoid re-transmission of any segments if any of
the unacked segments are deferred, to avoid loading the link further if it is
struggling to flush its buffered writes. Link level queues can be limited on
some devices and need spares for link management.
2017-08-08 22:20:02 +02:00
Joel Cunningham
902d393aef
tcp: map tcp_ack_now() directly to tcp_set_flags()
...
Also remove extra set of parenthesis in tcp_ack()
2017-08-08 14:56:00 -05:00
goldsimon
fed916b852
tiny doc change to LWIP_HOOK_IP4_ROUTE_SRC
2017-08-08 21:03:41 +02:00
goldsimon
991f751305
Even more pbuf_header -> pbuf_add/remove_header replacements (also in strings)
2017-08-08 20:51:57 +02:00
goldsimon
07434aa73a
More pbuf_header -> pbuf_add/remove_header replacements
2017-08-08 20:40:26 +02:00
Dirk Ziegelmeier
47a4be83e4
CHANGELOG/UPGRADING: Also mention that LWIP_HOOK_IP4_ROUTE_SRC has changed, too
2017-08-08 13:13:46 +02:00
goldsimon
6d28e9de79
Some cleanups after applying David Girault's altcp patches
2017-08-08 12:59:49 +02:00
David Girault
bc3edfb4d7
altcp_tls_mbedtls: remove "rx pbufs left at end of handshake" assert
...
There is case where a close notify come right after the handshake and is in the same pbuf!
So just handle these data like any other data.
2017-08-08 12:59:48 +02:00
David Girault
0486100a2b
altcp_tls: some fixes
...
- added `altcp_tls_free_config()`.
- added `altcp_tls_context()` function to allow mbedtls parameter tweak.
Since state structure isn't exported, this allow application to get
internal context (port dependent) to tweak it.
- free altcp_pcb when lower error callback called.
2017-08-08 12:59:47 +02:00
David Girault
ee89d906ec
altcp_tcp: some fixes
...
- expose `altcp_tcp_setup()` so we can wrap altcp over existing tcp pcb.
- avoid calling tcp_close() with NULL pcb.
- free altcp_pcb struct when error callback called.
According to `mqtt_tcp_err_cb()` in src/apps/mqtt/mqtt.c, altcp socket should
work the same way than raw tcp socket. So freeing altcp_pcb ensure this.
2017-08-08 12:59:46 +02:00
David Girault
9d120c59ea
altcp: fix altcp_free
...
call dealloc function in altcp_free() so it can be propagate it to inner_conn.
2017-08-08 12:59:45 +02:00
David Girault
8b1a4ef711
altcp_tls_mbedtls: fix log messages by include a \n
2017-08-08 12:59:44 +02:00
Dirk Ziegelmeier
60dd518887
Implement task #14594 : Improve consistency of ip route API parameters
...
reverse parameters of ip4_route_src to be consistent with other ip*_route* functions
This commit will break applications using this function!
2017-08-08 12:41:19 +02:00
Dirk Ziegelmeier
145d6ab5d2
test_etharp.c: IANA_HWTYPE_ETHERNET -> LWIP_IANA_HWTYPE_ETHERNET
2017-08-08 12:22:19 +02:00
goldsimon
ae7c76c773
Rework pbuf_add_header_impl to only modify the pbuf after all checks passed
2017-08-08 12:19:06 +02:00
Dirk Ziegelmeier
6209c8d347
Fix bug #51686 : pbuf_remove_header: silence unused variable warning
...
but in another way than the provided patch
2017-08-08 12:13:45 +02:00
Dirk Ziegelmeier
e65a388c1f
ip4.c does not need to #include prot/dhcp.h any more
2017-08-08 11:49:00 +02:00
Dirk Ziegelmeier
1c91118f4a
Add DHCP ports to iana.h
2017-08-08 11:46:15 +02:00
Dirk Ziegelmeier
0eb8d19e82
Move several port number #defines to iana.h
2017-08-08 11:37:08 +02:00
Dirk Ziegelmeier
5193844ac4
iana.h: Prefix #defines with LWIP_
2017-08-08 11:21:11 +02:00
Dirk Ziegelmeier
79a08c9fee
tcp.c: Remove side-effects from boolean expressions
2017-08-08 11:05:23 +02:00
Dirk Ziegelmeier
b54bf3ccca
ASytleRC: Don't indent prepocessor blocks for now
2017-08-08 11:05:23 +02:00
goldsimon
51c4bc55a0
iana.h: added RFC
2017-08-07 22:07:09 +02:00
Dirk Ziegelmeier
629ec98dd8
Work on task #14587 : Create common header for IANA assigned numbers
...
Create include/lwip/prot/iana.h
Move DHCP and ARP #define in there
2017-08-07 21:06:19 +02:00
Dirk Ziegelmeier
42fd01547d
Fix bug #51681 : mqtt: cannot free client
...
Add free function
2017-08-07 20:43:25 +02:00
goldsimon
4fb7fab850
Fix docs on dhcp_option_trailer()
2017-08-07 08:08:24 +02:00
Our Air Quality
ff588fc771
dhcp: quieten a compile unused variable warning
2017-08-06 21:21:10 +02:00
goldsimon
a1c7924cb6
task #14597 : cleanup pbuf_header usages (use pbuf_add_header/pbuf_remove_header instead)
2017-08-04 22:38:11 +02:00
goldsimon
1981cf39d1
opt.h: improved hooks documentation by adding function signatures for all hooks
2017-08-04 21:55:10 +02:00
goldsimon
a681f6b04f
Fix using LWIP_HOOK_DHCP_PARSE_OPTION after recent dhcp changes
2017-08-04 21:53:24 +02:00
goldsimon
cd80e38db8
Clean up DHCP a bit: no need keep msg_out and msg_in as members in struct dhcp
...
They are used in a call stack only (p_out and options_out_len as well)
2017-08-04 21:26:29 +02:00
goldsimon
7b41aba126
Add the last commit to CHANGELOG
2017-08-04 21:23:12 +02:00
goldsimon
65ac160e99
Wconversion-related cleanup: split pbuf_header(s16_t) into pbuf_add_header(size_t) and pbuf_remove_header(size_t)
...
The new functions both take size_t as increment/decrement argument instead of s16_t (which needed to be range-checked before conversion everywhere) - in most places, the direction (increment or decrement) is known anyway, so no need to encode it in a sign bit
2017-08-04 13:16:18 +02:00
Dirk Ziegelmeier
22ccc2e2b8
Start working on an astylerc for lwIP (not finished, don't use!)
2017-08-04 09:55:49 +02:00
goldsimon
1e5870ce85
Fix unit tests under linux
2017-08-04 06:17:21 +02:00
goldsimon
47f55b02bf
Finally fix bug #50088 (socket/netconn: data before RST should be readable) and added a unit test for it
2017-08-03 22:28:50 +02:00
goldsimon
4cec20230e
Ensure that unit tests leave the stack in a clean state
2017-08-03 22:28:50 +02:00
Joel Cunningham
6fa5d02435
tcp: remove extra seg == NULL checks
...
In tcp_output() there were a number of blocks of code performing
duplicate checks of 'if (seg == NULL)'. This combines them together
to reduce duplicate checks
TCP_OUTPUT_DEBUG and TCP_CWND_DEBUG also don't need to be guarded
by #if/#endif since the LWIP_DEBUGF infrastructure already compiles them
out when LWIP_DEBUG is not defined
2017-08-03 10:37:16 -05:00
goldsimon
5ea7f507c3
Fixed bugs #51606 and #51535 : IPv4 reassembly could be finished although there are holes
2017-08-02 21:11:53 +02:00
Axel Lin
2781d7abd7
ip6_reass: Move update ip6_frag.drop stats to nullreturn
...
The ip6_frag.drop counter is updated before all the code paths calling
goto nullreturn, so let's move updating ip6_frag.drop stats to nullreturn.
Signed-off-by: Axel Lin <axel.lin@ingics.com >
2017-08-01 20:48:08 +02:00
Joel Cunningham
5d2be3460f
docs: update remaining api_msg_msg references
...
This updates some remaining references to the old struct api_msg_msg
(renamed to struct api_msg) in comment blocks
2017-08-01 11:56:54 -05:00
goldsimon
a81b19aa62
Fixed bug #51623 : DHCP request XID should probably be regenerated for INIT-REBOOT
2017-07-31 20:20:31 +02:00
Joel Cunningham
2b2ea50cb1
ip4: fix swapped src/dst params with ip4_route_src
...
This fixes a couple of occurrences where the src and dst parameters to
ip4_route_src() were swapped. This was most likely due to confusion between
ip_route(src, dst) and ip4_route_src(dst, src)
This was found in a system where LWIP_IPV4_SRC_ROUTING is 0
The UDP case was an application socket bound to INADDR_ANY with
IP_MULTICAST_IF set. Transmits would result in calling ip4_route(dst) where
dst was pcb->local_addr (which was INADDR_ANY) instead of pcb->mcast_ip4.
This resulted in a routing failure
The ICMP issue was found through code analysis only
2017-07-31 08:57:11 -05:00
Dirk Ziegelmeier
006bb84368
Fix bug #50883 : struct eth_addr alignment does not fit with ETHADDR16_COPY
...
... by simply removing ETHADDR16_COPY since noone advocated to keep it
2017-07-30 17:48:16 +02:00
goldsimon
500598658d
ip4_reass: fixed bug #51596 (Insufficient overlap check)
2017-07-28 10:11:45 +02:00
goldsimon
3dedfa3d1f
ip4_reass: fixed bug #51597 (Last fragment is assumed to have arrived even if it was discarded)
2017-07-28 09:46:56 +02:00
goldsimon
f1072fee8a
ip4_reass: fixed bug #51595 (ip_reass_pbufcount may be updated incorectly)
2017-07-28 09:41:00 +02:00
Dirk Ziegelmeier
ca76c302f1
Probably fix bug #51602 : MQTT Ring buffer 'get'
...
Rollover of get index was wrong
2017-07-28 08:01:30 +02:00
Our Air Quality
ff03ae6f55
dhcp: restart dhcp after releasing.
...
There were uses of dhcp_release() followed immediately by dhcp_discover() but
dhcp_release() now stops dhcp so discovery would fail, so call dhcp_start()
after release which restarts discovery.
Signed-off-by: Dirk Ziegelmeier <dirk@ziegelmeier.net >
2017-07-28 07:57:50 +02:00
Axel Lin
925f3944d3
init: Correct minimal MEMP_NUM_SYS_TIMEOUT setting check
...
According to commit 1f780e86d5 ("PPP timeouts required depend on the number of allowed PPP sessions"):
Per PPP needs 6 timeouts (AUTH + PAP|CHAP|EAP + LCP + IPCP + IP6CP + PPPoE).
So update the minimal MEMP_NUM_SYS_TIMEOUT setting check accordingly.
Since we have LWIP_NUM_SYS_TIMEOUT_INTERNAL so just switch to use it.
Signed-off-by: Axel Lin <axel.lin@ingics.com >
Signed-off-by: goldsimon <goldsimon@gmx.de >
2017-07-27 20:51:11 +02:00
goldsimon
a6432c46aa
Clarify LWIP_NUM_SYS_TIMEOUT_INTERNAL regarding PPP and make the number of required timeouts per ppp_pcb configurable as we don't really know it right now ;-)
2017-07-27 20:50:40 +02:00
goldsimon
45fb7d7220
Give struct fs_file::pextension its own type & improve its documentation (see also task #14567 )
2017-07-26 22:16:26 +02:00
Axel Lin
a92a281455
PPP, VJ: Use pbuf_clone to replace pbuf_alloc+pbuf_copy
...
Signed-off-by: Axel Lin <axel.lin@ingics.com >
Signed-off-by: goldsimon <goldsimon@gmx.de >
2017-07-26 21:18:33 +02:00
Dirk Ziegelmeier
ecd6c7ceae
Fix bug #51525 : MQTT_OUTPUT_RINGBUF_SIZE validation
...
Ringbuf now supports sizes that are not a power of two
2017-07-26 18:53:12 +02:00
Dirk Ziegelmeier
0d23d686eb
snmp_asn1.c: Fix handling of u64 values
2017-07-26 12:48:19 +02:00
Dirk Ziegelmeier
0dabc8df9b
snmp_asn1: Surround u64_t handling functions with #if LWIP_HAVE_INT64
2017-07-26 09:42:41 +02:00
Dirk Ziegelmeier
b5fe13d818
Don't declare SNMP_ASN1_TYPE_COUNTER64 on systems that do not have uint64_t to avoid runtime problems
2017-07-26 09:33:15 +02:00
Dirk Ziegelmeier
b7e24fdc58
Accidentally removed a break statement in my last commit
2017-07-26 09:32:40 +02:00
Dirk Ziegelmeier
aa4d978448
Fix [bug #51520 ] Big endian bug in apps/snmp/snmp_asn1.c
...
Apply patch from Art Heers that does not need endianess checks
2017-07-26 09:28:07 +02:00
Dirk Ziegelmeier
f5d7535323
Work on [bug #51577 ] snmp/asn1: 64 bit encoding/decoding seems broken for big endian
...
We should support COUNTER64 data type only when we have u64_t on the system
2017-07-26 09:27:11 +02:00
Dirk Ziegelmeier
3ec8b22f14
snmp_core.h: Add room for u64 values in union snmp_variant_value
2017-07-26 09:06:13 +02:00
goldsimon
4c13c32473
fix bug #51578 (SNMP failed to decode some values on non 32bit platforms)
2017-07-26 08:41:13 +02:00
Joel Cunningham
c5db278746
sockets: Refactor event_callback()
...
This refactors event_callback() to separate updating socket event
state from processing the select list (to apply socket event change)
Refactoring changes:
1) select_list_cb processing has been moved to a new local function called
select_check_waiters()
2) goto no_select_wakeup has been removed and now we use a flag
to track whether to call select_check_waiters()
3) There is a small functional change for !LWIP_TCPIP_CORE_LOCKING.
We call SYS_ARCH_UNPROTECT after saving events but before calling
select_check_waiters() (which now calls PROTECT before starting the loop).
Before the code held the PROTECT across saving the events and the first
loop iteration, but this didn't protect against anything because each loop
iteration we do an UNPROTECT/PROTECT
4) Better documentation for both LWIP_TCPIP_CORE_LOCKING and
!LWIP_TCPIP_CORE_LOCKING
2017-07-25 15:06:26 -05:00
goldsimon
0ee6ad0a3a
Removed LWIP_SOCKET_SET_ERRNO - errno is always set - if it doesn't exist, it must be provided by the port
2017-07-25 21:54:10 +02:00
goldsimon
a2e4dd2de7
Minor whitespace cleanups
2017-07-25 21:48:17 +02:00
Matthias Hofmann
9b06d71aeb
Fix using DHCP IP configuration after lease time is expired.
...
Signed-off-by: goldsimon <goldsimon@gmx.de >
2017-07-25 21:46:57 +02:00
goldsimon
9b5d8f14a9
tcp_getoptbyte() -> tcp_get_next_optbyte() (to make it clearer that this function modifies something - not only a getter)
2017-07-25 21:38:06 +02:00
Matthias Hofmann
64bceabc03
Increase SNTP_RECV_TIMEOUT to be conform with RFC.
...
Signed-off-by: goldsimon <goldsimon@gmx.de >
2017-07-25 20:52:25 +02:00
Pascal Quantin
2e78b6dcae
Fixed bug #51528 (Bug when parsing WND_SCALE option)
...
Signed-off-by: goldsimon <goldsimon@gmx.de >
2017-07-24 21:38:47 +02:00
goldsimon
afee9013ad
added passages about moved posix headers and changed SO_ERROR to CHANGELOG/UPGRADING
2017-07-24 21:15:45 +02:00
goldsimon
6d51b3ff37
Restructure compatibility headers to fix bug #51463
2017-07-20 22:11:55 +02:00
Our Air Quality
f934ca7a03
[PATCH] Deprecate sys_arch_sem_wait and sys_arch_mbox_fetch returning the time waited
...
These are now defined to return != SYS_ARCH_TIMEOUT on success rather than the time
waiting. The returned times were unused by lwip and this simplifies at
least some implementations.
Signed-off-by: goldsimon <goldsimon@gmx.de >
2017-07-20 22:04:34 +02:00
goldsimon
597d5459bb
Make sys_arch_sem_wait() & sys_arch_mbox_fetch() a little more robust when waiting (although this should never be a problem...)
2017-07-20 22:02:30 +02:00
Our Air Quality
66a84cb2ef
Clarify that sys_arch_protect() always has a matching unprotect.
...
This is to allow an implementation to use a nesting counter, or a
recursive mutex. Also clarify that the value returned by
sys_arch_protect() is opaque to lwip and implementation dependent.
Signed-off-by: goldsimon <goldsimon@gmx.de >
2017-07-20 21:22:35 +02:00
goldsimon
d01b3177fd
Fix bug #51507 (Keep uses of SYS_ARCH_PROTECT/UNPROTECT in alloc_socket nested)
2017-07-20 21:18:40 +02:00
Joel Cunningham
99e1f37b82
IP_PKTINFO: set msg_controllen upon output
...
This fixes a bug where when writing IP_PKTINFO to msg_control, the
msg_controllen field was not updated with the length written
This bug is exposed by applications that provide a msg_control buffer large
enough for multiple control messages. Then when calling CMSG_NXTHDR, it
returned a next cmsg pointer even though was no additional message
2017-07-20 12:29:56 -05:00
Joel Cunningham
5cd475d91b
docs: remove 'unimplemented' tag from exceptset
...
The exceptset FDs in select() are implemented and record pending socket
errors. This removes the 'unimplemented' tag in documentation
2017-07-18 16:56:02 -05:00
goldsimon
26771d0800
Add @todo: scope ip6addr?
2017-07-18 19:17:17 +02:00
Our Air Quality
5eff45cac0
Correct a few uses of sizeof(ip6_addr_t) to sizeof(ip6_addr_p_t)
...
The ip6_addr_t structure may have an addition slot so is not necessarily
the size of an ipv6 address, so some uses of sizeof(ip6_addr_t) were not
correct.
Signed-off-by: goldsimon <goldsimon@gmx.de >
2017-07-18 19:17:17 +02:00
Joel Cunningham
7b13fae833
docs: update references to global igmp_group_list
...
This updates documentation to refer to netif specific igmp group list rather
than the old global igmp_group_list
2017-07-17 14:25:14 -05:00
Dirk Ziegelmeier
328134fdba
Fix two -Wconversion warnings
2017-07-15 10:25:45 +02:00
goldsimon
3c371e4d52
Fixed bug #51379 : (Sockets: prevent select_waiting overflow)
2017-07-14 20:16:11 +02:00
Dirk Ziegelmeier
aa317dcb18
Fix dhcp documentation
2017-07-12 11:09:36 +02:00
Dirk Ziegelmeier
d62d3edc08
Update tcpip.c/.h documentation
2017-07-12 11:08:35 +02:00
Dirk Ziegelmeier
30a2283993
Move netifapi private definitions to priv/api_msg.h
2017-07-12 10:56:42 +02:00
Dirk Ziegelmeier
c08459490d
Update netifapi documentation
2017-07-12 10:48:43 +02:00
Dirk Ziegelmeier
66df84a5b5
Map dhcp_release_and_stop() to netifapi, mark old functions as deprecated
2017-07-12 10:43:40 +02:00
Dirk Ziegelmeier
d021972785
Fix "no previous prototype" warning when TCP_QUEUE_OOSEQ is disabled
2017-07-11 09:59:11 +02:00
Dirk Ziegelmeier
449eb64fcb
Fix my last commit - break is missing
2017-07-10 09:52:48 +02:00
Dirk Ziegelmeier
57b1471254
Avoid return in case statement, makes function control flow equal to other case statement paths
2017-07-10 09:40:21 +02:00
Dirk Ziegelmeier
9130d37df7
Add "fall through" statement to Axel's patch
2017-07-10 09:37:59 +02:00
Axel Lin
6f28a874b8
pbuf: Simplify pbuf_alloc a bit
...
No need to have additional if statement for PBUF_REF/PBUF_ROM.
It can be merged to the existing swtich(type) cases.
Signed-off-by: Axel Lin <axel.lin@ingics.com >
2017-07-10 09:37:07 +02:00
goldsimon
f3c860958f
-Wconversion (still far from finished) and other minor compilation fixes...
2017-07-06 22:47:11 +02:00
goldsimon
866d6c8637
Make PBUF_LINK_ENCAPSULATION_HLEN default signed (unsigned would be OK, but too many defines are signed already and mixing them gets bad)
2017-07-06 20:26:24 +02:00
goldsimon
c730a404d4
Make ioctl(FIONBIO) take an int*, not a u32_t* to got the *nix way
2017-07-06 20:25:41 +02:00
goldsimon
b8ecfe640c
work on -Wconversion...
2017-07-06 12:38:50 +02:00
goldsimon
2594f1a423
Try to fix the build: ip_globals.current_ip6_header cannot really be const :(
2017-07-06 11:50:02 +02:00
goldsimon
694fc7e472
work on -Wconversion...
2017-07-06 11:22:38 +02:00
goldsimon
9d61e36466
work on -Wconversion, fixed some const bug in ip4
2017-07-06 09:01:03 +02:00
goldsimon
44f7a3cb0d
work on -Wconversion...
2017-07-05 22:31:58 +02:00
goldsimon
c5607d3889
Fix compiling ASSERT (broken some commits ago)
2017-07-05 12:22:02 +02:00
goldsimon
ba6b504cc0
work on -Wconversion...
2017-07-05 12:20:26 +02:00
goldsimon
9a40597ced
work on -Wconversion...
2017-07-04 21:31:30 +02:00
goldsimon
debf34ff9c
work on -Wconversion...
2017-07-04 21:26:30 +02:00
goldsimon
2b2fa0ed71
Ensure SACKs are deleted when pbuf_free_ooseq() frees ooseq pbufs (because of memory shortage)
2017-07-04 20:10:23 +02:00
goldsimon
0b91888eb1
remove invalid TODO comment
2017-07-04 20:09:41 +02:00
goldsimon
b1a90ad74a
Added TCP SACKs to CHANGELOG
2017-07-04 20:09:15 +02:00
goldsimon
1a1c360f1d
Fixed LWIP_TCP_SACK_VALID and its usage
2017-07-03 21:41:34 +02:00
goldsimon
6796bcf7ad
Cleaned up a bit after merging SACK_OUT support (mostly coding style)
2017-07-03 21:20:56 +02:00
Jakub Schmidtke
b1a3c37c3c
Partial SACK (RFC 2018) support
...
Adds partial support for selective acknowledgements (RFC 2018).
This change makes lwIP negotiate SACK support, and include SACK
data in outgoing empty ACK packets. It does not include it
in outgoing packets with data payload.
It also does not add support for handling incoming SACKs.
Signed-off-by: goldsimon <goldsimon@gmx.de >
2017-07-03 20:17:30 +02:00
goldsimon
d262132b92
work on -Wconversion...
2017-07-03 20:15:02 +02:00
Dirk Ziegelmeier
94beb4eddf
Make inet_chksum.c compile with -Wconversion
2017-06-30 22:17:32 +02:00
goldsimon
41177cfd1c
work on -Wconversion...
2017-06-30 22:10:16 +02:00
goldsimon
c636072362
pbuf.c: work on -Wconversion...
2017-06-29 22:49:39 +02:00
goldsimon
5d10e1b6c3
test_pbuf: free pbufs at the end of tests
2017-06-29 20:44:14 +02:00
Axel Lin
ca9eae26e1
PPP, VJ: Use vj_uncompress_err at appropriate places
...
Use vj_uncompress_err() instead of duplicating the same code.
Signed-off-by: Axel Lin <axel.lin@ingics.com >
Signed-off-by: Sylvain Rochet <gradator@gradator.net >
2017-06-29 11:44:11 +02:00
Axel Lin
79f2200b27
PPP, PPPoS: Fix update SNMP ifoutoctets counter in pppos_output_last()
...
Current code does not correctly update ifoutoctets counter because nb->tot_len
is always 0. Fix it by setting nb->tot_len to actual payload length so we can
update ifoutoctets correctly.
Signed-off-by: Axel Lin <axel.lin@ingics.com >
Signed-off-by: Sylvain Rochet <gradator@gradator.net >
2017-06-29 11:44:08 +02:00
goldsimon
5bddbdd914
tcp_output: faster return when nothing is to send (pcb->unsent == NULL)
2017-06-29 08:47:26 +02:00
goldsimon
48e55b1e5d
tcp_output: slightly move the jump target 'output_done': when nothing is to send, pcb->unsent cannot be NULL; add a
2017-06-29 08:43:59 +02:00
Joel Cunningham
229c9edad2
tcp: switch tcpflags_t to u16_t for all cases (bug #51326 )
...
This changes tcpflags_t to be a u16_t for all cases. The TCP Appropriate
Byte Count support added a new flag that used a bit past 8 and since this
flag is now required, tcpflags_t can no longer be a u8_t
This does not increase the size of struct tcp_pcb due to padding that
already existed (see bug #51326 for details)
Signed-off-by: goldsimon <goldsimon@gmx.de >
2017-06-28 21:47:33 +02:00
goldsimon
092c6c1f07
DNS_MAX_SOURCE_PORTS is PP-checked to be <= 255...
2017-06-26 08:48:17 +02:00
goldsimon
5efe26ebd3
Fix the fix for LWIP_LOOPBACK_MAX_PBUFS :-)
2017-06-26 08:21:53 +02:00
goldsimon
5b15234833
work on -Wconversion...
2017-06-25 23:01:57 +02:00
goldsimon
197166d906
LWIP_LOOPBACK_MAX_PBUFS: fix compilation or memory leak for LWIP_LOOPBACK_MAX_PBUFS > 255
2017-06-25 20:31:09 +02:00
goldsimon
af0f4d4020
Start making the source compile correctly with gcc -Wconversion enabled
2017-06-23 21:15:36 +02:00
Matthias Hofmann
c12aa3fb40
Remove double definition of SNTP_SERVER_DNS.
...
Signed-off-by: goldsimon <goldsimon@gmx.de >
2017-06-23 21:05:30 +02:00
Dirk Ziegelmeier
d02a73c285
Replace usages of tcpip_callback_with_block(foo, bar, 0) with tcpip_try_callback()
2017-06-22 08:14:02 +02:00
goldsimon
b4921dc401
Ensure that all parts of an ip_addr are written for the various set commands when setting an ipv4 address in dual-stack configurations (for security & compiler warning reasons :)
2017-06-22 07:48:38 +02:00
goldsimon
c9e7e56389
Fix IPv4-only and IPv6-only after again last commits
2017-06-21 22:01:19 +02:00
goldsimon
48213650cd
Try to make unit tests work without -Wno-address
2017-06-21 21:55:00 +02:00
goldsimon
c094fcc086
Try to make gcc work without -Wno-address
2017-06-21 16:07:36 +02:00
Dirk Ziegelmeier
10a5afeee7
Revert my last change to tcpip_callback() - it breaks the semantics of the function.
...
The function previously returned after posting a message, which is a short operation. Now it actually waits until the operation has completed - which may take a long time. This may break user programs. So all that remains is the cleanup separation in tcpip_callback() and tcpip_try_callback() :-(
2017-06-21 15:07:20 +02:00
Dirk Ziegelmeier
68d36f19f0
Implement LWIP core locking support in tcpip_callback_with_block()
...
Created two new functions for API cleanup:
tcpip_callback() that blocks until message is posted, cannot be called from IRQs.
tcpip_try_callback() that does not block and just tries to post a message. Can be called from IRQs.
Add compatibility #define tcpip_callback_with_block() that maps to these two functions according to "block" parameter.
2017-06-21 13:42:54 +02:00
goldsimon
79d69ce526
Slightly optimize pbuf_alloc: encode 'header offset' in 'enum pbuf_layer' instead of switch/case (which was duplicated in pbuf_alloc and pbuf_alloced_custom)
2017-06-21 13:37:05 +02:00
goldsimon
11da4ef024
Use ip_addr_debug_print_val instead of ip_addr_debug_print where applicable
2017-06-21 13:26:55 +02:00
Axel Lin
aa98747d6f
timeouts: Trivial comment fix for cyclic_timer
...
Signed-off-by: Axel Lin <axel.lin@ingics.com >
Signed-off-by: goldsimon <goldsimon@gmx.de >
2017-06-21 13:11:48 +02:00
Joel Cunningham
d4c8a1ac78
netconn: switch gethostbyname to use tcpip_send_msg_wait_sem (task #14523 )
...
This switches netconn_gethostbyname to use tcpip_send_msg_wait_sem to
take advantage of core locking support when enabled.
tcpip_send_msg_wait_sem handles blocking for the non-core locking case,
so we can remove the manual blocking in netconn_gethostbyname. For the
core locking case, we need to block if waiting on DNS callback. To
achieve this, we unlock the core and wait in lwip_netconn_do_gethostbyname.
This is the similar approach that netconn_write takes when it needs to
block to continue the write (see lwip_netconn_do_write)
This improves performance in the core locking case and is no change
for the non-core locking case
2017-06-20 17:52:28 -05:00
goldsimon
f13b1340f2
Refine comment changed by last commit
2017-06-20 20:53:39 +02:00
Jakub Schmidtke
112e370457
Sending TCP timestamp option in SYN packets
...
TCP timestamps were only sent if the remote side
requested it first. This enables the use of timestamps
for outgoing connections as well.
Signed-off-by: goldsimon <goldsimon@gmx.de >
2017-06-20 20:51:50 +02:00
Axel Lin
faf74b36a4
PPP, VJ: Use pbuf_take instead of duplicate copy code
...
Signed-off-by: Axel Lin <axel.lin@ingics.com >
Signed-off-by: goldsimon <goldsimon@gmx.de >
2017-06-20 20:26:01 +02:00
goldsimon
fc23257ca0
Fix unused arg from last patch the *real* lwIP way ;-)
2017-06-20 20:13:31 +02:00
Dirk Ziegelmeier
b92bcc5f02
Fix unused arg from last patch the lwIP way
2017-06-19 14:11:35 +02:00
Our Air Quality
6e62b6090b
Silence some unsed variable warnings.
2017-06-19 14:09:07 +02:00
Axel Lin
02aaf12f48
stats: Use proper format modifier in stats_display_mem/stats_display_sys
...
Use proper format modifier and remove unnecessary cast.
Signed-off-by: Axel Lin <axel.lin@ingics.com >
2017-06-19 14:07:31 +02:00
Dirk Ziegelmeier
c923d00340
Fix bug #51238 : LWIP_ARRAYSIZE() can't be used on lwip_cyclic_timers
...
Add const int variable containing number of array elements
2017-06-14 23:07:55 +02:00
goldsimon
7197bf25f0
Add another posix compatibility header
2017-06-14 23:05:30 +02:00
goldsimon
82b9f86b45
Fixed bug #51195 (Calling inet_pton() causes buffer overrun on a struct in6_addr)
2017-06-14 22:22:14 +02:00
Dirk Ziegelmeier
5a27e97baf
smtp.c: Fix detecting overlength server names
...
Thanks to Axel Lin
2017-06-14 22:06:37 +02:00
goldsimon
67d1970059
pbuf_alloced_custom(): less code duplication, please :-)
2017-06-14 21:39:53 +02:00
Dirk Ziegelmeier
3073affaaf
Axel Lin correctly pointed out that there is no buffer overflow because smtp_server[SMTP_MAX_SERVERNAME_LEN + 1] - there is always room for terminating 0 byte
2017-06-14 14:11:27 +02:00
Dirk Ziegelmeier
3611b583f5
smtp.c, smtp_set_server_addr: Avoid smtp_server buffer overrun when server name length is SMTP_MAX_SERVERNAME_LEN -> "smtp_server[len] = 0" is an out-of-bound access
2017-06-14 12:40:58 +02:00
Axel Lin
4af438916a
apps/smtp: Ensure smtp_server is NULL terminated
...
Ensure we set correct setting when changing smtp_server setting.
Signed-off-by: Axel Lin <axel.lin@ingics.com >
2017-06-14 12:33:57 +02:00
Dirk Ziegelmeier
d5cdb91611
Fix compile of Axel Lin's patch
2017-06-14 12:30:55 +02:00
Axel Lin
6b4cc984ad
pbuf: Allow pass flags to pbuf_init_alloced_pbuf()
...
Then we can reuse pbuf_init_alloced_pbuf() in pbuf_alloced_custom().
Signed-off-by: Axel Lin <axel.lin@ingics.com >
2017-06-14 12:28:29 +02:00
goldsimon
7b45f3fa3f
Fix sys_timeouts_init() for LWIP_TCP==0 (see patch #9375 )
2017-06-13 22:04:57 +02:00
Axel Lin
e1ce5dc491
mem: Move LWIP_DEBUGF out of critical section in mem_malloc
...
Signed-off-by: Axel Lin <axel.lin@ingics.com >
2017-06-13 22:02:17 +02:00
goldsimon
bab7a32eec
Remove smtp_server when passing NULL to smtp_set_server_addr() (see patch #9373 for discussion)
2017-06-13 22:00:48 +02:00
Axel Lin
117d3abdf8
apps/smtp: Make smtp_state_str/smtp_result_strs/base64_table static
...
These tables are only referenced in smtp.c, so make them static.
Signed-off-by: Axel Lin <axel.lin@ingics.com >
2017-06-13 21:57:03 +02:00
goldsimon
07cc25a9df
httpd: remove unnecessary "\0" suffix for CRLF string constant (see bug #51232 )
2017-06-13 21:53:35 +02:00
goldsimon
ef5e44b2d3
Fix bug #51230 (Fix comment line) - change tcp_pcb to altcp_pcb
2017-06-13 21:14:16 +02:00
goldsimon
a92e838687
httpd: include hooks header file so that redefined defines/functions can be defined there
2017-06-13 21:13:45 +02:00
goldsimon
35ba3a877d
Moved NUM_SOCKETS and struct lwip_sock to sockets_priv.h; added test case for fd_use count with select
2017-06-13 21:07:34 +02:00
goldsimon
85a85906d9
Fix bug #51122 (Mismatched socket->fd_used accounting when using lwip_select)
2017-06-13 20:58:45 +02:00
Joel Cunningham
3eaf976152
tcp: fix cwnd rollover introduced by ABC
...
Changes for TCP Appropriate Byte Counting introduce a potential cwnd
rollover by not taking into account integer promotion on tcpwnd_size_t
during inequality comparisions
This fixes the issue by introducing a macro TCP_WND_INC which detects
the rollover correctly and now holds the tcpwnd_size_t at the maximum
value rather than not incrementing the window. This provides a slight
performance improvement by allowing full use of the tcpwnd_size_t number
space for the congestion window
2017-06-01 12:34:57 -05:00
Dirk Ziegelmeier
0df2c4f2be
Map {tcp, udp, raw}_bind_netif() functions to netconn API
2017-05-31 20:16:21 +02:00
David Girault
dc2bdc2a21
memp: allow initialization of pool memory if not in standard section
2017-05-31 19:11:33 +02:00
Axel Lin
3aca7885a7
pbuf: Init pbuf if_idx to NETIF_NO_INDEX in pbuf_alloced_custom
...
Otherwise the p->pbuf.if_idx is uninitialized.
Signed-off-by: Axel Lin <axel.lin@ingics.com >
2017-05-31 19:10:00 +02:00
goldsimon
ba1cf2fa44
memp malloc: move LWIP_DEBUGF out of critical section (bug #51142 )
2017-05-30 11:39:42 +02:00
Tim Cussins
84502e5ae0
etharp.c: Ensure etharp_query() allocates adequate pbuf if copying/consolidating.
...
etharp_query() queues packets, instead of sending, if a relevant arp-request is
pending.
Code walks the packet (a pbuf chain) to determine whether any pbufs are marked
'volatile': If so, we cannot simply enqueue the packet, and instead allocate a
new pbuf from RAM, copying the original packet, and enqueueing this new pbuf.
The bug here is that the allocation refers to the tot_len field of a temp pbuf*,
'p', instead of the head, 'q'.
In the case where the first pbuf of the chain is non-volatile but the second pbuf
*is* volatile, then we'll request an allocation that uses the tot_len field of
the second pbuf. If the first pbuf is non-zero length, the allocated pbuf (chain)
will be too small to allow the copy.
Signed-off-by: goldsimon <goldsimon@gmx.de >
2017-05-29 21:48:51 +02:00
Our Air Quality
fb9fabb87c
Initialize the tcp listen pcb netif_idx to NETIF_NO_INDEX.
...
Signed-off-by: goldsimon <goldsimon@gmx.de >
2017-05-29 21:48:51 +02:00
Axel Lin
cbbfb1356c
pbuf: Make pbuf_init_alloced_pbuf take pbuf_type instead of u8_t for type parameter
...
All callers pass pbuf_type to pbuf_init_alloced_pbuf(), so make it take
pbuf_type instead of u8_t.
Signed-off-by: Axel Lin <axel.lin@ingics.com >
Signed-off-by: goldsimon <goldsimon@gmx.de >
2017-05-24 12:19:32 +02:00
goldsimon
356da76cc8
Work on bug #3031/task #7896 : change pbuf->type/enum pbuf_type to be more generic (see UPGRADING)
2017-05-22 22:30:55 +02:00
goldsimon
5c65402fd6
minor: whitespace change only to make the next diff smaller :-)
2017-05-22 22:30:19 +02:00
Axel Lin
10abb6b5ec
ethernetif: Add #if LWIP_IPV4 guard around netif->output
...
netif->output and etharp_output are only available when LWIP_IPV4=1.
Fix the skeleton file.
Signed-off-by: Axel Lin <axel.lin@ingics.com >
Signed-off-by: goldsimon <goldsimon@gmx.de >
2017-05-22 20:42:19 +02:00
goldsimon
8db0001e32
Adjust pbuf reuse documentation a bit: pbufs should never be reused after transmit
2017-05-18 09:19:08 +02:00
Axel Lin
5dd037ea49
debug: Remove superfluous #ifudef checking for LWIP_PLATFORM_ASSERT/LWIP_PLATFORM_DIAG
...
The lwip/arch.h already provides a default implentation of LWIP_PLATFORM_ASSERT
and LWIP_PLATFORM_DIAG.
So both LWIP_PLATFORM_ASSERT and LWIP_PLATFORM_DIAG are never undefined here.
Signed-off-by: Axel Lin <axel.lin@ingics.com >
2017-05-15 21:04:21 +02:00
goldsimon
0bbf6490f5
setsockopt: allow SO_BROADCAST for UDP sockets only
2017-05-12 20:34:16 +02:00
goldsimon
8345e9035f
gesockopt: fall-through in switch/case only if a case contains no code at all
2017-05-12 20:33:57 +02:00
goldsimon
5c35bab26c
getsockopt: invalid type used to check for UDP
2017-05-12 20:31:11 +02:00
goldsimon
e80b2eb4cf
Fix mdns_resp_del_service
2017-05-12 13:21:42 +02:00
David Girault
c8b7759e10
mdns: added support for removing service in mdns responder
...
New function `mdns_resp_del_service()` added.
Signed-off-by: goldsimon <goldsimon@gmx.de >
2017-05-12 13:12:22 +02:00
goldsimon
20fd844935
fixed typo in docs
2017-05-11 21:26:34 +02:00
Adrey Vinogradov
46f2e25ce0
Fixed bug #51002
...
Signed-off-by: goldsimon <goldsimon@gmx.de >
2017-05-11 20:51:41 +02:00
goldsimon
79bd47736c
SO_BROADCAST is valid for SOCK_DGRAM only
2017-05-11 20:48:57 +02:00
Axel Lin
9dee346000
apps/smtp: Fix memory leak in smtp_send_mail_alloced error paths
...
Call smtp_free_struct(s) in all smtp_send_mail_alloced error paths to ensure
no memory leak.
Signed-off-by: Axel Lin <axel.lin@ingics.com >
Signed-off-by: Dirk Ziegelmeier <dirk@ziegelmeier.net >
2017-05-11 10:47:20 +02:00
goldsimon
ec9096be40
fixed typo in httpd debug message
2017-05-10 13:41:26 +02:00
goldsimon
035bf4dcb0
Fixed bug #50992 : window updated too often
2017-05-10 13:40:17 +02:00
Axel Lin
ae210967f2
apps/smtp: Fix memory leak if SMTP_BODYDH_MALLOC fails
...
Need to free s before return error.
Signed-off-by: Axel Lin <axel.lin@ingics.com >
Signed-off-by: Dirk Ziegelmeier <dirk@ziegelmeier.net >
2017-05-10 11:25:34 +02:00
Axel Lin
5bbe190b3b
apps/smtp: Make smtp_send_bodyh_data takes "const char **from" parameter
...
Fixes below build error:
cc -g -Wall -DLWIP_DEBUG -pedantic -Werror -Wparentheses -Wsequence-point -Wswitch-default -Wextra -Wundef -Wshadow -Wpointer-arith -Wcast-qual -Wc++-compat -Wwrite-strings -Wold-style-definition -Wcast-align -Wmissing-prototypes -Wredundant-decls -Wnested-externs -Wno-address -Wunreachable-code -Wuninitialized -Wlogical-op -I. -I../../.. -I../../../../lwip/src/include -I../../../ports/unix/port/include -I../../../../mbedtls/include -Wno-redundant-decls -DLWIP_HAVE_MBEDTLS=1 -c ../../../../lwip/src/apps/smtp/smtp.c
../../../../lwip/src/apps/smtp/smtp.c: In function ‘smtp_send_body_data_handler’:
../../../../lwip/src/apps/smtp/smtp.c:1487:41: error: cast discards ‘const’ qualifier from pointer target type [-Werror=cast-qual]
if((res = smtp_send_bodyh_data(pcb, (char **)&s->body, &s->body_len))
^
../../../../lwip/src/apps/smtp/smtp.c:1507:47: error: cast discards ‘const’ qualifier from pointer target type [-Werror=cast-qual]
((res = smtp_send_bodyh_data(pcb, (char **)&s->body, &s->body_len)) == BDHALLDATASENT)
^
cc1: all warnings being treated as errors
../../Common.allports.mk:94: recipe for target 'smtp.o' failed
make: *** [smtp.o] Error 1
Signed-off-by: Axel Lin <axel.lin@ingics.com >
2017-05-10 08:43:07 +02:00
Axel Lin
f5f34f138c
apps/smtp: Fix missing altcp conversion in smtp_send_bodyh_data
...
The pcb is "struct altcp_pcb *" so we cannot call tcp_sndbuf/tcp_write here.
Use altcp_sndbuf/altcp_write instead.
Signed-off-by: Axel Lin <axel.lin@ingics.com >
Signed-off-by: Dirk Ziegelmeier <dirk@ziegelmeier.net >
2017-05-10 08:18:00 +02:00
Axel Lin
b9d5399ec1
apps/smtp: Trivial typo fixes
...
s/smpt/smtp/g
Signed-off-by: Axel Lin <axel.lin@ingics.com >
Signed-off-by: Dirk Ziegelmeier <dirk@ziegelmeier.net >
2017-05-10 08:06:49 +02:00
Joel Cunningham
c03fef9a3c
bug #50837 : add zero-window probe timeout
...
This commit adds a timeout to the zero-window probing (persist timer)
mechanism. LwIP has not historically had a timeout for the persist
timer, leading to unbounded blocking if connection drops during the
zero-window condition
This commit also adds two units test, one to check the RTO timeout
and a second to check the zero-window probe timeout
2017-05-09 09:01:03 -05:00
Axel Lin
d87b11e8f9
sockets: Remove unreachable break statements in event_callback
...
Signed-off-by: Axel Lin <axel.lin@ingics.com >
Signed-off-by: Dirk Ziegelmeier <dirk@ziegelmeier.net >
2017-05-09 11:25:59 +02:00
Sylvain Rochet
4171f39a72
PPP: remove ppp_singlebuf
...
We don't have to keep a helper function just for the sake of a PBUF_RAW
constant. Inline ppp_singlebuf function.
Signed-off-by: Sylvain Rochet <gradator@gradator.net >
2017-05-05 15:42:15 +02:00
Axel Lin
3e909bafa8
PPP: use pbuf_coalesce() instead of private ppp_singlebuf()
...
pbuf_coalesce() creates a single pbuf out of a chain of pbufs, which is
exactly what ppp_singlebuf() need.
Signed-off-by: Axel Lin <axel.lin@ingics.com >
Signed-off-by: Sylvain Rochet <gradator@gradator.net >
2017-05-05 15:36:26 +02:00
Dirk Ziegelmeier
a942582b4b
Minor #ifdef cleanup in netif.c
2017-05-05 11:11:19 +02:00
Axel Lin
89d825f603
netif: Fix IPv6-only build
...
Fix below build error if LWIP_IPV4 == 0.
cc -g -Wall -DLWIP_DEBUG -pedantic -Werror -Wparentheses -Wsequence-point -Wswitch-default -Wextra -Wundef -Wshadow -Wpointer-arith -Wcast-qual -Wc++-compat -Wwrite-strings -Wold-style-definition -Wcast-align -Wmissing-prototypes -Wredundant-decls -Wnested-externs -Wno-address -Wunreachable-code -Wuninitialized -Wlogical-op -I. -I../../.. -I../../../../lwip/src/include -I../../../ports/unix/port/include -I../../../../mbedtls/include -Wno-redundant-decls -DLWIP_HAVE_MBEDTLS=1 -c ../../../../lwip/src/core/netif.c
../../../../lwip/src/core/netif.c: In function ‘netif_add’:
../../../../lwip/src/core/netif.c:284:7: error: ‘ipaddr’ undeclared (first use in this function)
if (ipaddr == NULL) {
^~~~~~
../../../../lwip/src/core/netif.c:284:7: note: each undeclared identifier is reported only once for each function it appears in
../../../../lwip/src/core/netif.c:285:14: error: implicit declaration of function ‘ip_2_ip4’ [-Werror=implicit-function-declaration]
ipaddr = ip_2_ip4(IP4_ADDR_ANY);
^~~~~~~~
../../../../lwip/src/core/netif.c:285:5: error: nested extern declaration of ‘ip_2_ip4’ [-Werror=nested-externs]
ipaddr = ip_2_ip4(IP4_ADDR_ANY);
^~~~~~
../../../../lwip/src/core/netif.c:285:23: error: ‘IP4_ADDR_ANY’ undeclared (first use in this function)
ipaddr = ip_2_ip4(IP4_ADDR_ANY);
^~~~~~~~~~~~
../../../../lwip/src/core/netif.c:287:7: error: ‘netmask’ undeclared (first use in this function)
if (netmask == NULL) {
^~~~~~~
../../../../lwip/src/core/netif.c:290:7: error: ‘gw’ undeclared (first use in this function)
if (gw == NULL) {
^~
cc1: all warnings being treated as errors
../../Common.allports.mk:94: recipe for target 'netif.o' failed
make: *** [netif.o] Error 1
Fixes: 5967380c20 ("netif_add: avoid passing NULL pointers to subsequent functions")
Signed-off-by: Axel Lin <axel.lin@ingics.com >
Signed-off-by: Dirk Ziegelmeier <dirk@ziegelmeier.net >
2017-05-05 10:39:15 +02:00
goldsimon
749e078d36
6lowpan: fix compiling with !LWIP_UDP
2017-05-05 09:19:02 +02:00
Dirk Ziegelmeier
5967380c20
netif_add: avoid passing NULL pointers to subsequent functions (reported by Axel Lin)
2017-05-05 09:07:40 +02:00
Axel Lin
9bbb741247
tcp: Remove unreachable code in tcp_close_shutdown_fin
...
Signed-off-by: Axel Lin <axel.lin@ingics.com >
Signed-off-by: Dirk Ziegelmeier <dirk@ziegelmeier.net >
2017-05-05 08:58:09 +02:00
goldsimon
d36306e30b
sntp_process: fixed unused variable if sub-second time info is not used
2017-05-04 15:49:12 +02:00
Axel Lin
bf510fee51
SNMP: Cleanup unreachable code
...
Signed-off-by: Axel Lin <axel.lin@ingics.com >
Signed-off-by: Dirk Ziegelmeier <dirk@ziegelmeier.net >
2017-05-04 09:15:29 +02:00
Dirk Ziegelmeier
fe8c62e7b6
Fix bug #50932 : LWIP-provided byteorder functions defined in the wrong scope
...
Apply suggested fix from "Fayek"
2017-05-03 22:28:46 +02:00
goldsimon
72a8db7867
tcp_fasttmr: adapt comment (to delayed FIN implementation)
2017-05-03 21:42:59 +02:00
goldsimon
f00d7db409
backport of "variable assigned but not used" warnings from STM (why don't people report such things?)
2017-05-03 20:31:29 +02:00
goldsimon
eff97c04ef
backport of "unreachable code" warnings from STM (why don't people report such things?)
2017-05-03 20:30:38 +02:00
Dirk Ziegelmeier
6c236b047e
ip_route() can be called with IP_ANY_TYPE in src parameter, so remove code associated to that
2017-05-03 16:42:30 +02:00
Daniel Elstner
ccf10a5023
SNTP: Avoid warning if debugging is disabled
2017-05-03 16:40:11 +02:00
Joel Cunningham
ddf4e17411
tcp: indentation fix in tcp_receive()
...
TCP_OVERSIZE block was moved out from inside the while loop and thus
should be on column 7
2017-05-03 09:29:02 -05:00
goldsimon
4cf6f9ed51
tcp_free_acked_segments: fix debug printf parameter errors, fix unused parameters for !LWIP_DEBUG and/or LWIP_NOASSERT
2017-05-03 13:49:24 +02:00
goldsimon
778206798e
task #14433 : TCP: combine unsent/unacked queue loops in tcp_receive()
2017-05-03 12:32:01 +02:00
goldsimon
39316bb9de
httpd: fixed bug #50915 (HTTP_IS_DATA_VOLATILE was wrong for LWIP_HTTPD_DYNAMIC_FILE_READ==1)
2017-05-03 09:57:12 +02:00
goldsimon
b9c47c5089
tcp_route: add comment, fixed whitespace
2017-05-03 09:56:08 +02:00
goldsimon
5c0aab7bd5
udp SO_REUSE_RXTOALL: don't copy IP header in duplicated pbuf
2017-05-03 09:54:46 +02:00
Dirk Ziegelmeier
2b9a132772
Fix compile in tcp_route when IPv4 only is used and source-based routing is disabled
2017-05-03 09:09:37 +02:00
Dirk Ziegelmeier
d32492e953
Make patch 4 of David's Minix3 patches superfluous: Use PBUF_POOL to duplicate incoming packets in UDP
...
... which would have been the correct way to do it anyway :-)
http://git.minix3.org/index.cgi?p=minix.git;a=blob;f=minix/lib/liblwip/patches/0004-MINIX-3-only-avoid-large-contiguous-allocations.patch;h=f23143c7e8d372b3b35b599a97975d79924f73c1;hb=HEAD
2017-05-03 09:02:56 +02:00
goldsimon
7defe372b9
fixed compiling pbuf.c with LWIP_TCP==0
2017-05-03 09:02:06 +02:00
goldsimon
082fe71c0c
fixed compiling sockets.c with LWIP_UDP==0
2017-05-03 09:01:48 +02:00
Dirk Ziegelmeier
676dd74140
Minor cleanup and documentation updates
2017-05-03 08:51:00 +02:00
Dirk Ziegelmeier
e835707814
Cleanup and simplify tcp_connect() code
2017-05-03 08:46:06 +02:00
Dirk Ziegelmeier
5800cf51be
Work on task #14494 : Implement SO_BINDTODEVICE
...
TCP needs additional netif handling
2017-05-03 08:00:06 +02:00
Axel Lin
c144e5b1ec
pbuf_coalesce: Replace pbuf_alloc+pbuf_copy with pbuf_clone
...
Avoid duplicate the same implementation.
Signed-off-by: Axel Lin <axel.lin@ingics.com >
Signed-off-by: goldsimon <goldsimon@gmx.de >
2017-05-02 20:36:00 +02:00
Axel Lin
bc0fafdeca
udp: Fix compiling for IPv6-only build
...
Fix below build error when LWIP_IPV6 && !LWIP_IPV4:
cc -g -Wall -DLWIP_DEBUG -pedantic -Werror -Wparentheses -Wsequence-point -Wswitch-default -Wextra -Wundef -Wshadow -Wpointer-arith -Wcast-qual -Wc++-compat -Wwrite-strings -Wold-style-definition -Wcast-align -Wmissing-prototypes -Wredundant-decls -Wnested-externs -Wno-address -Wunreachable-code -Wuninitialized -Wlogical-op -I. -I../../.. -I../../../../lwip/src/include -I../../../ports/unix/port/include -I../../../../mbedtls/include -Wno-redundant-decls -DLWIP_HAVE_MBEDTLS=1 -c ../../../../lwip/src/core/udp.c
../../../../lwip/src/core/udp.c: In function ‘udp_input_local_match’:
../../../../lwip/src/core/udp.c:130:58: error: unused parameter ‘inp’ [-Werror=unused-parameter]
udp_input_local_match(struct udp_pcb *pcb, struct netif *inp, u8_t broadcast)
^~~
Fixes: 13ffc86aef ("Start working task #14494 : Implement SO_BINDTODEVICE")
Signed-off-by: Axel Lin <axel.lin@ingics.com >
Signed-off-by: Dirk Ziegelmeier <dirk@ziegelmeier.net >
2017-05-02 15:55:32 +02:00
Dirk Ziegelmeier
e3289116b9
Fix next build error introduced in my last commit
2017-05-02 15:21:52 +02:00
Dirk Ziegelmeier
6a754325dc
Fix build error introduced in my last commit
2017-05-02 14:53:18 +02:00
Dirk Ziegelmeier
c7e3519f46
Start working task #14494 : Implement SO_BINDTODEVICE
...
Implement setsockopt. TODO: getsockopt
2017-05-02 13:18:29 +02:00
Dirk Ziegelmeier
eab2ae5d78
Cleanup netif_name_to_index() implementation
2017-05-02 12:51:25 +02:00
goldsimon
0545eba002
Fixed copy&paste error found by travis-ci...
2017-05-02 10:42:59 +02:00
Dirk Ziegelmeier
13ffc86aef
Start working task #14494 : Implement SO_BINDTODEVICE
...
Implement binding TCP, UDP and RAW PCBs to a netif
2017-05-02 09:39:48 +02:00
Dirk Ziegelmeier
20fed63297
Add custom pbuf usage example to pbuf_alloced_custom() docs
2017-04-28 13:19:32 +02:00
Dirk Ziegelmeier
83d0607acf
Add PBUF_NEEDS_COPY macro to documentation
2017-04-27 19:25:19 +02:00
goldsimon
1add8c14ca
netif: tiny cleanup to last commit
2017-04-27 14:12:13 +02:00
goldsimon
975e29d76e
fixed copy&paste error :-)
2017-04-27 12:46:14 +02:00
Dirk Ziegelmeier
1aa24ee21b
Add new DHCP hooks to DHCP docs
2017-04-27 12:42:14 +02:00
Dirk Ziegelmeier
a09a8e4a06
Some documentation updates and fixes
...
Dedicated Zero-copy RX page
Fix doxygen warnings
2017-04-27 12:41:08 +02:00
goldsimon
6aac9377ee
Clean up LWIP_NETIF_HWADDRHINT a bit: create a struct holding the hint(s) and pass a pointer to that struct around. That way we are free to add more hints if required (e.g. see task #11620 )
2017-04-27 12:39:54 +02:00
goldsimon
7617a76b19
added unit test to allocate zero length pbufs
2017-04-26 20:16:27 +02:00
Axel Lin
4c9b316e6b
pbuf: Fix allocate zero length pbuf
...
Current code fails to allocate zero length pbuf (e.g. for PBUF_RAW PBUF_POOL),
fix it.
Fixes: eb269e61b5 ("First step to clean up pbuf implementation: add pbuf_alloc_reference() to allocate pbufs referencing external payload; move member initialization to common function; simplify PBUF_POOL chain allocator")
Signed-off-by: Axel Lin <axel.lin@ingics.com >
Signed-off-by: goldsimon <goldsimon@gmx.de >
2017-04-26 20:15:22 +02:00
Joel Cunningham
fc7a68b5af
sockets: fix CMSG alignment
...
This changes the CMSG alignment macros to ensure struct cmsghdr and data
are on a word (double word on 16-bit arch) aligned boundary
We need to ensure at least 32-bit alignment for 16-bit systems because
socklen_t could be 32-bit due to our definition
2017-04-26 08:39:44 -05:00
Dirk Ziegelmeier
c686261e1e
Minor whitespace cleanup in ip.h
2017-04-26 12:28:54 +02:00
goldsimon
728aaeb528
Try to fix alignment warnings in CMSG_NXTHDR()
2017-04-26 08:55:07 +02:00
goldsimon
eac45ca284
Try to fix alignment warnings when assigning CMSG_DATA() to some struct pointer
2017-04-26 08:43:56 +02:00
Joel Cunningham
0b6e2d9c15
Update changelog for features/bugs since 2.0.1
2017-04-25 17:40:11 -05:00
goldsimon
842a235a68
fix test_sockets_msgapi_cmsg unit test (msvc gives me "warning C4706: assignment within conditional expression")
2017-04-25 23:08:53 +02:00
goldsimon
eb269e61b5
First step to clean up pbuf implementation: add pbuf_alloc_reference() to allocate pbufs referencing external payload; move member initialization to common function; simplify PBUF_POOL chain allocator
2017-04-25 23:04:12 +02:00
goldsimon
e57552d401
pbuf_alloc_copy -> pbuf_clone
2017-04-25 22:02:07 +02:00
Joel Cunningham
3a01c32e55
test_sockets: fix pointer to integer conversion
...
This fixes a pointer to integer conversion in test_sockets_msgapi_cmsg()
This was identified by Travis CI: https://travis-ci.org/yarrick/lwip-merged/builds/225640702
2017-04-25 13:48:14 -05:00
goldsimon
836c0cf42e
added dhcp hooks to CHANGELOG
2017-04-25 20:20:13 +02:00
goldsimon
2fef874494
task #14270 : DHCP should support user-defined additional options: added two hooks for adding and parsing user defined DHCP options
2017-04-25 20:18:59 +02:00
Axel Lin
471daba011
tcp_out: Fix LWIP_NETIF_TX_SINGLE_PBUF guard for not executing phase 2
...
This fixes build error if LWIP_NETIF_TX_SINGLE_PBUF==1.
Fixes: dd811bca06 ("Fix bug #50694 (TX exist more pbufs after enable LWIP_NETIF_TX_SINGLE_PBUF) by not executing phase 2 for LWIP_NETIF_TX_SINGLE_PBUF==1")
Signed-off-by: Axel Lin <axel.lin@ingics.com >
2017-04-25 20:17:47 +02:00
Joel Cunningham
2f117add7a
sockets: task #14247 , add CMSG and IP_PKTINFO
...
This commit adds CMSG infrastructure (currently used with recvmsg) and
the IP_PKTINFO socket option.
In order to use IP_PKTINFO, set LWIP_NETBUF_RECVINFO to 1
Unit test is added to verify this feature
2017-04-25 09:44:03 -05:00
goldsimon
ca961b9bc2
minor whitespace cleanups only
2017-04-25 12:07:28 +02:00
goldsimon
d02bc6481f
Fixed bug #50816 (netif_add() prototype depends on configuration) by adding a new function netif_add_noaddrthat doesn't change
2017-04-25 12:05:05 +02:00
goldsimon
135d506065
minor whitespace fixes only
2017-04-25 12:03:52 +02:00
goldsimon
dd811bca06
Fix bug #50694 (TX exist more pbufs after enable LWIP_NETIF_TX_SINGLE_PBUF) by not executing phase 2 for LWIP_NETIF_TX_SINGLE_PBUF==1
2017-04-25 11:18:36 +02:00
goldsimon
4b68605276
Clarify LWIP_NETIF_TX_SINGLE_PBUF (drivers might still get chained pbufs and have to take care of that, e.g. by using pbuf_alloc_copy)
2017-04-25 10:09:32 +02:00
goldsimon
dcb2cb99a1
Added 'pbuf_alloc_copy' e.g. as a single function for use with non scatter-gather drivers
2017-04-25 10:08:31 +02:00
Dmitry
42eb98c9fc
Fix bugs in httpd with "LWIP_HTTPD_CUSTOM_FILES && LWIP_HTTPD_DYNAMIC_FILE_READ" when SSI tags (from '<' to '>' when they span from one read to the next or end at one read buffer) - bugs #50844 aqnd #50845
...
Signed-off-by: goldsimon <goldsimon@gmx.de >
2017-04-24 22:33:17 +02:00
goldsimon
9c6da979ca
fixed copy&paste error in last change to lwip_itoa()
2017-04-24 13:33:43 +02:00
goldsimon
16a71473c1
Better fix for bug #50838 (mem.c needs SYS_ARCH_PROTECTION around MEM_STATS): only lock where necessary
2017-04-24 12:23:05 +02:00
goldsimon
bd483fa229
Revert "Fixed bug #50838 (mem.c needs SYS_ARCH_PROTECTION around MEM_STATS)"
...
This reverts commit 3770adccfd .
2017-04-24 10:29:46 +02:00
Dirk Ziegelmeier
b71878f02e
Fix bug #50739 : 6lowpan - IPHC de-compression bug
...
Apply fix provided by Aigner B.
2017-04-21 22:30:23 +02:00
Dirk Ziegelmeier
13f51a0318
Fix bug #50824 : Bug in SNTP POLL mode
...
Ignore all broken packets
Stop timeouts only when correct packet is received
2017-04-21 22:10:52 +02:00
Joel Cunningham
ad779e5c9c
doc: clarify RST handling comment
...
This clarifies the documentation around RST handling to document
the approach follows RFC 5961 and is not a standards violation
2017-04-21 09:27:54 -05:00
goldsimon
f4730e78f8
sntp: use randomized startup delay ([0..5] seconds) by default (if LWIP_RAND is available)
2017-04-21 13:14:48 +02:00
goldsimon
65b8316459
sntp_opts.h: adapt comment to RFC errata
2017-04-21 13:14:03 +02:00
goldsimon
554f5d7f9e
sntp: fix SNTP_LI_* bits; fix todo comment
2017-04-21 13:13:56 +02:00
goldsimon
84461e90e2
mqtt: fix shadowing global 'dup'
2017-04-21 07:23:32 +02:00
goldsimon
a50ba9c748
sockets.c: try to fix debug print (again)
2017-04-20 23:03:49 +02:00
Joel Cunningham
de90d03e48
tcp: task #14128 - Appropriate Byte Counting support
...
This commit adds TCP Appropriate Byte Counting (ABC) support based on
RFC 3465
ABC replaces the previous congestion window growth mechanism and has been
configured with limit of 2 SMSS. See task #14128 for discussion on
defaults, but the goal is to mitigate the performance impact of delayed
ACKs on congestion window growth
This commit also introduces a mechanism to track when the stack is
undergoing a period following an RTO where data is being retransmitted.
Lastly, this adds a unit test to verify RTO period tracking and some
basic ABC cwnd checking
2017-04-20 15:59:24 -05:00
goldsimon
e1f2c8b30c
sockets.c: try to fix debug print
2017-04-20 22:55:56 +02:00
goldsimon
2358a5ac32
lwip_netconn_do_close_internal: 'close' -> 'shut_close': don't override global function names (why is this reported only now?)
2017-04-20 22:52:27 +02:00
goldsimon
2c767a1d60
fix standard conformance: some socket functions should return 'ssize_t', not 'int'
2017-04-20 22:44:23 +02:00
goldsimon
1ada106d61
netconn_tcp_recvd: take size_t, not u32_t
2017-04-20 22:34:12 +02:00
goldsimon
4d6b90727f
lwip_recvfrom: use LWIP_MIN instead of self-coded min
2017-04-20 22:07:08 +02:00
goldsimon
dbc969c139
Try to fix the socket API for sizeof(int) <= 2 by checking INT_MAX at 2 places
2017-04-20 22:06:36 +02:00
goldsimon
b93572dca8
Document struct netvector
2017-04-20 22:00:07 +02:00
goldsimon
131d656c23
lwip_itoa: check 'bufsize' instead of ignoring it; ensure code is not stolen from GPL
2017-04-20 21:57:03 +02:00
goldsimon
3770adccfd
Fixed bug #50838 (mem.c needs SYS_ARCH_PROTECTION around MEM_STATS)
2017-04-20 21:44:00 +02:00
Dirk Ziegelmeier
d54240bdea
One more try to fix compile without TCP
2017-04-19 08:44:05 +02:00
Dirk Ziegelmeier
302d84f5b2
Try to fix compile without TCP (reported by Axel Lin)
2017-04-19 08:18:15 +02:00
Dirk Ziegelmeier
32aa9a41e2
Apply patch from Kudratov Olimjon: Array index used before limits check
...
while ((q != NULL) && (options[offset] != DHCP_OPTION_END) && (offset < offset_max)) {
should be
while ((q != NULL) && (offset < offset_max) && (options[offset] != DHCP_OPTION_END)) {
See https://jira.reactos.org/browse/CORE-8978 for more info.
2017-04-19 06:35:07 +02:00
Tim Cussins
8e83e206f4
sockets.c: Make sock_inc_used overflow check robust.
...
Before this patch, it was possible that the overflow check might
miss an overflow event.
e.g. Consider 2 threads, both executing this method. u8_t fd_used is on 255...
Thread A -> atomically increment fd_used (which is now 0)
Thread B -> atomically increment fd_used (which is now 1)
Thread A -> check overflow... sees everything ok
Thread B -> check overflow... sees everything ok
And the overflow is missed :(
Signed-off-by: goldsimon <goldsimon@gmx.de >
2017-04-18 20:50:33 +02:00
Tim Cussins
7ac3056da9
sockets.c: Add missing lwip_select_dec_sockets_used within lwip_select.
...
Signed-off-by: goldsimon <goldsimon@gmx.de >
2017-04-18 20:50:33 +02:00
goldsimon
0952e618bd
netconn_drain(): use lwip_netconn_is_err_msg() on acceptmbox, too.
2017-04-18 10:54:40 +02:00
Axel Lin
0b2a652317
api_msg: Use lwip_netconn_is_err_msg instead of NULL test in netconn_drain()
...
The NULL test no longer work after commit e0a2472706 , it needs to test with
lwip_netconn_is_err_msg() instead.
Fixes: e0a2472706 ("netconn/sockets: remove fatal error handling, fix asynchronous error handling, ensure data before RST can be received")
Signed-off-by: Axel Lin <axel.lin@ingics.com >
2017-04-18 10:47:42 +02:00
Joel Cunningham
f28c1c851b
loopif: set pbuf if_idx during poll
...
This sets the pbuf's if_idx during the loopif poll function (the
equivalent netif input function). This was found during IP_PKTINFO
development where p->if_idx is read and was uninitialized
2017-04-15 11:31:38 -05:00
goldsimon
1e02f9e88b
add mqtt_test.c to test/unit/Filelists.mk
2017-04-12 22:05:53 +02:00
goldsimon
5cc168c0f1
added unit test for mqtt (that does not really do something useful yet)
2017-04-12 21:54:42 +02:00
goldsimon
bf01941b23
opt.h: provide LWIP_NUM_SYS_TIMEOUT_INTERNAL as default value for MEMP_NUM_SYS_TIMEOUT that can be extended by local lwipopts.h
2017-04-12 21:52:34 +02:00
goldsimon
dfc57f0289
mqtt: move struct mqtt_client_s and inner structs to new file mqtt_priv.h (to hide it from apps but provide it for tests)
2017-04-12 21:50:58 +02:00
goldsimon
5310d8f13c
event_callback: separated ++ from if
2017-04-12 12:40:50 +02:00
goldsimon
e0a2472706
netconn/sockets: remove fatal error handling, fix asynchronous error handling, ensure data before RST can be received
2017-04-12 12:37:16 +02:00
goldsimon
064044eeae
sockets: speed up event_callback: don't iterate select_cb_list for NETCONN_EVT_RCVPLUS/SENDPLUS if the socket has been readable/writable before already
2017-04-12 09:12:55 +02:00
goldsimon
58c21eb13c
sockets: speed up event_callback: don't iterate select_cb_list for NETCONN_EVT_RCVMINUS/SENDMINUS
2017-04-11 20:59:00 +02:00
goldsimon
b6fdb61654
sockets.c: refactor event_callback() a bit
2017-04-11 20:55:47 +02:00
goldsimon
b0af09ec45
select_cb_ctr no needed any more for LWIP_TCPIP_CORE_LOCKING==1
2017-04-11 12:50:25 +02:00
goldsimon
7b477b32b8
let unit test sys_arch check that a mutex is not taken recursively
2017-04-11 12:43:33 +02:00
goldsimon
92997756d1
task #14420 (Remove sys_sem_signal from inside SYS_ARCH_PROTECT crit section) done for LWIP_TCPIP_CORE_LOCKING==1
2017-04-11 12:40:44 +02:00
goldsimon
26d3466f50
Add macro ETH_ADDR() to initialize a struct eth_addr with its 6 bytes and taking care of correct braces
2017-04-11 08:49:15 +02:00
Dirk Ziegelmeier
8695e6e6cb
Fixup BRIDGEIF_INITDATA2 macro
2017-04-07 08:59:26 +02:00
Dirk Ziegelmeier
7ba5cc3d52
Improve bridgeif doxygen docs
2017-04-07 08:01:38 +02:00
Joel Cunningham
557a11047d
Patch #9307 : Replace mem_malloc+memset with mem_calloc
...
Aside from reducing source code, on systems which use MEM_LIBC_MALLOC,
this has the potential to improve performance depending on the underlying
memory allocator
See http://stackoverflow.com/questions/2688466/why-mallocmemset-is-slower-than-calloc
2017-04-05 14:53:24 -05:00
goldsimon
b34f2d5605
altcp: allocate altcp_pcbs from a pool, not from heap (new option MEMP_NUM_ALTCP_PCB defaults to MEMP_NUM_TCP_PCB)
2017-04-05 12:18:48 +02:00
Dirk Ziegelmeier
0f4ad57033
Fix build error in bridgeif.c
2017-04-05 08:11:37 +02:00
goldsimon
9c78909857
bridgeif: sanity-check init_data->max_ports <= BRIDGEIF_MAX_PORTS
2017-04-04 22:12:38 +02:00
goldsimon
77df9ccd5a
bridgeif: fix that max_fdb_static_entries was used to init dynamic FDB
2017-04-04 22:09:31 +02:00
goldsimon
2a30fedbea
fix passing NULL to netif_set_gw & netif_set_netmask (or netif_set_addr or netif_add) (broken on 18.03.2017 by 2d9ef2215b)
2017-04-04 22:08:37 +02:00
goldsimon
97f4033a8a
bridgeif: improve documentation
2017-04-04 21:54:52 +02:00
goldsimon
8ed2bd4771
bridgeif: gracefully handle out-of-memory in bridgeif_fdb_init
2017-04-04 21:54:30 +02:00
goldsimon
e65a0950b2
mem_calloc: check for mem_size_t overflow when multiplying 2 mem_size_t input values
2017-04-04 21:52:01 +02:00
Joel Cunningham
6fe66771cb
test_tcp: de-duplicate test IP addresses, netmask, and ports
...
This creates a single version of test IP addresses, netmasks, and ports.
All tests were using the same values, but duplicated in each test
This also adds const to some functions so we can use a const version
of addresses
2017-03-31 12:01:43 -05:00
Joel Cunningham
648b2b6f2b
test_tcp: remove unnecessary memsets
...
test_tcp_init_netif() memsets both netif and txcounters, so no need to manually do it
2017-03-31 11:59:12 -05:00
Joel Cunningham
34c9e30225
test_tcp: de-duplicate seqno checking defines
...
This commit moves common defines and senqo array so they can be
re-used in mulptiple places for sequence number checking rather
than duplicated
Currently they are used in two places, but I'm anticipating needing
them in future TCP unit tests
2017-03-31 11:57:33 -05:00
Dirk Ziegelmeier
6559ffd848
Fix C++ style comment in altcp_tls_mbedtls.c
2017-03-31 13:05:04 +02:00
goldsimon
33466ee6a8
dhcp_parse_reply: return ERR_VAL instead of asserting on offset-out-of-pbuf
2017-03-30 22:30:27 +02:00
goldsimon
1c57c84200
vj_uncompress_uncomp: copy from/to bigger buffers (used for checks before) instead of cs->cs_ip and ip; just to help static code analysis to see this is correct ;-)
2017-03-30 21:54:42 +02:00
goldsimon
aa0601a66d
snmp_asn1_dec_tlv: explicitly check 'length_bytes > pbuf_stream->length' (for clarity, even if it would fail in pbuf_stream later)
2017-03-30 21:31:44 +02:00
goldsimon
3aa854409a
pbuf_copy_partial: remove double-check of 'buf' and 'dataptr'
2017-03-30 21:29:53 +02:00
goldsimon
4313bf2a74
altcp_tls_mbedtls: fix TX when lower write returns ERR_MEM
2017-03-30 14:55:37 +02:00
goldsimon
51dbd1a7c0
altcp: added altcp_get_port()
2017-03-30 14:19:31 +02:00
Dirk Ziegelmeier
4a7569fc2d
SNMP traps: Fix ignored return values
2017-03-30 13:01:10 +02:00
Dirk Ziegelmeier
132c285fd4
SNMP. Fix several ignored return values
2017-03-30 12:50:32 +02:00
Dirk Ziegelmeier
2673e635a3
Fix community string length copying - correctly handle long strings
2017-03-30 11:09:35 +02:00
Dirk Ziegelmeier
8d149e63a6
SNMP: strcpy -> strncpy, strlen -> strnlen
2017-03-30 08:57:53 +02:00
Joel Cunningham
c722261142
tcp: bug #50614 : move unsent queue check/pcb->snd_buf update
...
This commit corrects what looks like an ancient incorrect organization
of the logic for processing an ACK which acks new data. Once moved,
we can also change to using TCP_SEQ_LEQ on ackno instead of TCP_BETWEEN
because ackno has already been checked against snd_nxt
The work of checking the unsent queue and updating pcb->snd_buf (both
steps required for new data ACK) should be located under the conditional
that checks TCP_SEQ_BETWEEN(ackno, pcb->lastack+1, pcb->snd_nxt)
The comment following the unsent queue check/pcb->snd_buf update even
indicates "End of ACK for new data processing" when the logic is clearly
outside of this check
From what I can tell, this mis-organization isn't causing any incorrect
behavior since the unsent queue checked that ackno was between start of
segment and snd_nxt and recv_acked would be 0 during pcb->snd_buf update.
Instead this is waisted work for duplicate ACKS (can be common) and other
old ACKs
2017-03-29 16:24:54 -05:00
goldsimon
720f9b3a0b
fix compiling altcp_tls_mbedtls sources/headers if mbedtls is not available
2017-03-29 23:02:16 +02:00
goldsimon
856b49a057
lwip_sendmsg: fix check for unsupported flags
2017-03-29 22:38:16 +02:00
goldsimon
5d600f72d2
bridgeif_input: check netif != NULL before calling netif_get_client_data()
2017-03-29 22:27:00 +02:00
goldsimon
ca9f57c09f
lwip_fcntl/F_GETFL: no need to check sock->conn != NULL: already checked by get_socket()
2017-03-29 22:26:34 +02:00
goldsimon
5b6c654dd1
make F_GETFL return file access mode for !CORE_LOCKING as well
2017-03-29 20:54:24 +02:00
Joan Lledó
172dab1289
lwip_fcntl() returns access modes
2017-03-29 20:46:30 +02:00
Dirk Ziegelmeier
33e3ee0790
Clarify LWIP_ALTCP_TLS usage a bit
2017-03-29 08:52:19 +02:00
Dirk Ziegelmeier
8fd90ea136
improve mqtt documentation
2017-03-29 08:43:27 +02:00
Dirk Ziegelmeier
fbcdb4d9f1
Fix function name in altcp.c
2017-03-29 08:22:35 +02:00
Dirk Ziegelmeier
2ca717e18d
altcp_tls.h: Document ARM mbedtls port
2017-03-28 21:34:00 +02:00
Dirk Ziegelmeier
40df1474cc
SNMP: Advertise SNMPv3 support
2017-03-28 21:33:37 +02:00
Dirk Ziegelmeier
3266511ebb
Improve documentation, add TLS stuff
2017-03-28 21:25:49 +02:00
Dirk Ziegelmeier
9b6192bd65
Create smtp_opts.h and add SMTP client to doxygen docs
2017-03-28 21:14:56 +02:00
Dirk Ziegelmeier
f7ac739022
Correct a few header #include guards
2017-03-28 20:44:39 +02:00
Dirk Ziegelmeier
b9dffc5e4b
Filelists.mk: Move all mbedtls related files to own section
2017-03-28 20:42:21 +02:00
Dirk Ziegelmeier
3826bcceab
Move SMTP from contrib to main lwIP rep - with TLS support, it becomes useful again
2017-03-28 20:40:47 +02:00
Dirk Ziegelmeier
38651b8069
Cleanup #include structure of altcp_tls a bit
...
(as discussed with Simon today)
2017-03-28 20:31:25 +02:00
goldsimon
b09b3fa4e6
altcp_tcp: some more debug checks
2017-03-28 16:20:20 +02:00
goldsimon
898d3832a7
more fixes for !LWIP_ALTCP: move mqtt client struct definitions to mqtt.c
2017-03-28 14:12:22 +02:00
goldsimon
537c258efa
httpd/altcp: add forgotten functions
2017-03-28 14:04:40 +02:00
Dirk Ziegelmeier
7599706808
One more try to fix mqtt.c
2017-03-28 12:30:26 +02:00
Dirk Ziegelmeier
1c5237b6c4
Try to fix build of mqtt after ALTCP_TLS changes
2017-03-28 11:48:01 +02:00
goldsimon
8b6b270287
mqtt: clean up struct prototypes a bit
2017-03-28 09:20:59 +02:00
goldsimon
8673610f3f
mqtt: add TLS support
2017-03-28 09:19:32 +02:00
goldsimon
26a6e034fc
mqtt: convert to altcp API
2017-03-28 09:14:35 +02:00
goldsimon
1dfe916808
altcp_tcp: use 'void* state' to store tcp_pcb, not 'altcp_pcb* inner_conn'
2017-03-28 09:09:13 +02:00
goldsimon
881ab3011e
mqtt: pass client_user/client_pass to server if != NULL
2017-03-27 22:25:26 +02:00
goldsimon
ca43e64d35
minor: fixed typo in doc
2017-03-27 12:23:02 +02:00
Daniel Elstner
751ee7a534
SNTP: Implement round-trip delay compensation
...
Introduce a new configuration define SNTP_COMP_ROUNDTRIP to compensate
for network round-trip delays when setting the system clock from SNTP.
Note that this feature requires compiler support for 64-bit arithmetic.
2017-03-27 10:43:03 +02:00
Daniel Elstner
cc77b308a4
SNTP: Unify timestamp extraction from response packet
...
Avoid piecemeal invocation of pbuf_copy_partial() for each SNTP header
field. The new code may sometimes copy more than necessary, but the
complexity is reduced.
2017-03-27 10:43:02 +02:00
Daniel Elstner
2fa9cd8530
SNTP: Streamline timestamp handling
...
Generalize the NTP timestamp conversion arithmetic, and provide hooks
for using native NTP timestamps when setting or getting the system
clock time. Convert microseconds to a fraction as needed when getting
the system time.
2017-03-27 10:43:01 +02:00
Daniel Elstner
9323ad3211
arch: Optionally support 64-bit integers
2017-03-27 10:43:00 +02:00
goldsimon
596bddac47
altcp: added raw tcp fallback for altcp_get_ip() #if !LWIP_ALTCP
2017-03-26 22:29:18 +02:00
goldsimon
425b2dda61
altcp_get_ip: added altcp_get_ip(), added default functions that only defer a call to the inner_conn (moved from tls_mbedtls to generic altcp)
2017-03-26 22:26:40 +02:00
goldsimon
1ab89ed5e6
bridgeif: fixed IPv6-only build
2017-03-26 20:52:05 +02:00
goldsimon
6add16e36b
altcp_tls_mbedtls: fixed memory leak introduced by delayed deallocation
2017-03-25 20:35:46 +01:00
goldsimon
0581a77731
Prepare altcp_tls_mbedtls for TLS clients (not fully tested yet)
2017-03-24 15:25:43 +01:00
goldsimon
540b527cf4
remove LWIP_RANDOMIZE_INITIAL_LOCAL_PORTS config option (this is implicitly done via #ifdef LWIP_RAND)
2017-03-24 14:29:06 +01:00
goldsimon
a2bc02d682
altcp_tls_mbedtls: improve sent/recved handling
2017-03-23 22:04:36 +01:00
goldsimon
1ddb125e2c
altcp_tls_mbedtls_mem: fix compiling for sizeof(mem_size_t) < sizeof(size_t)
2017-03-23 12:15:54 +01:00
goldsimon
d71653f049
sockets.c: fix compiling in release mode
2017-03-23 10:44:28 +01:00
Dirk Ziegelmeier
819224f0e5
Fix bug #50618 : dhcp_remove_struct() macro does not work
...
Patch by Benjamin Silvestre
2017-03-23 09:52:13 +01:00
goldsimon
a49e040072
sockets: remove select_cb definitions #if !LWIP_SOCKET_SELECT
2017-03-23 08:34:56 +01:00
goldsimon
5149141790
altcp_tls: remove declarations #if !LWIP_ALTCP_TLS
2017-03-23 08:34:36 +01:00
goldsimon
1e26652d2e
renamed altcp_mbedtls files to altcp_tls_mbedtls
2017-03-23 08:34:02 +01:00
Dirk Ziegelmeier
ab736a4764
Add altcp to doxygen docs
2017-03-22 23:32:32 +01:00
Dirk Ziegelmeier
7e12240af3
Improve TCP documentation a bit
2017-03-22 23:32:17 +01:00
Dirk Ziegelmeier
d04dc46ccb
Add altcp_tls to Filelists.mk
...
Some compile fixes in altcp_mbedtls.c
2017-03-22 23:09:48 +01:00
Dirk Ziegelmeier
060a47f88a
Add altcp to Filelists.mk
...
Some compile fixes in altcp_tcp.c and httpd.c
2017-03-22 22:57:50 +01:00
Mikhail Lappo
f7d215043c
Possible null-pointer dereference
...
In unit test if_fail check for nullptr
is always located after dereferencing this
null pointer. This patch introduces correct
order: first check, then use
2017-03-22 22:51:08 +01:00
Mikhail Lappo
7eba14cb76
Possible null-pointer dereference
...
The value should be dereferenced after
assertion is performed. This can lead
to crash
2017-03-22 22:50:16 +01:00
Mikhail Lappo
08cb949aea
Fread return value unused
...
Assert that fread was able to read
specified amount of chunks
2017-03-22 22:47:15 +01:00
goldsimon
8360054884
sanity check hdr_buf size
2017-03-22 22:46:49 +01:00
Mikhail Lappo
89b6fa479e
Possible out of bound exception
...
hdr_buf has size of 4096. Makes sense to assert that
we do not exceed this size before copying there
2017-03-22 22:45:06 +01:00
goldsimon
d386374449
httpd: add support for https
2017-03-22 22:42:09 +01:00
goldsimon
afaa7d9561
httpd: prepare for https: move initialization code to shared function
2017-03-22 22:41:24 +01:00
goldsimon
2f3b00efb4
httpd: convert to altcp API (a simple search & replace...)
2017-03-22 22:33:50 +01:00
goldsimon
967d4fc3b0
LWIP_ALTCP: default to off for maximum backwards compatibility...
2017-03-22 22:33:23 +01:00
goldsimon
c18393b52b
altcp: added 'addrinfo' and 'tcp_state' functions
2017-03-22 22:29:11 +01:00
goldsimon
a46664eab2
Add opts header for altcp_tls
2017-03-22 21:40:32 +01:00
goldsimon
82d9e45f74
Add protoypes for TLS connections for the new altcp API + an implementation doing HTTPS (server mode for now) with mbedTLS (ATTENTION: this might not be coded secure enough for productive use yet!)
2017-03-22 21:33:05 +01:00
goldsimon
e8e247f22e
Add "application layered TCP connection API (altcp)"
...
altcp is an abstraction layer that prevents applications linking against the
tcp.h functions but provides the same functionality. It is used to e.g. add
SSL/TLS or proxy-connect support to an application written for the tcp callback
API without that application knowing the protocol details.
Applications written against the altcp API are directly linked against the
tcp callback API for LWIP_ALTCP==0, but then cannot use layered protocols.
2017-03-22 21:31:14 +01:00
goldsimon
d58457de43
tcp: move some higher level definitions from tcp.h to new file tcpbase.h (in preparation for altcp API)
2017-03-22 21:15:46 +01:00
goldsimon
ee5021deb1
tftp_server: fix bogus comment lines in file header
2017-03-22 21:14:36 +01:00
goldsimon
ba20cd229e
api_msg:accept_function(): fix typo
2017-03-22 21:12:09 +01:00
Mikhail Lappo
eba1b971c0
Possible null-pointer dereference
...
In assertion the pointer that is potentialy
null is dereferenced. The check for null was
located after.
2017-03-22 15:50:34 +01:00
Dirk Ziegelmeier
9e20fe2cfb
Apply [patch #9287 ] Possible null-pointer dereference from Mikhail Lappo in a modified way
...
Moved the debug output to a location where we know that newpcb != NULL
Fixes possible NULL pointer dereferencing in debug message output
2017-03-22 14:58:13 +01:00
goldsimon
c3912e35f6
httpd: regenerate example fs (fsdata.c) with current makefsdata
2017-03-21 13:06:26 +01:00
goldsimon
ec24a2a4e8
Revert "httpd: regenerate example fs (fsdata.c) with current makefsdata"
...
This reverts commit 66fb52ff5c .
2017-03-21 12:57:56 +01:00
goldsimon
66fb52ff5c
httpd: regenerate example fs (fsdata.c) with current makefsdata
2017-03-20 22:19:54 +01:00
goldsimon
d11292505b
httpd: use capital 'T' for content types, add more content types, provide the possibility to add more content types at compile time (HTTPD_ADDITIONAL_CONTENT_TYPES)
2017-03-20 22:19:05 +01:00
Dirk Ziegelmeier
2d9ef2215b
Fix bug #50576 : LWIP_NSC_IPV4_GATEWAY/NETMASK/SETTINGS_CHANGED should check if the setting is actually being changed
2017-03-18 15:30:20 +01:00
goldsimon
972b7c2bfd
sys_arch unit tests: refine test_sys_arch_waiting_fn a bit
2017-03-18 10:22:44 +01:00
Joel Cunningham
81e4726607
test_socket: conditional compile buffer trailer code
...
This code is marked as dead when BUF_SZ is a multiple of 4 (current
situation with unit tests)
This hopefully fixes a -Wunreachable-code failure found by Travis CI
2017-03-17 17:12:12 -05:00
Joel Cunningham
0a5a18e703
test_socket: add sendmsg/recvmsg TCP test
...
This migrates the sendmsg TCP test from socket examples (task #14408 )
to socket unit tests
Additionally, this adds support for testing recvmsg, creating a TCP
test for both sendmsg/recvmsg (referred to as msgapi test)
This also makes a small change to msgapi UDP to clear the receive
buffer after verifying the previous datagram
2017-03-17 16:47:44 -05:00
Joel Cunningham
551d76eadd
test_sockets: move loopback addr logic to utility function
...
This moves the loopback address creation logic to a utility function
so it can be shared with forth coming message API TCP test
2017-03-17 14:52:05 -05:00
Joel Cunningham
4c78ec7931
test_socket: replace {0} with memset
...
Using {0} broke Travis CI even though this should be correct for
initializing struct msghdr (see example in Linxu man pages:
http://man7.org/linux/man-pages/man3/cmsg.3.html )
Just use memset for now which is the common approach in LwIP codebase
2017-03-17 14:44:47 -05:00
Joel Cunningham
02e957de1e
test_socket: convert sendmsg test to use recvmsg
...
This converts the sendmsg test to use recvmsg for receiving, thus
exercising both sendmsg and recvmsg in a single test
This also adjusts the test naming to communicate all message APIs
(sendmsg/recvmsg) are being tested
2017-03-17 14:19:26 -05:00
goldsimon
aef2accfa3
try to satisfy clang's '-Wempty-body'
2017-03-17 11:22:30 +01:00
goldsimon
dffb75c5fa
test_sockets: fix warning about unused variable "addr_size"
2017-03-17 11:03:49 +01:00
Dirk Ziegelmeier
59fba75cd8
Update doxygen version to 2.0.3 as in init.h
2017-03-17 09:55:04 +01:00
goldsimon
aa129f35a2
hopefully fix building unit tests on linux/clang
2017-03-17 09:29:06 +01:00
goldsimon
e1d818bb5f
sockets unit tests: removed commented-out test code :-/
2017-03-17 09:26:58 +01:00
goldsimon
b0444a63b0
tried to fix sockets unit tests; fix configuration to run with any NO_SYS setting and with/without IPv6 (IPv4 is required)
2017-03-17 09:05:36 +01:00
goldsimon
a42d1678eb
tcp unit tests: don't break later tests relying on loopif
2017-03-17 08:56:03 +01:00
goldsimon
3fd8440ab9
memp.h: added missing include
2017-03-17 08:55:10 +01:00
goldsimon
d9a738d85f
sockets: fix lwip_getsockname/lwip_getpeername for dual-stack: ip_addr_t type "any" (dual) has to be converted to AF_INET6
2017-03-17 08:54:51 +01:00
Joel Cunningham
53fcd50870
task #14408 : move sendmsg UDP to unit tests
...
This commit moves the sendmsg UDP test from socket examples to socket
unit tests
The test has been converted to send/receive on the loopback interface
and also test a connected sendmsg with NULL msg_name
2017-03-16 19:27:26 -05:00
goldsimon
d820fb2f8d
Try to add a Filelists.mk file for the unit tests (to fix unix build of unit tests)
2017-03-16 22:54:50 +01:00
goldsimon
fc47f846ed
Fix and improve sockets unit test and unit test sys_arch (with a little help of tcpip.c)
2017-03-16 22:49:38 +01:00
goldsimon
8313c4d870
tried to add basic socket unit tests (nonsense only for now); made LOCK_TCPIP_CORE()/UNLOCK_TCPIP_CORE() overridable for that
2017-03-16 21:52:30 +01:00
goldsimon
2d8e17aa89
sockets: guard declaration of 'lwip_select()' with LWIP_SOCKET_SELECT==1
2017-03-16 09:18:53 +01:00
goldsimon
e71dbec587
bridgeif: fix compiling with NO_SYS==1 by changing default value of BRIDGEIF_PORT_NETIFS_OUTPUT_DIRECT
2017-03-16 09:18:28 +01:00
Dirk Ziegelmeier
b9a40a5163
Fix coding style NO_SYS example code
2017-03-15 20:16:52 +01:00
Dirk Ziegelmeier
da0714d7cb
Fix starting DHCP in NO_SYS example code
2017-03-15 20:09:39 +01:00
Dirk Ziegelmeier
d9b279d150
Cleanup documentation a bit: rename "Addons" to "NETIFs" - its a more appropriate name
2017-03-15 20:03:55 +01:00
Dirk Ziegelmeier
6328da87aa
Add bridge interface to documentation
2017-03-15 19:58:32 +01:00
goldsimon
2dcf31d6b1
bridgeif: better separation between bridgeif and fdb (todo: move fdb to contrib?), tried to fix the build for LWIP_NUM_NETIF_CLIENT_DATA==0
2017-03-15 16:50:55 +01:00
goldsimon
946b231516
lwip_init(): at least IAR warns about "LWIP_UNUSED_ARG(a)" accessing an uninitialized variable... Try to fix this by initializing it (it will be optimized away anyway)
2017-03-15 16:47:59 +01:00
goldsimon
51a07661cc
Added a simple multi-netif 802.1d bridge implementation to show that a multi-port netif works (see task #14369 )
2017-03-15 12:31:12 +01:00
Dirk Ziegelmeier
1f1f2e1c46
Try to fix line endings of tftp_server.c in git rep
2017-03-14 09:12:25 +01:00
goldsimon
754e49643f
set version to 2.0.3.dev now that 2.0.2 is released
2017-03-14 09:06:06 +01:00
goldsimon
eb1aadb218
implement udp/raw recvmsg() by moving recvfrom() into a common function taking an array of iovecs... (IP_PKTINFO/in_pktinfo still missing)
2017-03-13 22:31:17 +01:00
Dirk Ziegelmeier
59973c96e4
Fix bug #50534 : TFTP server does not copy terminating null of filename
...
Patch by David Rodgers
2017-03-13 21:26:06 +01:00
goldsimon
cb1a271c61
lwip_recvmsg: MSG_PEEK must be limited to the first iov for TCP
2017-03-11 20:42:59 +01:00
goldsimon
15918d8971
mdns.txt: changed the LWIP_MDNS_STRNCASECMP text again to reflect the fact that there are 2 names for 1 function...
2017-03-11 20:35:58 +01:00
Dirk Ziegelmeier
1371400c2b
mdns_domain_add_label_base should be static
2017-03-11 10:41:47 +01:00
goldsimon
681951c175
mdns.txt: LWIP_MDNS_STRNCASECMP -> lwip_strnicmp
2017-03-10 23:03:45 +01:00
goldsimon
7bcb4eafec
mdns: minor(?) stack usage and performance improvement by letting mdns_readname_loop() copy from pbuf to struct (instead of pbuf->buffer->struct)
2017-03-10 23:00:46 +01:00
goldsimon
5752b24d38
fix bug #50503 : LWIP_NETCONN_FULLDUPLEX: some LWIP_ERROR paths don't call done_socket()
2017-03-10 11:52:59 +01:00
Joel Cunningham
8bf402fd67
Fix unit test with assumed congestion avoidance
...
test_tcp_fast_rexmit_wraparound correctness relied on the congestion
window being in congestion avoidance so that only a single TCP_MSS
segment is sent upon ACKing the first segment.
It's not known whether the test was relying tcp_alloc() to set ssthresh
to 0 and thus start in congestion avoidance or if the test was working by
accident until changes in b90a54f989
This fixes the test by enforcing the requirement of starting in
congestion avoidance
Signed-off-by: goldsimon <goldsimon@gmx.de >
2017-03-10 08:12:17 +01:00
goldsimon
1b14c2e7b0
sockets: fix printf warning in gcc
2017-03-10 07:56:14 +01:00
goldsimon
2c77560870
My first try at 'recvmsg()', TCP only, for now...
2017-03-09 21:49:55 +01:00
goldsimon
e9e9ec23b8
tcp unit tests: fixed that tcp_teardown() could lead to accessing a netif pointer that is not valid any more (netif added in test function stored on stack)
2017-03-09 20:23:16 +01:00
goldsimon
7ffe5bfb3c
tcp: watch out for pcb->nrtx overflows and tcp_backoff indexing overflow
2017-03-09 13:29:41 +01:00
David van Moolenbroek
5827c168c2
tcp: do not keep sending SYNs when getting ACKs
...
If a locally generated TCP SYN packet is replied to with an ACK
packet, lwIP immediately sends a RST packet followed by resending the
SYN packet. This is expected, but on loopback interfaces the resent
SYN packet may immediately get another ACK reply, typically when the
other endpoint is in TIME_WAIT state (which ignores the RSTs). The
result is an endless loop of SYN, ACK, RST packets.
This patch applies the normal SYN retransmission limit in this
scenario, such that the endless loop is limited to a brief storm.
2017-03-09 13:22:49 +01:00
Joel Cunningham
b90a54f989
bug #50476 : initialize ssthresh to TCP_SND_BUF
...
This commit changes ssthresh to be the largest effective congestion
window (amount of in-flight data). This follows the guidance of RFC
5681 which recommends setting ssthresh arbitrarily high.
LwIP was previously using the receive window value at the end of the
3-way handshake and in the case of an active open where the receiver
used window scaling and/or window auto-tuning, this resulted in a very
small ssthresh value even though the window ramped up once the connection
was established
2017-03-08 16:36:35 -06:00
Joel Cunningham
fd9ac30062
Fix dual-stack build failure in lwip_sendmsg
...
This corrects a typo introduced in c9d0192b4a
that broke the build for dual-stack (IPv4 and IPv6)
2017-03-08 16:34:49 -06:00
Sylvain Rochet
e16d10ade6
PPP: remove unused and confusing return values other than ERR_OK for ppp_connect and ppp_listen
...
User should not use ppp_connect or ppp_listen return value to retry
later, it must wait for the callback to be called. This is primarily
done this way to have a consistent behavior with and without the
holdoff feature.
Remove returned error value from PPP link level API connect and listen
callbacks because we are not using them anymore, then make ppp_connect
or ppp_listen to always return ERR_OK, thus we are not breaking the PPP
user API.
We don't need the return code here, all PPP link level drivers can't
fail at all (e.g. PPPoS) or retry if necessary (PPPoE and PPPoL2TP).
2017-03-08 22:17:40 +01:00
goldsimon
aff1935e40
arch.h: include <limits.h> if it exists (at least INT_MAX is used)
2017-03-08 20:30:48 +01:00
goldsimon
c9efb7a72c
added missing define for MSG_NOSIGNAL
2017-03-08 19:57:10 +01:00
goldsimon
c797222407
lwip_sendmsg: implement EMSGSIZE checks
2017-03-07 21:48:59 +01:00
goldsimon
c9d0192b4a
lwip_sendmsg: small performance improvement: netbuf can be allocated on the stack as it is used internally only (see lwip_sendto)
2017-03-07 21:43:23 +01:00
goldsimon
270fdfff07
netconn_write_vectors_partly() watch out for overflow of data to send (must fit into INT_MAX for sockets)
2017-03-07 21:30:03 +01:00
goldsimon
4dd378b126
socket sendto: gracefully handle 'size' not fitting into an u16_t (return EMSGSIZE error) see task #14378
2017-03-07 20:56:37 +01:00
goldsimon
5c33efe430
minor: indentation fix
2017-03-07 20:37:52 +01:00
goldsimon
194803a3a7
netbuf: correctly reset netbuf checksum for LWIP_CHECKSUM_ON_COPY==1
2017-03-07 20:37:06 +01:00
goldsimon
c6c693923e
One more try to fix the build...
2017-03-07 09:45:01 +01:00
goldsimon
53f717338b
sockets: fixed printf format (not reported by mingw port due to -Wno-format)
2017-03-07 08:59:26 +01:00
goldsimon
b71d4477ea
socket tcp performance tweak: handle window update (call into tcpipi_thread) only once per recv for multi-segment receives
2017-03-06 22:22:22 +01:00
goldsimon
f0bc2fa968
netconn_tcp_recvd should take u32_t, not u16_t (as used in msg)
2017-03-06 22:20:41 +01:00
goldsimon
f02119af62
lwip_recvfrom: fix tcp socket error handling
2017-03-06 22:13:58 +01:00
goldsimon
04bff63f49
sockets: netconn event callback is only used for select (nonblocking sockets are now implemented at netconn layer) -> add option LWIP_SOCKET_SELECT to reflect this
2017-03-06 22:06:53 +01:00
goldsimon
c77a7fe824
lwip_recv_tcp: fix full-duplex: remove invalid calls to done_socket()
2017-03-06 22:03:02 +01:00
goldsimon
30be7b582e
sockets: remove sock->lastoffset and free unused pbufs instead (using pbuf_free_header)
2017-03-06 21:54:50 +01:00
goldsimon
49414826af
pbuf: added new function pbuf_free_header() to gradually hide bytes and free pbufs from the front of a pbuf chain
2017-03-06 21:53:48 +01:00
goldsimon
c295717ce7
sockets: clean up all the if/else in lwip_recvfrom and use new nonblocking features in netconn API: I'm OK with code duplication if it gets more readable :-/
2017-03-06 21:50:42 +01:00
goldsimon
1945582c10
netconn: added receive flag NETCONN_NOAUTORCVD and netconn_tcp_recvd() to delay rx window updates (e.g. when receiving more data as performance improvement)
2017-03-06 21:33:35 +01:00
goldsimon
b86787c39c
Improve code readability by moving tcp-specific functionality from netconn_recv_data() to new static function netconn_recv_data_tcp() since all tcp code paths are different anyway
2017-03-06 21:27:33 +01:00
Dirk Ziegelmeier
e15e504217
Some minor SNMPv3 related cleanups
2017-03-06 09:38:58 +01:00
Joel Cunningham
dd4ded3978
do_writemore: fix blocking bug
...
A bug was introduced in the atomic vector feature for blocking netconns
where if we couldn't write the entire vector due to send buffer being
full (write_more is 0), we would not update the vector state and then
when sent_tcp() is called, it would actually re-send the previous vector
and if additional calls were required to finish the write, msg.w.offset
would eventually exceed msg.w.len, This was found by testing "stats"
from the shell and hitting the LWIP_ASSERT in do_writemore() that
checks offset < len
The fix simply updates the vector state after every ERR_OK return from
tcp_write(). While not all cases (non-blocking sockets) need to update
the state in this case, it keeps the logic simple and also makes
debugging simpler because you don't have stale vector state at any
point
2017-03-04 12:34:44 -06:00
Dirk Ziegelmeier
02be2f8f42
Move snmpv3_dummy.* from main lwIP rep to contrib
2017-03-03 13:42:37 +01:00
Dirk Ziegelmeier
9719c52e62
SNMPv3: Missed two locations where the new enums can be used
2017-03-03 13:21:22 +01:00
Dirk Ziegelmeier
c961ac70b6
Fixump snmp/snmpv3_dummy.h copyright header
2017-03-03 13:17:06 +01:00
Dirk Ziegelmeier
6f485cc870
snmp/snmpv3_dummy.c: Set default configuration in snmpv3_dummy_init()
...
(Note: snmpv3_dummy.* will be moved to lwip-contrib soon)
2017-03-03 13:12:47 +01:00
Dirk Ziegelmeier
461f1fe1a9
More SNMPv3 cleanups: Create own header snmpv3_dummy.h and move functions in there
...
Decouple snmp_netconn.c from snmpv3_dummy.c (snmpv3_enginetime_timer)
Make SNMP API more type-safe using enums
2017-03-03 13:01:04 +01:00
Dirk Ziegelmeier
ecb3867803
SNMPv3: Rename tcpip_enginetime_timer to snmpv3_enginetime_timer
2017-03-03 12:32:22 +01:00
Dirk Ziegelmeier
927990d94e
One enum icmp_te_type member is not in doxygen docs - fix it.
2017-03-03 09:56:27 +01:00
Joel Cunningham
2980f7cc58
Vectorize netconn_write for TCP
...
This commit adds support to the netconn write APIs to take an input of
vectors instead of a single data pointer
This allows vectors sent on a TCP connection via sendmsg to be treated
atomically. The set of vectors is segmented into as much data as can
fit into the send buffer and then the TCP output function is called
Previously, each vector was passed to netconn_write_partly and tcp_write
segmented it into its own packet, which was then it was sent via
tcp_output (if not Nagleing)
This commit adds vector support to lwip_netconn_do_writemore() which
is the meat of the TCP write functionality from netconn/sockets layer.
A new netconn API netconn_write_vectors_partly() takes a set of vectors
as input and hooks up to do_writemore()
This commit also defines IOV_MAX because we are limited to only
supporting 65535 vectors due to choice of u16_t for the vector count
2017-03-02 16:52:14 -06:00
goldsimon
3feb748fee
Simplify lwip_accept() and lwip_ioctl() by relying on nonblocking netconn functions instead of sock->rcvevent
2017-03-02 20:47:02 +01:00
goldsimon
5c3bb19923
added nonblocking accept/recv to netconn API (task #14396 ) (also added netconn_recv_udp_raw_netbuf_flags() and netconn_recv_tcp_pbuf_flags() to pass socket-like flags to nonblock for one call only)
2017-03-02 20:38:11 +01:00
Dirk Ziegelmeier
593b211d1b
A few more SNMPv3 cleanups
2017-03-02 11:20:02 +01:00
goldsimon
1b3aaef525
lwip_sendmsg/tcp: prevent PSH until all iovecs are enqueued
2017-03-02 09:27:32 +01:00
Dirk Ziegelmeier
3fa3bf0570
Undo accidental activation of SNMPv3 code in my last commit
2017-03-02 07:50:34 +01:00
Dirk Ziegelmeier
0065cd915f
Several Win32 compile fixes in SNMP code
2017-03-02 07:49:42 +01:00
Dirk Ziegelmeier
83de16678c
SNMP: TABs -> spaces
2017-03-02 07:33:18 +01:00
goldsimon
05a595f745
httpd: LWIP_HTTPD_POST_MANUAL_WND: fixed double-free when httpd_post_data_recved is called nested from httpd_post_receive_data() (bug #50424 )
2017-03-01 22:08:05 +01:00
goldsimon
5f0fbdcde9
fixed warning about potentially unused variable 'netif' after changing ip4/6_input_accept to return in, not netif*
2017-03-01 21:46:36 +01:00
Dirk Ziegelmeier
ea41480232
Replace several C++ style comments by C-style
2017-03-01 21:25:03 +01:00
Dirk Ziegelmeier
4ef21e2597
Fix compile when SNMPv3 is disabled
2017-03-01 20:39:39 +01:00
Dirk Ziegelmeier
78cdbff1b3
Several compile fixes for Marco's patch
2017-03-01 20:39:39 +01:00
Dirk Ziegelmeier
576a8228c2
Add new files to Filelists.ml
2017-03-01 20:39:39 +01:00
Dirk Ziegelmeier
fef7ce3c0d
Some whitespace fixes to Marco's patches
2017-03-01 20:39:39 +01:00
Marco
f0605a510f
Modified the snmpv3_dummy implementation to be more functional.
...
The dummy implementation also implements the user table as a reference.
2017-03-01 20:39:39 +01:00
Marco
3b8bb580e4
Add framework MIB and USM mib if SNMPv3 is enabled.
2017-03-01 20:39:39 +01:00
Marco
4b97f2bb8e
Implemented usm mib.
2017-03-01 20:39:39 +01:00
Marco
46df850cb9
Implemented framework mib.
2017-03-01 20:39:39 +01:00
Marco
f8f3cc039a
Start a timer for enginetime handling.
...
This timer function should be implemented in the snmpv3_xxx.c file.
2017-03-01 20:39:39 +01:00
Marco
f092d09121
Added handling invalid packets in SNMPv3.
2017-03-01 20:39:39 +01:00
Marco
78806001e5
Made accepted SNMP version runtime configurable.
...
This feature can be disabled by setting LWIP_SNMP_CONFIGURE_VERSIONS to 0.
2017-03-01 20:39:39 +01:00
Marco
8fd09d4608
Added missing context specific tags.
2017-03-01 20:39:39 +01:00
Marco
ec044e826e
Replaced old LWIP_SNMPV3_GET_ENGINE_BOOTS macro.
...
Replaced old LWIP_SNMPV3_GET_ENGINE_BOOTS macro with the new snmpv3_get_engine_boots_internal function.
2017-03-01 20:39:39 +01:00
goldsimon
a9bfe7b72f
Fix compiling httpd for LWIP_HTTPD_SUPPORT_POST==1 (assigning int to u16_t)
2017-03-01 20:32:13 +01:00
goldsimon
0d585d55d3
Added LWIP_SINGLE_NETIF for small targets with only one netif (see task #13515 , there might be more optimizations to come with this option)
2017-03-01 16:10:50 +01:00
goldsimon
f978a7ed31
let ip4/6_input_accept return int instead of netif*
2017-03-01 14:16:27 +01:00
goldsimon
18c7c5d81c
fixed my last commit (NETIF_FOREACH does not yet exist :)
2017-03-01 14:12:50 +01:00
goldsimon
7c9a6317b9
refactor ip4/ip6 packet-to-netif matching to remove the ugly 'first' flag
2017-03-01 14:09:18 +01:00
Dirk Ziegelmeier
ec4f00179d
Fix bug #50242 : dhcp_release does not stop autoip (in coop mode)
...
Create new function dhcp_release_and_stop() that stops DHCP statemachine and sends release message if needed. Also stops AUTOIP if in coop mode.
Old dhcp_release() and dhcp_stop() function internally call dhcp_release_and_stop() now.
2017-03-01 13:18:37 +01:00
Dirk Ziegelmeier
d8135f9ae2
Fix bug #50427 : SNMP: ifIndex should use netif_get_index()
...
We have netif_get_index(netif) now
2017-03-01 12:34:47 +01:00
goldsimon
1741edf159
make tcp apps depend on LWIP_CALLBACK_API, too
2017-02-28 12:19:16 +01:00
goldsimon
f85eed0ab3
tcp: fixed bug #50418 : LWIP_EVENT_API: fix invalid calbacks for SYN_RCVD pcb
2017-02-28 12:13:26 +01:00
David van Moolenbroek
d3fc398580
arp/ndp: allow overriding the decision to copy pbufs
...
lwIP aims to support zero-copy TX, and thus, must internally handle
all cases that pbufs are referenced rather than copied upon low-level
output. However, in the current situation, the arp/ndp packet queuing
routines conservatively copy entire packets, even when unnecessary in
cases where lwIP is used in a zero-copy compliant manner. This patch
moves the decision whether to copy into a centralized macro, allowing
zero-copy compliant applications to override the macro to avoid the
unnecessary copies. The macro defaults to the safe behavior, though.
2017-02-28 09:37:21 +01:00
Dirk Ziegelmeier
27c835aa56
Remove netif_invoke_ext_callback() from doxygen docs, it is intended for internal use only
2017-02-27 09:36:33 +01:00
Dirk Ziegelmeier
e4b356f08c
Add netif extended callback to doxygen docs
2017-02-26 09:56:16 +01:00
Dirk Ziegelmeier
01f9a04e4a
Add pbuf_get_contiguous() to doxygen docs
2017-02-26 09:44:16 +01:00
Dirk Ziegelmeier
9ab2eefc37
Fix documentation in sockets.c
2017-02-26 09:42:06 +01:00
Dirk Ziegelmeier
08931b33c1
Fix documentation on pbuf_get_contiguous()
2017-02-25 17:03:14 +01:00
Joel Cunningham
36b9a45c3b
netconn_write_partly cleanups
...
This commit changes netconn_write_partly to use msg.w.offset to set
bytes_written for both blocking and non-blocking connections
This is correct because msg.w.offset is the canonical output from
the do_write call and in the case that not all bytes were written,
(a bug?) returning the full size to the caller is dangerous
Lastly, this commit adds an assert for the blocking case to sanity
check that all the bytes we requested were written. This will help
catch bugs in do_write
2017-02-24 15:50:28 -06:00
Joel Cunningham
36fa1a97d4
lwip_netconn_do_writemore() cleanups
...
This commit makes a couple of cleanups discussed in patch #8882 :
1) msg.w.offset should not be set to 0 in the error case. It is
only valid when err == ERR_OK
2) Remove out-of-date comment which indicated the entire write had
completed (not true for non-blocking write)
This also updates the documentation on offset to include that offset
is only valid when err == ERR_OK
2017-02-24 15:42:07 -06:00
goldsimon
0da9cf70ea
Added pbuf_get_contiguous() to get data in one piece (either zero copy from pbuf or memcpied into a supplied buffer)
2017-02-24 21:36:49 +01:00
goldsimon
a38e937dd6
fixed close race conditions in lwip_select (for LWIP_NETCONN_FULLDUPLEX)
2017-02-24 21:29:29 +01:00
goldsimon
f4d13d52d3
fixed get_socket, fixed LWIP_SOCKET_OFFSET != 0
2017-02-24 21:23:53 +01:00
goldsimon
8bb43e7388
Added a few missing calls to done_socket()
2017-02-24 21:11:20 +01:00
goldsimon
6786c9f143
Start working on bug #44032 : added sock->fd_used that is != 0 when at least one thread is using a socket
2017-02-24 21:00:01 +01:00
goldsimon
9afe10e23d
make get_socket use tryget_socket, added tryget_socket_unconn in preparation of properly fixing bug #44032
2017-02-24 20:49:18 +01:00
goldsimon
f1f6050ad7
minor: comment, whitespace
2017-02-24 19:50:53 +01:00
goldsimon
d73e225519
lwip_select: check for correct 'maxfdp1' parameter range
2017-02-24 19:50:14 +01:00
goldsimon
3107d4a0fa
fixed that select ignored invalid/not open sockets in the fd_sets (bug #50392 )
2017-02-24 19:48:59 +01:00
goldsimon
01cc06bcb8
netif_add: ensure netif->num is unique even if more than 255 netifs have been added/removed since system startup (e.g. by ppp)
2017-02-23 20:41:54 +01:00
goldsimon
76763c9bcd
pbuf_ref: assert-check for 'ref' overflow
2017-02-23 20:16:51 +01:00
Dirk Ziegelmeier
e94e2da3ec
opt.h: Set LWIP_PBUF_REF_T back to u8_t, s8_t has no advantage any more after reverting last commit
2017-02-23 18:10:00 +01:00
Dirk Ziegelmeier
2cf3bbddd4
pbuf_free: Use correct type LWIP_PBUF_REF_T for local variable
2017-02-23 18:08:26 +01:00
Dirk Ziegelmeier
0f6d8ccd90
Revert "Improve pbuf refcount underflow check by checking the local variable on the stack that was assigned in a protected region"
...
This reverts commit 62c44138da .
Didn't notice due to local changes the ASSERTION was already inside the locks...
2017-02-23 18:04:30 +01:00
Dirk Ziegelmeier
62c44138da
Improve pbuf refcount underflow check by checking the local variable on the stack that was assigned in a protected region
...
The old code was vulnerable to race conditions since it checked ref to be >0 without locks
2017-02-23 16:55:14 +01:00
Dirk Ziegelmeier
0a7734cf64
Preparation for task #14369 : Define ways to work with a netif having multiple ports
...
Let ethernet_input() fill in pbuf's if_idx (if not already set by driver or an L2 bridge)
2017-02-23 16:36:40 +01:00
Dirk Ziegelmeier
0eeb10d4bb
Preparation for task #14369 : Define ways to work with a netif having multiple ports
...
Add if_idx member to struct pbuf
2017-02-23 16:34:28 +01:00
Dirk Ziegelmeier
2e1b12d09f
Make pbuf refcount type an LWIP option and #define it to s8_t (to be able to check for underflow!)
2017-02-23 15:47:44 +01:00
goldsimon
5c55978f10
Revert "Added LWIP_SOCKERR_T to adapt the size of sock->err to what is needed."
...
Let's stay with the standard and accept the 4-bytes-per-socket memory increase...
This reverts commit 5d6c9ce77b .
2017-02-20 13:29:33 +01:00
goldsimon
5d6c9ce77b
Added LWIP_SOCKERR_T to adapt the size of sock->err to what is needed.
2017-02-20 12:55:18 +01:00
goldsimon
d1049511cc
post-fixups for patch #9262 : fix SO_ERROR, fix !LWIP_TCPIP_CORE_LOCKING
2017-02-20 12:43:45 +01:00
Joan Lledó
703a22fae5
Support for 32bit errno codes
2017-02-20 12:37:29 +01:00
sg
ff3fe1f489
Fixed bug #50231 (nd6: several option size related issues in Router Advertisement message processing)
2017-02-17 21:59:08 +01:00
Joel Cunningham
4c76fd500c
Move write_offset from struct netconn to struct api_msg
...
This moves the write_offset variable from struct netconn to struct api_msg
This optimizes the storage by only having the space claimed when it is
needed (during a netconn_write_partly() call) and not throughout the
lifetime of the netconn
This also reduces code space/execution by not having to separately manage
clearing/checking write_offset from the current_msg pointer
Lastly, we also save execution by using msg.w.offset as the output
rather than marshaling the result to msg.w.len. Previously, len was used
as input length of dataptr and output for the write operation.
netconn_write_partly() also has access to msg.w.offset, so we can use
that
2017-02-17 13:26:16 -06:00
goldsimon
deaa6e9406
Improved DNS_LOCAL_HOSTLIST interface (bug #50325 )
2017-02-17 10:08:49 +01:00
goldsimon
19d63e6aa0
Fix portable initialization of non-dynamic DNS_LOCAL_HOSTLIST
2017-02-17 09:25:31 +01:00
sg
6dca664217
LWIP_NETCONN_FULLDUPLEX: fixed shutdown during write (bug #50274 )
2017-02-16 22:09:02 +01:00
Dirk Ziegelmeier
d7b51b5906
MDNS: Fix accessing wrong union member in netif ext callback
2017-02-15 14:38:57 +01:00
Dirk Ziegelmeier
3c9e05a6d9
Minor: Fix documentation in netif.h
2017-02-15 14:38:34 +01:00
Dirk Ziegelmeier
498913b982
Third draft of task #14283 : Add more detailed status callback
...
Implement Joel's idea of a union
2017-02-15 10:14:06 +01:00
Dirk Ziegelmeier
35e148e26d
MDNS: Use new netif callback, now does not need mdns_resp_netif_settings_changed() calls from user any more when LWIP_NETIF_EXT_STATUS_CALLBACK is enabled
2017-02-14 21:03:49 +01:00
Dirk Ziegelmeier
454927151d
Continue working on ext netif callback
...
Docs, better callback points (e.g. before netif is set down)
2017-02-14 21:02:38 +01:00
Dirk Ziegelmeier
d46d8bcda2
Add some asserts to netif callback functions
2017-02-14 20:35:48 +01:00
Dirk Ziegelmeier
4434762a08
Some minor documentation fixes
2017-02-14 20:28:43 +01:00
Dirk Ziegelmeier
bbedb35bf3
Fix name clash between typedef and struct definition.
...
Interesting, all three compilers in Erik Ekman's travis-ci don't complain. But my gcc at home does...
2017-02-14 20:17:27 +01:00
Dirk Ziegelmeier
f4f204b850
Implement a better way to initialize all fields in ip address than using memset() (better fix than my last commit)
2017-02-14 14:20:39 +01:00
Dirk Ziegelmeier
feba38a1f4
Fix unportable struct initializer I introcduced while working on task #14283 : Add more detailed status callback
2017-02-14 13:54:14 +01:00
Dirk Ziegelmeier
1b2c8974b8
Forgot to adapt #define in my last commit
2017-02-14 11:00:34 +01:00
Dirk Ziegelmeier
8025b85694
Second draft of task #14283 : Add more detailed status callback
2017-02-14 10:59:28 +01:00
Joel Cunningham
b2beb42c14
Remove forward declaration of struct lwip_sock
...
The forward declaration was added in commit
e2c2afbbe0 for use in struct
lwip_setgetsockopt_data, but became dead after commit
5d2e93e5f0 where the sock pointer was
removed from lwip_setgetsockopt_data
2017-02-13 17:22:52 -06:00
Dirk Ziegelmeier
7dd21e93c4
Fix my last commits (unused variable warning)
...
my gcc at home did not show this warning...
2017-02-13 22:27:59 +01:00
Dirk Ziegelmeier
3c1713406e
Work on task #14283 : Add more detailed status callback
...
Cleanups and IPv6 address status
2017-02-13 21:52:55 +01:00
Dirk Ziegelmeier
58c48af58f
Start working on task #14283 : Add more detailed status callback
...
IPv6 stuff is not implemented
2017-02-13 21:40:08 +01:00
Joel Cunningham
0b257f71e7
Fix comment typo from bug #47485
...
tcp_close_shutdown_impl() should be tcp_close_shutdown_fin()
2017-02-13 11:25:05 -06:00
Dirk Ziegelmeier
45f3c28eb2
Fix netif_find() function for many netifs (should use atoi) and move it to the bottom of the file where similar functions are located
2017-02-13 13:35:30 +01:00
Dirk Ziegelmeier
400c41ffd9
Also base netif_index_to_name function on netif_get_by_index
2017-02-13 13:26:54 +01:00
Dirk Ziegelmeier
d4d8fd819d
Some code cleanup related to netif index handling
...
Made the macro "netif_index_to_num" private, if someone needs it externally, please complain.
2017-02-13 13:21:45 +01:00
Dirk Ziegelmeier
32954e9d4f
Fix comment in my previous commit
2017-02-13 13:00:10 +01:00
Dirk Ziegelmeier
c01096097c
Move struct ip4_addr2 and corresponding copy macros from ip4_addr.h to prot/etharp.h where they belong
...
Also rename struct not to clash with IP4_ADDR2 macro definition, and rework copy macros to contain a source/dest direction
2017-02-13 12:34:38 +01:00
goldsimon
44068e3109
minor: mark variable "unused" after assigning it
2017-02-13 11:43:56 +01:00
goldsimon
693a74c286
For tiny targtes, LWIP_RAND is optional -> fix compile time checks
2017-02-13 11:43:25 +01:00
Dirk Ziegelmeier
06c84cb110
My documentation changes forced the usage of rand() function, which is not desired
...
By default, the code that does NOT need LWIP_RAND() is active now
2017-02-13 10:38:18 +01:00
Dirk Ziegelmeier
de05424ff6
Fix build in IPv4 only case when source based routing is disabled
2017-02-10 22:52:43 +01:00
Dirk Ziegelmeier
def87c0c23
Add David's IPv6 multicast work to CHANGELOG
2017-02-10 22:42:14 +01:00
David van Moolenbroek
6ce9a01c3e
raw: add core support for multicast TX options
...
The patch simply copies the relevant bits from the UDP implementation.
Perhaps most notably, the patch does *not* copy the IPv4-only UDP
support for IP_MULTICAST_IF, because that option can also be
implemented using the interface index based approach. Largely thanks
to this omission, at least on 32-bit platforms, this patch does not
increase the RAW PCB size at all.
2017-02-10 22:37:35 +01:00
David van Moolenbroek
ab8119360e
udp: add core-level multicast support for IPv6
...
So far, the UDP core module implemented only IPv4 multicast support.
This patch extends the module with the features necessary for socket
layers on top to implement IPv6 multicast support as well:
o If a UDP PCB is bound to an IPv6 multicast address, a unicast source
address is selected and used to send the packet instead, as is
required (and was the case for IPv4 multicast already).
o Unlike IPv4's IP_MULTICAST_IF socket option, which takes a source
IPv4 address, the IPV6_MULTICAST_IF socket option (from RFC 3493)
takes an interface identifier to denote the interface to use for
outgoing multicast-destined packets. A new pair of UDP PCB API
calls, udp_[gs]et_multicast_netif_index(), are added to support
this. The new definition "NETIF_NO_INDEX" may be used to indicate
that lwIP should pick an interface instead.
IPv4 socket implementations may now also choose to map the given
source address to an interface index immediately and use the new
facility instead of the old udp_[gs]et_multicast_netif_addr() one.
A side effect of limiting the old facility to IPv4 is that for dual-
stack configurations with multicast support, the UDP PCB size is
reduced by (up to) 16 bytes.
o For configurations that enable loopback interface support, the IPv6
code now also supports multicast loopback (IPV6_MULTICAST_LOOP).
o The LWIP_MULTICAST_TX_OPTIONS opt.h setting now covers both IPv4
and IPv6, and as such is no longer strictly linked to IGMP. It is
therefore placed in its own lwIP options subgroup in opt.h.
The IPV6_MULTICAST_HOPS socket option can already be implemented using
the existing IP_MULTICAST_TTL support, and thus requires no additional
changes. Overall, this patch should not break any existing code.
2017-02-10 22:37:29 +01:00
sg
4a9db56f4c
Tiny speed/size improvement: don't check netconn_type twice on socket-receive
2017-02-10 22:01:21 +01:00
sg
a3fc38037a
minor: move assert to a slightly better place
2017-02-10 21:30:07 +01:00
David van Moolenbroek
240cf62056
tcp: fix accept event on closed listening PCBs
...
If LWIP_CALLBACK_API is not defined, but TCP_LISTEN_BACKLOG is, then
the LWIP_EVENT_ACCEPT TCP event may be triggered for closed listening
sockets. This case is just as disastrous for the event API as it is
for the callback API, as there is no way for the event hook to tell
whether the listening PCB is still around. Add the same protection
against this case for TCP_LISTEN_BACKLOG as was already in place for
LWIP_CALLBACK_API.
Also remove one NULL check for LWIP_CALLBACK_API that had already
become redundant for all callers, making the TCP_EVENT_ACCEPT code
for that callback wrapper more in line with the rest of the wrappers.
2017-02-10 21:28:18 +01:00
sg
b9e66bfcfb
Provide a better way to include system's <errno.h> for errno + error numbers (LWIP_ERRNO_INCLUDE can't be defined to <errno.h> at least on GCC/linux)
2017-02-10 21:18:08 +01:00
Dirk Ziegelmeier
239498f37c
Implement task #14367 : Hooks need a better place to be defined
...
We now have a #define for a header file name that is #included in every .c file that provides hooks.
2017-02-10 13:25:04 +01:00
goldsimon
bc07fd9db5
Fixed bug #47485 (tcp_close() should not fail on memory error) by retrying to send FIN from tcp_fasttmr
2017-02-10 09:42:38 +01:00
Joel Cunningham
82711e069c
socket_priv.h: add newline at EOF
2017-02-09 23:17:01 -06:00
Joel Cunningham
2cab253b34
Minor if_api.h cleanups
...
This commit makes the following minor cleanups:
1) Add C++ support
2) Guard header with #if LWIP_SOCKET
2017-02-09 22:48:47 -06:00
Joel Cunningham
3a7e03aaff
Add errno support to if_indextoname()
...
This commit adds support in if_indextoname() to return ENXIO when
no interface is found. This conforms to the Open Group/RFC 3493
specification
In order to leverage errno set support, the set_errno macro from
sockets.c was moved to sockets_priv.h
2017-02-09 22:32:29 -06:00
Joel Cunningham
852993029d
Add sockets_priv.h header
...
This commit introduces a sockets_priv.h header for socket API internal
implementations intended to be used by sockets API C files, but not
applications
This commit moves struct lwip_setgetsockopt_data to the private header
because this is not part of the public sockets API, but needs to be
shared between sockets.c and memp.c
This header lays ground work for sharing other internal sockets types
/macros between API files (sockets.c and if_api.c)
2017-02-09 22:04:30 -06:00
sg
c396dd4554
Clean up icmp6.c a bit after adding IPv6 scopes
2017-02-09 21:18:40 +01:00
Dirk Ziegelmeier
702091d548
igmp.c: igmp_lookup_group() should be static
2017-02-09 21:08:40 +01:00
Dirk Ziegelmeier
4d8fec3b67
Rename "IPv6 mapped IPv4 addresses" to their correct name from RFC4191: "IPv4-mapped IPv6 address"
2017-02-09 21:02:12 +01:00
sg
c1c470fc4c
Fixed bug #44032 (LWIP_NETCONN_FULLDUPLEX: select might work on invalid/reused socket) by not allowing to reallocate a socket that has "select_waiting != 0"
2017-02-09 20:41:27 +01:00
Dirk Ziegelmeier
eae4129863
Documentation updates related to Joel's if_api changes
2017-02-09 19:39:07 +01:00
Dirk Ziegelmeier
fb0a750970
Choose another title for zones documentation page
2017-02-09 13:21:20 +01:00
Dirk Ziegelmeier
a826b1aeeb
Add IPv6 scopes to documentation
2017-02-09 13:21:19 +01:00
goldsimon
ea093d3a53
http_add_connection: add connections to the front to be faster (and really fix bug #50059 )
2017-02-09 13:08:17 +01:00
goldsimon
5743864744
Fixed bug #50059 (httpd LWIP_HTTPD_SUPPORT_11_KEEPALIVE vs. LWIP_HTTPD_KILL_OLD_ON_CONNECTIONS_EXCEEDED)
2017-02-09 13:01:37 +01:00
Luc Revardel
819bfbb943
Fix bug #50220 (mld6_leavegroup does not send ICMP6_TYPE_MLD, even if last reporter)
...
Signed-off-by: sg <goldsimon@gmx.de >
2017-02-08 22:29:32 +01:00
David van Moolenbroek
03f47e58a3
udp/raw: prevent packet length overflows
...
Previously, on netifs with unrestricted MTUs (typically loopback
interfaces), it was possible to give a packet to the UDP/RAW API
calls that is so large that when prepending headers, the pbuf's
tot_len field would overflow. This could easily result in
undesirable behavior at lower layers, e.g. a crash when copying
the packet for later delivery.
This patch models such overflows as memory allocation errors, thus
resulting in clean failures. Checks have to be added in multiple
places to cover (hopefully) all cases.
2017-02-08 22:19:46 +01:00
David van Moolenbroek
fffd61c746
Patch #9250 (slightly changed): fix source substitution in ip6_output_if() (broken in 2014 with be75c483d0)
...
Signed-off-by: sg <goldsimon@gmx.de >
2017-02-08 22:16:32 +01:00
sg
21737f57e5
Fixed bug #50090 (ast_unsent->oversize_left can become wrong value in tcp_write error path)
2017-02-08 21:42:30 +01:00
Joel Cunningham
0284961d61
if APIs: update copyright claim
...
Update copyright claim on new if API files
2017-02-07 10:32:41 -06:00
Joel Cunningham
22b892571b
Add parenthesis to clarify sin6_scope_id cast
...
Add parenthesis to clarity on cast of sin6_scope_id and not sin6 pointer
2017-02-07 10:12:31 -06:00
Joel Cunningham
a0a64a59ba
Fix sockets on MSVC after IPv6 zone work
...
This fixes the following build failure with MSVC 2013:
sockets.c(323): warning C4242: '=' : conversion from 'const u32_t' to 'u8_t', possible loss of data
This casts sin6_scope_id to a u8_t before calling ip6_addr_set_zone()
2017-02-07 10:03:33 -06:00
Dirk Ziegelmeier
8a34570b83
Fix compile without IPv6 zone support
...
Fixed warning about unreachable code because ip6_addr_has_zone is always 0
2017-02-05 13:33:10 +01:00
Dirk Ziegelmeier
46f4584796
Fix cast from pointer to numeric in slipif.c
2017-02-05 12:53:42 +01:00
Dirk Ziegelmeier
55e6bf7e3d
Fix compile when IPv6 is disabled
2017-02-05 12:53:20 +01:00
Dirk Ziegelmeier
d857344aa8
patch #9249 : tcp: Fix unused parameter 'dest' build warning if !LWIP_IPV6
...
Apply modified version of Axel Lin's patch, without #ifdef
2017-02-05 12:44:32 +01:00
Dirk Ziegelmeier
ef758082ed
Fix that slipif used netif->num to pass parameters to slipif_init.
...
Use netif->state now, interpreted as u8_t port number (not a pointer any more!)
2017-02-05 12:35:42 +01:00
Dirk Ziegelmeier
1fd56658b8
Add IPv6 scopes to CHANGELOG
2017-02-04 18:44:30 +01:00
Axel Lin
be7ae5e36b
dns: Slightly improve dns_alloc_random_port implementation
...
Having the variable namining ret for a pointer makes the code looks odd,
ret looks like a value variable. Rename ret to pcb.
Also simplify the code in the do {} while() loop.
Signed-off-by: Axel Lin <axel.lin@ingics.com >
2017-02-04 18:42:14 +01:00
David van Moolenbroek
2903b476c7
ip6: fix parentheses in ip6_addr_has_scope
...
Both of the multicast checks should be skipped if the address type
is unicast. This bug accidentally caused only one of them to be
skipped, resulting in some unnecessary performance overhead.
Reported by Axel Lin.
2017-02-04 18:38:02 +01:00
Dirk Ziegelmeier
f60a2e8f85
Fix a few build problems after merging IPv6 zones
2017-02-04 11:59:35 +01:00
Joel Cunningham
4fb7d74165
task #14314 : include cleanups
...
Couple of more cleanups for task #14314 involving includes:
1) if.h name should match if_api.c due to LwIP convention and history.
Standard if.h include can be used with compatibility header in
posix/net/if.h
2) API header (if.h) should not be included in core code. This include
has been eliminated by moving the definition of IF_NAMESIZE to
netif.h as NETIF_NAMESIZE. This is now the canonical definition
and IF_NAMESIZE just maps to it to provide the standard type
2017-02-03 16:45:29 -06:00
David van Moolenbroek
3d80e51b2a
tcp: eliminate some redundant route lookups
...
Now that tcp_connect() always determines the outgoing netif with a
route lookup, we can compute the effective MSS without doing the same
route lookup again. The outgoing netif is already known from one
other location that computes the MSS, so we can eliminate a redundant
route lookup there too. Reduce some macro clutter as a side effect.
2017-02-03 22:30:08 +01:00
David van Moolenbroek
29ddfd1d71
Add support for IPv6 address scopes
...
This patch adds full support for IPv6 address scopes, thereby aiming
to be compliant with IPv6 standards in general and RFC 4007 in
particular. The high-level summary is that link-local addresses are
now meaningful only in the context of their own link, guaranteeing
full isolation between links (and their addresses) in this respect.
This isolation even allows multiple interfaces to have the same
link-local addresses locally assigned.
The implementation achieves this by extending the lwIP IPv6 address
structure with a zone field that, for addresses that have a scope,
carries the scope's zone in which that address has meaning. The zone
maps to one or more interfaces. By default, lwIP uses a policy that
provides a 1:1 mapping between links and interfaces, and considers
all other addresses unscoped, corresponding to the default policy
sketched in RFC 4007 Sec. 6. The implementation allows for replacing
the default policy with a custom policy if desired, though.
The lwIP core implementation has been changed to provide somewhat of
a balance between correctness and efficiency on on side, and backward
compatibility on the other. In particular, while the application would
ideally always provide a zone for a scoped address, putting this in as
a requirement would likely break many applications. Instead, the API
accepts both "properly zoned" IPv6 addresses and addresses that, while
scoped, "lack" a zone. lwIP will try to add a zone as soon as possible
for efficiency reasons, in particular from TCP/UDP/RAW PCB bind and
connect calls, but this may fail, and sendto calls may bypass that
anyway. Ultimately, a zone is always added when an IP packet is sent
when needed, because the link-layer lwIP code (and ND6 in particualar)
requires that all addresses be properly zoned for correctness: for
example, to provide isolation between links in the ND6 destination
cache. All this applies to packet output only, because on packet
input, all scoped addresses will be given a zone automatically.
It is also worth remarking that on output, no attempt is made to stop
outgoing packets with addresses for a zone not matching the outgoing
interface. However, unless the application explicitly provides
addresses that will result in such zone violations, the core API
implementation (and the IPv6 routing algorithm in particular) itself
will never take decisions that result in zone violations itself.
This patch adds a new header file, ip6_zone.h, which contains comments
that explain several implementation aspects in a bit more detail.
For now, it is possible to disable scope support by changing the new
LWIP_IPV6_SCOPES configuration option. For users of the core API, it
is important to note that scoped addresses that are locally assigned
to a netif must always have a zone set; the standard netif address
assignment functions always do this on behalf of the caller, though.
Also, core API users will want to enable LWIP_IPV6_SCOPES_DEBUG at
least initially when upgrading, to ensure that all addresses are
properly initialized.
2017-02-03 22:29:57 +01:00
sg
1839153609
minor: dhcp_network_changed(): assert for valid state, fix coding style
2017-02-03 21:20:39 +01:00
Axel Lin
855ea02b15
netdb: Use LWIP_MEM_ALIGN_BUFFER instead of open coded
...
Signed-off-by: Axel Lin <axel.lin@ingics.com >
2017-02-03 08:57:45 +01:00
Axel Lin
3e30dbc75c
dns: Clean up unneeded #if guard for DNS_LOCAL_HOSTLIST/DNS_LOOKUP_LOCAL_EXTERN
...
This is a leftover of commit e77e18f8c4 "Worked on IPv6-only stack", fix it.
Signed-off-by: Axel Lin <axel.lin@ingics.com >
2017-02-03 08:57:44 +01:00
Joel Cunningham
b6c995fed8
Rename if.c to if_api.c
...
This renames if.c to if_api.c in order to avoid using a common source
file name which may collide with other source files from non-LwIP
projects. See discussion in task #14314
2017-02-02 08:59:50 -06:00
Dirk Ziegelmeier
ff04c2046e
Fix bug #50206 : UDP Netconn bind to IP6_ADDR_ANY fails
...
The tests were in to catch user errors, but they seem to get in the way of application programming :-)
The checks in *_send() remain active to catch when PCB source and destination address types do not match
2017-02-02 10:25:05 +01:00
Dirk Ziegelmeier
2ad03b0ebd
Add documentation for LWIP_PROVIDE_ERRNO in arch.h
2017-02-02 09:18:30 +01:00
Dirk Ziegelmeier
29b7c75a72
Revert fixes "bug #50162 : Minor bug in errno.h"
...
They are a breaking change :-(
This reverts commit abef0b44a8 .
2017-02-02 08:42:09 +01:00
Dirk Ziegelmeier
e8d5499d72
Code cleanup: add some parentheses in tcp.c and tcp_out.c
2017-02-01 15:28:10 +01:00
goldsimon
4b091cfc2a
Fix comment on lwip_shutdown() (it's not unimplemented any more)
2017-02-01 10:09:37 +01:00
goldsimon
48d2243845
Clarify/add LWIP_PROVIDE_ERRNO comments
2017-01-31 12:38:53 +01:00
Axel Lin
2685d742e8
stats: Remove superfluous /t in end of stats display
...
The debug message after the stats display looks odd because the /t in end of
stats display.
Signed-off-by: Axel Lin <axel.lin@ingics.com >
2017-01-31 08:57:26 +01:00
Dirk Ziegelmeier
a1df0c5d77
Fix build failue in err.h reported by Axel Lin
...
In file included from ../../../../lwip/src/include/lwip/sockets.h:49:0,
from ../../../../lwip/src/core/init.c:47:
../../../../lwip/src/include/lwip/errno.h:46:5: error:
"LWIP_PROVIDE_ERRNO" is not defined [-Werror=undef]
#if LWIP_PROVIDE_ERRNO
^~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors
../Common.mk:93: recipe for target 'init.o' failed
make: *** [init.o] Error 1
2017-01-31 08:57:25 +01:00
David van Moolenbroek
2e528ad510
PPP: clear address state before clearing address
...
netif_ip6_addr_set_state() relies on being able to access the old
address on invalidation, for example in order to invalidate PCBs
and leave the correct solicited-node MLD group.
2017-01-27 19:07:14 +01:00
Dirk Ziegelmeier
abef0b44a8
bug #50162 : Minor bug in errno.h
...
#ifdef -> #if
2017-01-27 09:09:21 +01:00
Dirk Ziegelmeier
ee3154999a
Add CHANGELOG to lwIP HTML documentation
2017-01-24 11:45:51 +01:00
Dirk Ziegelmeier
7a99d2f8e9
Fix documentation on netif_index_to_name
2017-01-24 11:39:34 +01:00
Joel Cunningham
6fbec25c8f
if.c include lwip/if.h
...
if.c was not including lwip/if.h and failed to build with
-Werror=missing-prototypes on gcc/clang
2017-01-23 17:40:36 -06:00
Joel Cunningham
fbfe987ae8
netif: clean up remaining index shadowing from if APIs
...
This commit cleans up the remaining instance of global variable
"index" shadowing caused by using local variables and function
parameters named "index"
These were introduced in the recent interface index API commits
2017-01-23 17:23:54 -06:00
Dirk Ziegelmeier
d297d466ed
Fix some more variables named "index" - found by Joel Cunningham
2017-01-23 21:46:11 +01:00
Dirk Ziegelmeier
0ef298b21f
Fix warning about shadowing a global variable "index" in netifapi.c
2017-01-23 21:12:29 +01:00
Dirk Ziegelmeier
9e0b36747a
Fix warning about shadowing a global variable "index" in if.c
2017-01-23 20:21:49 +01:00
Ajay Bhargav
b5011e7012
api:if: Handle case when LWIP_NETIF_API is not defined
...
When LWIP_NETIF_API is not enabled in lwipopts.h. Return error from if
APIs
Signed-off-by: Ajay Bhargav <contact@rickeyworld.info >
2017-01-23 09:30:00 -06:00
Joel Cunningham
e158f87286
Netif: add allowance for init to override netif->num
...
Adjusts assert logic from 9c80a66253
to allow for a netif driver's init callback to manually override
the number. When the init function is taking care of the unique
assignment, the assert simply checks that a valid number was provided
2017-01-20 14:55:29 -06:00
Dirk Ziegelmeier
edac92d03a
Minor compile fix in netifapi.c: Use LWIP_CONST_CAST to cast away constness
2017-01-20 21:27:05 +01:00
Joel Cunningham
1b20e664bf
Task #14314 : Add interface name/index APIs
...
This commit adds the following sets of interface name/index APIs:
Interface Identification APIs from RFC 3493:
* lwip_if_nametoindex (COMPAT macro if_nametoindex)
* lwip_if_indextoname (COMPAT macro if_indextoname)
netifapi:
* netifapi_netif_name_to_index
* netifapi_netif_index_to_name
netif:
* netif_name_to_index
* netif_index_to_name
* netif_num_to_index
* netif_index_to_num
2017-01-20 14:06:42 -06:00
Joel Cunningham
9c80a66253
Netif: add netif_num overflow assert
...
This commit adds an LWIP_ASSERT to detect when netif_num overflows and
we no longer have unique numbers per netif. Unique netif numbers are
needed to support interface indexes (task #14314 )
The only cases where this could occur are with a deployment that attempts
to use the maximum 256 netifs at the same time or where netifs are being
constantly adding and removed. Neither of these use cases fit the
lightweight goals of LwIP
See discussion in task #14314 for more details
2017-01-20 14:03:54 -06:00
Dirk Ziegelmeier
645ca84704
Retry 1 to fix bug #50064
...
Accidentally used the wrong destination HW addr
2017-01-18 13:43:01 +01:00
Dirk Ziegelmeier
7aaa888d1d
Optimize my last fix in etharp.c, I missed the variable declaration at the beginning of the function
2017-01-18 13:21:11 +01:00
Dirk Ziegelmeier
c362c6a02c
Add note about bug #50064 to CHANGELOG
2017-01-18 12:33:26 +01:00
Dirk Ziegelmeier
47bac3c11f
Remove special ARP reply optimization from etharp.c
...
- Code duplication with etharp_raw()
- No great effect on perfomance
- May make reworking PBUF handling code more complicated (see bug #49914 )
- The check for p->type == PBUF_REF is a strange special case, too
- Simon also voted to remove it
2017-01-18 12:25:09 +01:00
Dirk Ziegelmeier
199c38de29
Fix bug #50064 : Zero-copy RX: ARP reply fails with PBUF_REF
...
Kept the optimized version intact, see discussion in savannah bug tracker
2017-01-18 10:15:02 +01:00
sg
b198c877db
fix compiling TCP unit tests with IPv6 enabled
2017-01-16 14:21:08 +01:00
Axel Lin
141b5def46
tcp_out: Use LWIP_MIN instead of open-coded for better readability
...
Make the intention of code more clear by using LWIP_MIN instead of open-coded.
Signed-off-by: Axel Lin <axel.lin@ingics.com >
2017-01-16 10:25:10 +01:00
Axel Lin
30aedfc3f7
tcp_out: Fix comment for last_unsent->oversize_left and tcp_pcb.unsent_oversize
...
Both last_unsent->unsent_oversize and tcp_pcb.unsent_oversized fields are not
exist, fix the comments.
Signed-off-by: Axel Lin <axel.lin@ingics.com >
2017-01-16 08:51:53 +01:00
Dirk Ziegelmeier
df8e404abd
Add some parentheses for better code readability in tcp_in.c
2017-01-16 08:51:27 +01:00
Dirk Ziegelmeier
9898d406bc
Fix bug #50040 : pbuf_alloc(..., 65534, PBUF_RAM) succeeds
...
Check for integer overflow when calculating memory allocation size
2017-01-15 17:36:33 +01:00
Dirk Ziegelmeier
0043bf78b6
Minor typo fix in tcp_out.c
2017-01-15 16:37:25 +01:00
Axel Lin
e1598b0b11
tcp_out: Fix oversize vs. space assertion test
...
oversize_used is always 0 at this point, should test oversize instead.
Signed-off-by: Axel Lin <axel.lin@ingics.com >
2017-01-15 16:36:48 +01:00
Dirk Ziegelmeier
861dab5b22
Set lwIP version to 2.0.2 in doxygen script
2017-01-15 09:22:33 +01:00
Dirk Ziegelmeier
5c58e25de5
Minor code readability improvement in mqtt.c
2017-01-15 09:22:13 +01:00
Dirk Ziegelmeier
1d7f375992
Fix compile error in ip6_frag.c
...
../../../../lwip/src/core/ipv6/ip6_frag.c: In function ‘ip6_reass’:
../../../../lwip/src/core/ipv6/ip6_frag.c:567:7: error: ISO C90 forbids mixed declarations and code [-Werror=pedantic]
2017-01-14 09:31:06 +01:00
Dirk Ziegelmeier
92511f4711
Fix part 2 of bug #50042 : ETHADDR16_COPY from netif->hwaddr
...
Eliminate ETHADDR32_COPY macro - it cannot be used in ETH_PAD_SIZE case. I could have kept it by defining it to ETHADDR16_COPY in case of ETH_PAD_SIZE, but I did not consider it worth another #ifdef mess.
2017-01-13 08:18:33 +01:00
Dirk Ziegelmeier
6748aa0818
Fix part 1 of bug #50042 : ETHADDR16_COPY from netif->hwaddr
...
Rearrange struct netif to group more u8_t values together which may result in smaller struct netif on 32 bit systems
2017-01-13 08:06:50 +01:00
Dirk Ziegelmeier
bc583c993a
Add comment about my fix to bug #47512 : MPU_COMPATIBLE may fail on empty pool to api_lib.c
...
Code looks like it could be optimized, but it can not!
2017-01-12 16:36:17 +01:00
Axel Lin
2c3538cb8f
IPv6: Fix compile error of ip6_frag.c
...
Fix below compile error:
../../../../lwip/src/core/ipv6/ip6_frag.c: In function ‘ip6_reass’:
../../../../lwip/src/core/ipv6/ip6_frag.c:533:20: error: declaration of ‘next_pbuf’ shadows a previous local [-Werror=shadow]
struct pbuf* next_pbuf = iprh->next_pbuf;
^~~~~~~~~
../../../../lwip/src/core/ipv6/ip6_frag.c:272:20: note: shadowed declaration is here
struct pbuf *q, *next_pbuf;
^~~~~~~~~
cc1: all warnings being treated as errors
../Common.mk:93: recipe for target 'ip6_frag.o' failed
make: *** [ip6_frag.o] Error 1
Fixes: 7cedf7ae71 ("IPv6: fragment reassembly fixes")
Signed-off-by: Axel Lin <axel.lin@ingics.com >
2017-01-11 16:16:41 +01:00
David van Moolenbroek
9713baea55
ip6: improve length checks for extension headers
...
Malformed packets could cause the extension header iteration code to
read from up to two bytes beyond the end of the packet's first pbuf.
2017-01-11 14:05:24 +01:00
David van Moolenbroek
7cedf7ae71
IPv6: fragment reassembly fixes
...
This patch aims to fix three closely related issues.
o The implementation of IPV6_FRAG_COPYHEADER was fundamentally
incompatible with the presence of extension headers between the
IPv6 header and the Fragment Header. This patch changes the
implementation to support such extension headers as well, with
pretty much the same memory requirements. As a result, we can
remove the check that prevented such packets from being reassembled
in all cases, even with IPV6_FRAG_COPYHEADER off.
o Given that temporary data is stored in the Fragment Header of
packets saved for the purpose of reassembly, but ICMPv6 "Fragment
Reassembly Time Exceeded" packets contain part of the original
packet, such ICMPv6 packets could actually end up containing part
of the temporary data, which may even include a pointer value. The
ICMPv6 packet should contain the original, unchanged packet, so
save the original header data before overwriting it even if
IPV6_FRAG_COPYHEADER is disabled. This does add some extra memory
consumption.
o Previously, the reassembly would leave the fragment header in the
reassembled packet, which is not permitted by RFC 2460 and prevents
reassembly of particularly large packets (close to 65535 bytes
after reassembly). This patch gets rid of the fragment header. It
does require an implementation of memmove() for that purpose.
Note that this patch aims to improve correctness. Future changes
might restore some of the previous functionality in order to regain
optimal performance for certain cases (at the cost of more code).
2017-01-11 14:05:22 +01:00
Dirk Ziegelmeier
b17c050861
Fix compile of my last change in httpd_opts.h (use of undefined preprocessor macro)
2017-01-11 12:28:09 +01:00
Dirk Ziegelmeier
2b1ebda6f1
Minor correction to last patch: Avoid #including socket.h in api_msg.c
2017-01-11 12:27:30 +01:00
Knut Andre Tidemann
5e9df2c698
lwip: fix broken default ICMPv6 handling of checksums.
...
ICMPv6 should always have checksum generated for it as per RFC 3542
chapter 3.1.
2017-01-11 12:24:15 +01:00
Dirk Ziegelmeier
f8ef8c48f7
Simplify HTTPD #include path handling
...
- Move fsdata.h content to lwip/apps/fs.h -> no #include path needed any more to src/apps/httpd/
- Create a #define to specify fsdata file name. One can use path in there now, e.g. "../mywebserver/mkfsdata_output.c" -> no #include path needed any more to location of generated file
2017-01-11 10:59:15 +01:00
Dirk Ziegelmeier
a038e1502f
Add David's IPv6 improvements to CHANGELOG
2017-01-11 08:42:40 +01:00
Dirk Ziegelmeier
2e265310c4
Fix (bogus) MSVC 2010 warning about uninitialized variable usage in ip6.c
...
It's wrong because the variables are initialized during first loop iteration due to best_addr == NULL
2017-01-11 08:08:05 +01:00
David van Moolenbroek
713146eeba
nd6: cull destination cache on router removal
...
As per RFC requirements, upon removing a router from the default
router list, remove any entries pointing to it from the destination
cache. While here, synchronize timing out entries in the default
router list with the rest of the timer code.
When removing a netif, clear the destination cache altogether
in order to prevent more general inconsistency. When this happens,
the entries for other netifs will have to be rebuilt, but removing
netifs should be sufficiently rare that this is not worth optimizing.
2017-01-11 07:54:17 +01:00
David van Moolenbroek
a1130f8c7b
nd6: some work on basic RFC 4861 compliance
...
The current ND implementation does not yet implement the most basic
required ('MUST') checks for message validation and generation.
- implement some of the required checks for message validation;
- document the remaining missing message validation checks;
- hardcode the hop limit of Neighbor Discovery messages rather than
having it depend on lwIP configuration which, if changed, would
cause all of ND to cease working.
2017-01-11 07:54:15 +01:00
David van Moolenbroek
0b9d7a386c
ip6: improve source address selection
...
The introduction of address lifetimes also means that lwIP correctly
supports transitions between PREFERRED and DEPRECATED address states,
and that means that the source address selection must be changed to
take this into account. Adding this feature to the previous algorithm
would have resulted in a mess, so this patch rewrites the algorithm to
stay close to the rules described in RFC 6724 (formerly 3484) Sec. 5.
This yields the following changes:
- Rule 2 ("prefer appropriate scope") is now fully implemented, most
importantly allowing larger-scope addresses to be picked if no
smaller-scope addresses are available (e.g., a global address may
now be used to connect to a unique-local address);
- Rule 3 ("avoid deprecated addresses") is now also fully implemented;
- unknown-scope addresses are also supported, with lowest priority;
- the link between the prescribed rules and the actual algorithm is
made much more explicit, hopefully allowing future improvements to
be made more easily.
For reasons explained in comments, one previous deviation from the RFC
on Rule 2 is retained for now.
2017-01-11 07:54:14 +01:00
David van Moolenbroek
08de0e9617
ip6/nd6: route using on-link prefixes, not addresses
...
As laid out in RFC 5942, the assumption that a dynamically assigned
(SLAAC/DHCPv6) address implies an on-link subnet, is wrong. lwIP does
currently make that assumption, routing packets according to local
address subnets rather than the on-link prefix list. The result is
that packets may not make it to their destination due to incorrect
routing decisions.
This patch changes the routing algorithms to be (more) compliant with
RFC 5942, by implementing the following new routing policies:
- all routing decisions check the on-link prefix list first, and
select a default router for off-link routing only if there is no
matching entry in the on-link prefix list;
- dynamically assigned addresses (from address autoconfiguration) are
considered /128 assignments, and thus, no routing decisions are taken
based on matches against their (/64) subnet anymore;
- more generally, all addresses that have a lifetime are considered
dynamically assigned and thus of size /128, which is the required
behavior for externally implemented SLAAC clients and DHCPv6;
- statically assigned (i.e., manually configured) addresses are still
considered /64 assignments, and thus, their associated subnet is
considered for routing decisions, in order to behave as generally
expected by end users and to retain backward compatibility;
- the link-local address in IPv6 address slot #0 is considered static
and thus has no lifetime and an implied /64 subnet, although link-
local routing is currently always handled separately anyway.
IPv6 source address selection is kept as is, as the subnet tests in
the algorithm serve as poor man's longest-common-prefix equivalent
there (RFC 6724 Sec. 5, Rule 8).
2017-01-11 07:54:12 +01:00
David van Moolenbroek
22c2fd1b58
nd6: improve router selection
...
Previously, IPv6 routing could select a next-hop router on a netif
that was down or disconnected, potentially resulting in packets being
dropped unnecessarily. This patch changes router selection to take
into account the state of the router's associated netif, eliminating
such unnecessary packet loss.
Also, this patch fixes the test for router validity, which was
erroneously based on the router's invalidation timer rather than its
neighbor cache entry state. Given that an expired router has no
associated neighbor cache entry, no invalid routers would previously
ever be returned.
Finally, this patch also adds round-robin selection of routers that
are not known to be reachable or probably reachable, as per RFC 4861
Sec. 6.3.6 point (2). Support for this feature was partially present
but not actually functional.
2017-01-11 07:54:10 +01:00
David van Moolenbroek
901664eca1
netif: more ip6 state changes invoke status callback
...
For applications that use NETIF_STATUS_CALLBACK to help keep track of
extra per-address shadow state of IPv6 addresses, even in the light of
autogenerated addresses (which may "spontaneously" appear/disappear),
state transitions between tentative, duplicated, and invalid are
important as well. Therefore, invoke the status callback for all such
state transitions. Continue to filter out state changes between
various levels of progress of the tentative state, though.
2017-01-11 07:54:09 +01:00
David van Moolenbroek
d99334573b
nd6: fix Duplicate Address Detection
...
Previously, Duplicate Address Detection (DAD) would work only for the
link-local address. For DAD-spawned Neighbor Solicitation requests for
any other address, the request would use the link-local address as the
source, meaning the other side would send a targeted reply (RFC 4861
Sec. 7.2.4). However, the nd6 implementation currently does not
consider targeted replies for DAD--even though technically an RFC 4862
Sec. 5.4.4 violation--supposedly because no real-world scenario could
trigger that case. The combination of these factors resulted in DAD
being entirely ineffective for non-link-local addresses.
This patch forces all DAD-spawned Neighbor Solicitation packets to use
the unspecified ('any') address as source, as per RFC 4862 Sec. 5.4.2.
As a result, other nodes would reply with multicast replies, for which
there is appropriate DAD checking code.
The patch also makes a slight rearrangement of statements such that
MLD join messages are sent before the NS packets, rather than after.
2017-01-11 07:54:07 +01:00
David van Moolenbroek
2ff04a931a
nd6: check link status before sending packets
...
In the cases that nd6 checks whether the interface is up before
sending a packet, also check whether the link is up. Without this
additional check, temporary link downtime could easily result in
unnecessary false negatives for Duplicate Address Detection.
In addition, use the netif abstraction macros to perform the checks.
2017-01-11 07:54:05 +01:00
David van Moolenbroek
e0c5e1988f
nd6: improve address autoconfiguration support
...
In summary, this patch aims to resolve bugs #47923 and #48162 , by
decoupling address autoconfiguration from the on-link prefix list,
since those are not related. Important necessary changes are needed
to meet this goal, ultimately bringing the lwIP ND6 implementation
closer to compliance with RFC 4862. The main changes are:
1. support for address lifetimes, and,
2. addition of a new DUPLICATED address state.
The decoupling implies that the prefix list can no longer be used to
maintain state for address autoconfiguration. Most importantly, the
lifetime of each address, which was previously derived from the
prefix slot's lifetime, must now be associated with the address
itself. This patch implements address lifetime tracking, maintaining
both a valid and a preferred lifetime for each address, along with
the corresponding address state changes (e.g., between PREFERRED and
DEPRECATED), all as required by RFC 4862.
The support for address lifetimes can be enabled with a new
LWIP_IPV6_ADDRESS_LIFETIMES setting in lwipopts.h. It is required for
autoconfiguration and enabled by default if autoconfiguration is
enabled as well, but it may also be enabled separately, so as to allow
application-controlled lifetime management (e.g., if autoconfiguration
is implemented in a separate application). A special valid-lifetime of
zero is used to denote a static address--that is, an address that was
configured manually, that does not have lifetimes, and that should be
left alone by the autoconfiguration functionality. Addresses assigned
without setting a lifetime are deemed static, thus preserving
compatibility with existing lwIP-based applications in this respect.
Similarly, the decoupling implies that the prefix list can no longer
be used to remember cases of address duplication. Previously, the
detection of a duplicated address would simply result in removal of
the address altogether. Instead, this patch introduces a new state
"DUPLICATED", indicating that the address, while technically still
present, has been found to conflict with other node addresses, and no
attempt should be made to produce an autoconfiguration address for
that prefix.
Manually added addresses, including the link-local address, once set
to DUPLICATED, will remain in that state until manual intervention.
Autoconfigured DUPLICATED addresses will expire according to their
valid-lifetime, essentially preserving the current behavior but
without the use of the prefix list. As a first attempt to approach
compliance with RFC 4862 Sec. 5.4.5, if the link-local address is
detected to be duplicated, all derived addresses are marked duplicated
as well, and no new addresses will be autoconfigured. More work is to
be done for full compliance with that section, however.
Together, those two main changes indeed do fully decouple address
autoconfiguration from the on-link prefix list. Changes to the latter
thus no longer affect the former, resolving bug #47923 . Moreover, as a
result, autoconfiguration can, and does, now also take place on
advertised prefixes that do not have the on-link flag set, resolving
bug #48162 . The routing changes mentioned in the discussion of that
bug are left to a separate patch, though.
2017-01-11 07:54:03 +01:00
Dirk Ziegelmeier
3cc7b319d9
Add MQTT to CHANGELOG (too late for 2.0.1 release...)
2017-01-08 19:45:28 +01:00
Dirk Ziegelmeier
19f075a92a
Put 2.0.1 version tag in UPGRADING document
2017-01-08 19:33:52 +01:00
Dirk Ziegelmeier
e3435401f1
Add David's changes from patch #9208 to CHANGELOG
2017-01-08 19:29:46 +01:00
David van Moolenbroek
b59472cf63
raw: core support for IP_HDRINCL socket option
...
This patch adds a new RAW_FLAGS_HDRINCL flag to the raw core
implementation. When this flag is set on a RAW PCB, the raw send
routines expect the caller to supply an IP header for the given
packet, and will use that IP header instead of prepending one to
the packet themselves.
This feature allows the IP_HDRINCL socket option to be implemented
in higher layers with no further effort. Even thoguh that option is
traditionally supported for IPv4 sockets only (e.g., see RFC 3542
Sec. 3), the RAW_FLAGS_HDRINCL flag supports both IPv4 and IPv6, as
much of the lower-level infrastructure was already in place anyway.
2017-01-08 19:26:30 +01:00
David van Moolenbroek
162cc4d343
raw: split off raw_sendto_if_src() from raw_sendto()
...
Similar to the core UDP API, the new function may be used to implement
IPV6_PKTINFO (RFC 3542 Sec. 4), for example. This patch makes no
further functional changes; it merely moves code around a bit.
2017-01-08 19:26:24 +01:00
David van Moolenbroek
aea7062223
raw: extend support for connected sockets
...
The support for connecting raw sockets is extended to match the
support for UDP sockets, while keeping the current API unchanged:
- for connected sockets, filter incoming packets on source address;
- use a flag to indicate whether a socket is connected, at no extra
memory cost; the application may check this flag if needed;
- added raw_disconnect(), which so far existed in documentation only.
2017-01-08 19:26:19 +01:00
Dirk Ziegelmeier
52f448978f
MQTT: Add check that WILL topic length must be > 0
2017-01-08 19:08:54 +01:00
Dirk Ziegelmeier
6d5ddb7139
MQTT: Fix possible bug in connect message generation that WILL flag can be set without appending a will message
...
The boolean condition of setting the WILL flag differs from that of appending the will message
Found by Axel Lin
(I fixed it the same way as Axel suggested, but I wanted a different commit message)
2017-01-08 19:07:43 +01:00
Axel Lin
a2915b7142
mqtt: Slightly improve mqtt_create_request
...
Mainly for better readability, also save NULL test while iterating the for loop.
Signed-off-by: Axel Lin <axel.lin@ingics.com >
2017-01-07 20:39:41 +01:00
Axel Lin
7faa4bcbe2
mqtt: Prevent NULL pointer dereference before assertion checking
...
Signed-off-by: Axel Lin <axel.lin@ingics.com >
2017-01-06 12:15:03 +01:00
Erik Ekman
6c9a9b9d99
Remove duplicate netif_dhcp_data() macro
...
Fix compilation of unit tests
2017-01-05 21:14:43 +01:00
Dirk Ziegelmeier
02eec304c3
Update version to 2.0.2 DEVELOPMENT in master branch
2017-01-05 15:03:09 +01:00
Dirk Ziegelmeier
3a20ae3830
Add missing #include in netdb.c for atoi()
2017-01-05 08:55:12 +01:00
Dirk Ziegelmeier
0ffaccaec3
Add missing #include in httpd.c for atoi()
2017-01-05 08:53:26 +01:00
Dirk Ziegelmeier
e94c9ffa70
Fix warning about bad cast in pbuf_skip()
2017-01-05 08:14:39 +01:00
Dirk Ziegelmeier
72316bdb5b
Move macros to access DHCP and AUTOIP data to headers, users may want to access the members
2017-01-05 08:09:00 +01:00
Dirk Ziegelmeier
803a711e6a
Fix warning that local variable may be used uninitialized in mem.c
2017-01-05 08:07:41 +01:00
sg
8760fb677f
fixed warnings in mdns unit tests
2017-01-04 15:25:52 +01:00
Erik Ekman
d2631e6a53
mqtt: Fix pedantic enum warning
...
src/apps/mqtt/mqtt.c:81:17: error: comma at end of enumerator list [-Werror=pedantic]
2017-01-04 00:24:00 +01:00
Dirk Ziegelmeier
4059748b47
I was not satisfied with the previous debugging options structure. Improve it again.
2017-01-02 19:50:46 +01:00
Dirk Ziegelmeier
644a21b8a5
Improve debugging options documentation
2017-01-02 19:32:56 +01:00
Dirk Ziegelmeier
a3876314b7
Add debugging options to documentation
2017-01-02 19:25:23 +01:00
Dirk Ziegelmeier
e3c2b8a339
Add note about high resource-consumption in LWIP_PLATFORM_DIAG and LWIP_PLATFORM_ASSERT default implementations
2017-01-02 19:06:33 +01:00
Dirk Ziegelmeier
e12bb2a4eb
Fix comma at end of enum list in mqtt.h
2017-01-01 20:26:28 +01:00
Dirk Ziegelmeier
2096f1a657
Fix C++ style comment in mqtt.c
2017-01-01 20:23:11 +01:00
Axel Lin
1f3c18fcbe
tcp: Make tcp_listen_with_backlog_and_err return NULL if the address/port is already used
...
The caller of tcp_listen_with_backlog_and_err() usually check if the return
pcb is NULL before checking the err reason. I think the commit adding
tcp_listen_with_backlog_and_err() accidently change the behavior, Fix it.
Fixes: 98fc82fa71 ("added function tcp_listen_with_backlog_and_err() to get the error reason when listening fails")
Signed-off-by: Axel Lin <axel.lin@ingics.com >
2017-01-01 19:53:51 +01:00
Axel Lin
edfeab7932
mqtt: Trivial coding style fix
...
Add proper blank for if/for/while statements.
Signed-off-by: Axel Lin <axel.lin@ingics.com >
2017-01-01 19:20:24 +01:00
Dirk Ziegelmeier
b8bc7b7c71
arch.h: Add #includes necessary for default implentation of LWIP_PLATFORM_DIAG and LWIP_PLATFORM_ASSERT
2017-01-01 12:40:23 +01:00
Dirk Ziegelmeier
f874d15185
Add #include <string.h> in snmp_netconn.c because memset() is used
2017-01-01 12:38:34 +01:00
Dirk Ziegelmeier
ee034bd811
Document PACK_STRUCT_USE_INCLUDES #define
2017-01-01 12:31:02 +01:00
sg
a2a16d4193
nd6 rdnss: fixed dual-stack compilation
2016-12-31 15:51:59 +01:00
sg
98fc82fa71
added function tcp_listen_with_backlog_and_err() to get the error reason when listening fails (bug #49861 )
2016-12-31 15:36:31 +01:00
Dirk Ziegelmeier
1884c7e83f
Fix TCP unit tests after changes from "Add hook for TCP Initial Sequence Number generation" commit
...
(pcb->lastack and friends are not initialized during allocation any more, but by connect() / bind() call)
2016-12-31 11:46:27 +01:00
Dirk Ziegelmeier
1466b7ac61
Several mqtt documentation fixes found by clang
2016-12-29 09:44:07 +01:00
Dirk Ziegelmeier
748e2e925b
Create documentation section "porting" and move it under lwIP section (instead of infrastructure)
2016-12-29 09:29:24 +01:00
Dirk Ziegelmeier
1fd69ddee9
Minor documentation update in def.c
2016-12-29 09:28:45 +01:00
Dirk Ziegelmeier
3a8368ef04
Provide struct packing macros on GCC/clang out of the box
2016-12-29 09:28:28 +01:00
Dirk Ziegelmeier
c1258e5c72
Compile fix in lwip/arch.h "extra tokens at end of #ifndef directive"
2016-12-29 09:05:52 +01:00
Dirk Ziegelmeier
211a71cf11
Minor documentation update in lwip/arch.h
2016-12-28 21:52:10 +01:00
Dirk Ziegelmeier
55199fc62c
More documentation updates in lwip/arch.h
2016-12-28 10:14:36 +01:00
Dirk Ziegelmeier
45ad6f2e61
Minor documentation updates in lwip/arch.h
2016-12-28 09:53:11 +01:00
Dirk Ziegelmeier
df365adf9a
Trivial typo fix in arch.h docs
2016-12-26 10:53:41 +01:00
Axel Lin
7b40d1eb6f
doc: mqtt_client: Update example code after adding port parameter to mqtt_client_connect()
...
Signed-off-by: Axel Lin <axel.lin@ingics.com >
2016-12-24 15:10:56 +01:00
Dirk Ziegelmeier
c1d16c61eb
Forgot documentation on MQTT port #define
2016-12-24 12:06:53 +01:00
Dirk Ziegelmeier
83b1c397a0
Add #define with default MQTT port for convenience
2016-12-24 12:05:27 +01:00
Axel Lin
bfa0358a52
mqtt: Allow setting server port to connect
...
This is a mqtt client, so it does not make sense to determinate the server port
at compile time. Update mqtt_client_connect() function to allow setting server
port.
Signed-off-by: Axel Lin <axel.lin@ingics.com >
2016-12-23 09:52:31 +01:00
Dirk Ziegelmeier
2e4b368c8c
Revert "Fix bug #49914 : lwip_sendmsg uses PBUF_REF pbufs"
...
This reverts commit 4e34851c57 .
2016-12-23 09:51:26 +01:00
Dirk Ziegelmeier
4e34851c57
Fix bug #49914 : lwip_sendmsg uses PBUF_REF pbufs
...
Use PBUF_RAM and create private copy of the data
2016-12-22 21:19:53 +01:00
Dirk Ziegelmeier
3a557baedd
Move a few MQTT options from mqtt.c to mqtt_opts.h
2016-12-21 09:42:25 +01:00
Dirk Ziegelmeier
6e219b6b11
Change signature of mqtt_client_connect() to take an IP addr instead of a string
2016-12-21 09:36:28 +01:00
Dirk Ziegelmeier
ec1450bac4
Add mqtt documentation from Erik Anderson, rev 4b84fff
2016-12-21 09:29:47 +01:00
Axel Lin
5be91de56c
mqtt: Trivial error message fix
...
Fix trivial copy-paste mistake.
Signed-off-by: Axel Lin <axel.lin@ingics.com >
2016-12-21 08:54:57 +01:00
David van Moolenbroek
24fa1c457e
opt.h: provide some hints regarding MLD settings
2016-12-20 22:28:11 +01:00
David van Moolenbroek
71810d0415
ipv6: adjust MLD membership on address state changes
...
If MLD support is enabled, each locally assigned IPv6 address in the
appropriate state must be a member of the solicited-node multicast
group corresponding to that address. Ensure that this is always the
case by (re-)deciding on the membership upon every address state
change. By doing so, this patch enforces that user-initiated state
changes to addresses (e.g., deletion) never cause a desynchronization
with the corresponding solicited-node multicast group membership,
thereby making such user-initiated state changes simpler and safer.
2016-12-20 22:28:02 +01:00
Axel Lin
d5bc856f45
mqtt: Check conn_state before create request for sub_unsub
...
This also avoid a request leak in client->conn_state == TCP_DISCONNECTED error
path.
Signed-off-by: Axel Lin <axel.lin@ingics.com >
2016-12-20 19:45:31 +01:00
Dirk Ziegelmeier
876720593b
Update .gitignore once more for fuzz test
2016-12-20 14:25:46 +01:00
Dirk Ziegelmeier
dd96c71253
Fix a few -Wconversion warnings (there are many more to do)
2016-12-20 14:22:51 +01:00
Thomas Mueller
be57134810
Fixed bug #49895 : Incorrect configuration detection in lwip/dns.h
...
Signed-off-by: goldsimon <goldsimon@gmx.de >
2016-12-20 14:21:26 +01:00
Dirk Ziegelmeier
16b895b466
Undo removal of mqtt_publish() from documentation in Simon's last commit (guess it was by accident)
2016-12-20 10:48:19 +01:00
Dirk Ziegelmeier
dcb761637d
Minor documentation fix in MQTT
2016-12-20 10:42:56 +01:00
Axel Lin
02f4610b1c
mqtt: Use LWIP_ARRAYSIZE to replace hardcoded value
...
Signed-off-by: Axel Lin <axel.lin@ingics.com >
2016-12-20 10:36:42 +01:00
goldsimon
b6a131edfb
mqtt: fix C usage (declaration after statement), fix casting to smaller type
2016-12-20 10:27:43 +01:00
Dirk Ziegelmeier
12bc2c0425
MQTT cleanups:
...
- create mqtt_opts.h file and move options in there
- documentation cleanups
2016-12-20 10:08:50 +01:00
Dirk Ziegelmeier
14e36866f5
Some cleanups in MQTT client
...
Integrate in documentation
Compile fixes, mostly: Variables must be declared before any statement in a function
2016-12-20 09:41:21 +01:00
Dirk Ziegelmeier
1e82465766
task #14281 : Add MQTT client
...
Thanks to Erik Andersen
Taken from https://github.com/erian747/ , branch mqtt, rev 5d59470
2016-12-20 09:16:21 +01:00
goldsimon
fb07d47b82
more LWIP_NOASSERT fixes
2016-12-19 10:34:49 +01:00
goldsimon
c71733252c
Fix compiling with LWIP_NOASSERT (and debug/error disabled, too)
2016-12-19 10:29:16 +01:00
Dirk Ziegelmeier
e0c0ba7e1b
Fix compile with LWIP_NOASSERT
...
Pointed out by Nirav Desai
2016-12-19 10:11:23 +01:00
Dirk Ziegelmeier
7f319f5ec5
Fix compile of test_tcp.c unit test after introduction of tcp_next_iss hook
2016-12-18 21:46:49 +01:00
Dirk Ziegelmeier
c21763f6cb
Minor code cleanup api_lib.c
2016-12-18 21:31:14 +01:00
Axel Lin
f488c5b7bc
igmp: Fix optimized code for igmp_remove_group
...
The code in the for loop checks tmp_group->next == group, so current code
actually checks from the 3rd entry in the linked groups list. Fix it.
Fixes: 5c1dd6a4c6 ("Optimization in igmp_remove_group() pointed out by Axel Lin")
Signed-off-by: Axel Lin <axel.lin@ingics.com >
2016-12-17 22:01:30 +01:00
Dirk Ziegelmeier
5c1dd6a4c6
Optimization in igmp_remove_group() pointed out by Axel Lin
...
No need to handle special case "first in list" since this is always the allsystems group that shall not be removed
2016-12-17 15:06:33 +01:00
Dirk Ziegelmeier
102a50fa96
Fix bug #39145 : IGMP membership report for 224.0.0.1
...
Ensure allsystems group is always first in linked list
2016-12-17 13:36:24 +01:00
Dirk Ziegelmeier
bb8088d498
Minor cleanup of FUZZ test Makefile
2016-12-17 10:09:15 +01:00
Dirk Ziegelmeier
11780f037b
Fixup Makefile of FUZZ test after moving to main lwIP rep
2016-12-17 10:05:49 +01:00
Joel Cunningham
cceea73c3f
bug #49631 : handle zero-window probe and refused_data
...
This commit adds support for responding to a zero-window probe when
the refused_data pointer is set
A zero-window probe is a data segment received when rcv_ann_wnd
is 0. This corrects a standards violation where LwIP would not
respond to a zero-window probe with its current ACK value (RCV.NXT)
when it has refused data, thus leading to the probing TCP closing
out the connection
2016-12-16 09:37:54 -06:00
Thomas Mueller
fcd2daf57c
fixed race condition in return value of netconn_gethostbyname() (and thus also lwip_gethostbyname/_r() and lwip_getaddrinfo())
...
Signed-off-by: sg <goldsimon@gmx.de >
2016-12-16 15:44:00 +01:00
Dirk Ziegelmeier
b5f51dbd0c
ND6: Don't misuse ip6_current_dest_addr() to create an aligned copy of an IPv6 address
...
We never know what side effect in application code this could trigger...
2016-12-16 08:51:06 +01:00
sg
d9f461e4e4
Fixed #49848 (Non-blocking socket emit a sock error while read return EWOULDBLOCK) especially for EWOULDBLOCK (added task #14275 for the general problem)
2016-12-15 22:32:46 +01:00
sg
c13a43e5c8
added note about afl-fuzz requiring linux
2016-12-15 21:42:46 +01:00
sg
844c201702
added fuzz tests (moved from contrib/ports/unix/fuzz to get them to a more prominent place, even if afl-fuzz still needs *nix to run)
2016-12-15 21:39:46 +01:00
sg
62e340067e
LWIP_HOOK_TCP_ISN: added CHANGELOG/fixed comment
2016-12-15 21:08:12 +01:00
David van Moolenbroek
a8b986bbb6
Add hook for TCP Initial Sequence Number generation
...
lwIP produces a TCP Initial Sequence Number (ISN) for each new TCP
connection. The current algorithm is simple and predictable however.
The result is that lwIP TCP connections may be the target of TCP
spoofing attacks. The problem of such attacks is well known, and a
recommended ISN generation algorithm is standardized in RFC 6528.
This algorithm requires a high-resolution timer and cryptographic
hashing function, though. The implementation (or best-effort
approximation) of both of these aspects is well beyond the scope of
lwIP itself.
For that reason, this patch adds LWIP_HOOK_TCP_ISN, a hook that
allows each platform to implement its own ISN generation using
locally available means. The hook provides full flexibility, in
that the hook may generate anything from a simple random number
(by being set to LWIP_RAND()) to a full RFC 6528 implementation.
Implementation note:
Users of the hook would typically declare the function prototype of
the hook function in arch/cc.h, as this is the last place where such
prototypes can be supplied. However, at that point, the ip_addr_t
type has not yet been defined. For that reason, this patch removes
the leading underscore from "struct _ip_addr", so that a prototype
of the hook function can use "struct ip_addr" instead of "ip_addr_t".
Signed-off-by: sg <goldsimon@gmx.de >
2016-12-15 20:18:08 +01:00
goldsimon
da15132aa0
Make nd6_new_router() handle already existing routers (this is a special case for 2 netifs on the same subnet - e.g. wifi and cable) see bug #46506
2016-12-15 09:25:44 +01:00
Axel Lin
e3925cc359
nd6: Fix build error if LWIP_ND6_RDNSS_MAX_DNS_SERVERS == 0
...
Fix below build error when LWIP_ND6_RDNSS_MAX_DNS_SERVERS == 0
../../../../lwip/src/core/ipv6/nd6.c: In function ‘nd6_input’:
../../../../lwip/src/core/ipv6/nd6.c:400:10: error: unused variable ‘rdnss_server_idx’ [-Werror=unused-variable]
u8_t rdnss_server_idx = 0;
^~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors
../Common.mk:93: recipe for target 'nd6.o' failed
make: *** [nd6.o] Error 1
Fixes: 6b1950ec24 ("nd6: add support for RDNSS option (as per RFC 6106)")
Signed-off-by: Axel Lin <axel.lin@ingics.com >
2016-12-15 08:11:34 +01:00
sg
6b1950ec24
nd6: add support for RDNSS option (as per RFC 6106)
2016-12-14 22:12:14 +01:00
sg
4e3cf61571
opt.h: added LWIP_DHCP_MAX_DNS_SERVERS to configure the maximum number of DNS servers configured from dhcp.c(v4) (if any; guarded with LWIP_DNS)
2016-12-14 22:04:08 +01:00
sg
53b9f2a5bd
dhcp: covert DHCP_OPTION_IDX_* from defines to enum (mainly to ease offset calculation)
2016-12-14 21:56:39 +01:00
David van Moolenbroek
cd5dfa2bc5
nd6: minor 'static' consistency fix
2016-12-14 21:25:55 +01:00
sg
bd1defc1d8
added forgoten new file nd6_priv.h :-(
2016-12-14 21:24:48 +01:00
sg
281ef5d094
minor: fixed errors in some defined __DOXYGEN__ guards
2016-12-14 21:18:50 +01:00
sg
e8461f9994
minor: corrected include guard name in tcp_priv.h
2016-12-14 21:05:22 +01:00
sg
60cd25c6a1
Moved nd6 implementation details to new file nd6_priv.h (possible after David's cleanups)
2016-12-14 21:04:53 +01:00
sg
4c16ea920c
Minor: nd6_packet_send_check() -> nd6_get_next_hop_addr_or_queue() (too long, but a little more self-explaining); cosmetics...
2016-12-14 20:52:44 +01:00
David van Moolenbroek
69a7039f75
nd6: centralize link-local packet send decision
...
Previously, ethip6 and lowpan6 each had their own copy of code that
used internal nd6 data structures to decide whether to send a packet
on the local link right away, or queue it while nd6 performed local
address resolution. This patch moves that code into nd6, thereby
eliminating all remaining cases of external access to internal nd6
data structures, as well as the need to expose two specific nd6
functions.
As a side effect, the patch effectively fixes two bugs in the lowpan6
code that were already fixed in the ethip6 code.
2016-12-14 20:19:50 +01:00
David van Moolenbroek
06ff89cbe4
nd6: use default_router_list internally only
...
This patch rearranges the code division between nd6.c and ip6.c such
that the latter does not need to access ND6-internal data structures
(specifically, "default_router_list") directly anymore.
2016-12-14 20:16:38 +01:00
David van Moolenbroek
cee59ba8cd
nd6: add nd6_clear_destination_cache() function
...
The new function, while currently not used internally, allows external
code to clear the ND destination cache in the case that it may have
become inconsistent with the current situation, for example as the
result of a change of locally assigned addresses, or a change in
routing tables implemented through the LWIP_HOOK_ND6_GET_GW hook.
2016-12-14 20:12:40 +01:00
goldsimon
d4fad5929c
nd6_input(): allow using NA without lladdr_opt for DAD
2016-12-14 13:11:13 +01:00
goldsimon
1a53c106e1
CHANGELOG: added LWIP_HOOK_ND6_GET_GW()
2016-12-14 08:42:11 +01:00
David van Moolenbroek
7d119fd86b
nd6: add LWIP_HOOK_ND6_GET_GW hook
2016-12-14 08:36:57 +01:00
goldsimon
74a5537e15
Revert "Added LWIP_HOOK_ETHIP6_GET_GW()"
...
This reverts commit 86b01e4f29 .
2016-12-14 08:36:47 +01:00
goldsimon
afb21603dc
Add a check for correct implementation of LWIP_CONST_CAST() to lwip_init()
2016-12-14 08:31:09 +01:00
David van Moolenbroek
002e077dbd
ethip6: forward correct error code
...
On failure, nd6_get_next_hop_entry() returns an ERR_ type negative
error code. ethip6_output() erroneously assumed that that error would
always be ERR_MEM, even though it may also be ERR_RTE in practice.
With this patch, ethip6_output() simply forwards the returned error.
2016-12-14 08:29:36 +01:00
sg
9d199a6d72
netif_create_ip6_linklocal_address(): use macros to assign address state to ensure callbacks are triggered; netif_add_ip6_address(): only overwrite invalid addresses, not tentative addresses
2016-12-13 21:54:49 +01:00
Pradip De
86b01e4f29
Added LWIP_HOOK_ETHIP6_GET_GW()
...
Signed-off-by: sg <goldsimon@gmx.de >
2016-12-13 21:53:07 +01:00
Dirk Ziegelmeier
1c184da615
Update changelog for LWIP_NETIF_TX_SINGLE_PBUF
2016-12-13 18:48:26 +01:00
Dirk Ziegelmeier
e5f9f187ad
Continue to fix incorrect casts via size_t for some platforms
...
Now also for casts:
- to remove alignment warnings
- casts between pointers and ints
2016-12-12 10:17:33 +01:00
Dirk Ziegelmeier
f2a5aa2866
Fix bug #49827 : wrong cast to size_t on 16-bit x86 architecture
...
I hope I caught all of them.
TODO: Same for casts to get rid of alignment warnings, these are also casts via size_t
2016-12-12 10:07:00 +01:00
Dirk Ziegelmeier
7a1b38db6e
Minor: Save an #ifdef in ip4_frag.c
2016-12-09 21:26:53 +01:00
Dirk Ziegelmeier
26e02e84a6
Fix bug #48963 : ip6_frag does not support LWIP_NETIF_TX_SINGLE_PBUF
...
Implemented.
2016-12-09 21:26:21 +01:00
Dirk Ziegelmeier
8347d3b623
Try to fix compile warning with GCC under Linux ("large integer implicitly truncated to unsigned type")
2016-12-09 19:56:29 +01:00
Sylvain Rochet
a83c4e0897
PPP: fix build warning on wrong cast from void* to unsigned long
...
ppp/utils.c: In function 'ppp_vslprintf':
ppp/utils.c:251:12: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast]
val = (unsigned long) va_arg(args, void *);
^
This is because a void* type is casted into an unsigned long type,
which obviously isn't correct on LLP64 systems such as Windows.
Actually, we are not using %p, thus we remove %p support completely
instead of trying to fix the issue in unused code.
2016-12-09 14:25:47 +01:00
goldsimon
ac4d994249
mdns.c: use group initializer constants from prot/dns.h
2016-12-09 13:10:12 +01:00
goldsimon
f308694dd4
Revert "mdns.c: use constants from dns.h/.c"
...
This reverts commit 0e883bbbc5 .
2016-12-09 13:08:00 +01:00
goldsimon
0e883bbbc5
mdns.c: use constants from dns.h/.c
2016-12-09 12:49:49 +01:00
goldsimon
5774fdfe75
dns: added one-shot multicast DNS queries
2016-12-09 09:20:46 +01:00
Dirk Ziegelmeier
85817e7611
Minor documentation update about IP_ADDR_ANY
2016-12-08 16:56:19 +01:00
Dirk Ziegelmeier
a2ad9d36ca
Improve documentation: Refer to compiler/platform abstraction in NO_SYS mode description
2016-12-08 15:25:38 +01:00
Dirk Ziegelmeier
33bdf9fa76
Doxygen: Fix project description text
2016-12-08 13:38:17 +01:00
Dirk Ziegelmeier
55fd567a84
Adapt doxygen docs version number
2016-12-08 13:37:01 +01:00
Dirk Ziegelmeier
b359b8c3e0
Minor documentation improvement
2016-12-08 13:35:34 +01:00
Dirk Ziegelmeier
bb6df52ed5
Fix doxygen parsing in my last commit
2016-12-08 12:47:30 +01:00
Dirk Ziegelmeier
8a9ab9968c
Improve documentation: add compiler abstraction macros to doxygen docs
2016-12-08 12:45:21 +01:00
Dirk Ziegelmeier
a420d2530f
arch.h: Add hint for struct packing #defines on GCC/clang
2016-12-08 11:13:51 +01:00
Dirk Ziegelmeier
89cb7b7aa1
Try to remove #include <stdlib.h> from many files. Does not seem necessary any more and might cause problems when porting lwIP.
2016-12-08 11:05:01 +01:00
goldsimon
9c3bbcf4e6
removed old disabled code
2016-12-08 10:24:56 +01:00
Dirk Ziegelmeier
f446194c8a
pppos.c: Use arch.h to get size_t instead of including stddef.h
2016-12-07 22:29:24 +01:00
Dirk Ziegelmeier
1dd563a0ae
arch.h: Implement possibility to provide own header for size_t, default is stddef.h
2016-12-07 22:27:57 +01:00
Dirk Ziegelmeier
aae0fc4908
Use new IPv6 init macro in netif.c
2016-12-07 22:19:37 +01:00
Dirk Ziegelmeier
5bb83301dd
Add macro to init an IPv6 address with U32 in host byte order
2016-12-07 22:19:16 +01:00
Dirk Ziegelmeier
0ca82df062
Cleanup byte order handling a bit.
...
- Create LWIP_MAKEU32(a,b,c,d) to create an U32 value from bytes
- Use PP_HTONL() in some macros to emphasize network byte order conversion
2016-12-07 20:18:58 +01:00
goldsimon
ff3656f4f5
Added improved macros for ip address initialization: IPADDR4_INIT_BYTES(), IPADDR6_INIT_HOST() and IP4_ADDR_MAKEU32()
2016-12-07 13:06:07 +01:00
goldsimon
b31b0c8148
remove bogus LWIP_MAKE_U16() define and use PP_NTOHS() in ip4.c instead
2016-12-07 12:44:57 +01:00
goldsimon
c87855423c
DNS: added compile-time check for some defines to fit into an u8_t (bug #49658 )
2016-12-07 09:09:45 +01:00
Dirk Ziegelmeier
e00a131160
Fix bug #49778 : sntp_stop does not cancel all timers
...
Patch by Ari Suutari
2016-12-06 20:29:12 +01:00
Dirk Ziegelmeier
cb29a49a64
Update CHANGELOG
2016-12-06 11:39:03 +01:00
Axel Lin
795acf020e
lwiperf: Simplify #if LWIPERF_CHECK_RX_DATA guard
...
The variable i is equal to q->len after exit the for loop.
Check the received data should not change the logic of update packet_idx.
So let's simplify the code a bit.
Signed-off-by: Axel Lin <axel.lin@ingics.com >
2016-12-06 11:36:25 +01:00
Dirk Ziegelmeier
cc25c2634b
Cleanup: move struct ip6_addr_packed and ip6_addr_p_t type to prot/ip6.h - these types are used in prot/ip6.h and prot/mld6.h
2016-12-06 09:36:36 +01:00
Dirk Ziegelmeier
1687721600
Fix compile when IPv4 is disabled
2016-12-05 22:01:58 +01:00
Dirk Ziegelmeier
a6bc422729
Move declaration of struct ip4_addr_packed and ip4_addr_p_t to prot/ip4.h
...
The types are used in structs declared in ip4.h.
2016-12-05 21:53:43 +01:00
Axel Lin
92183bb354
icmp: Increment mib2.icmpintimeexcds counter if got ICMP_TE
...
Increment mib2.icmpintimeexcds rather than mib2.icmpindestunreachs if got ICMP_TE.
Signed-off-by: Axel Lin <axel.lin@ingics.com >
2016-12-05 12:30:09 +01:00
Sylvain Rochet
bcaf2f08aa
PPP, PPPoS: fix memory leak when disconnecting if there are remaining input bytes
...
Art says:
pppos_input() can call ppp_input() which can call pppos_disconnect() to
disconnect the interface. However, it will continue to read in
characters and allocate a pbuf from the PBUF_POOL and keep it in
pppos->in_head and in_tail. When a re-connect happens and pppos_connect()
is called, this pppos->in_head and in_tail are zeroed, hence a memory
leak. (This happens with PPP_INPROC_IRQ_SAFE not defined.)
A fix would be inside pppos_input() to break out of the loop inputting
characters after calling ppp_input() if pppos->open == 0. Note that
the loop is not even entered if pppos->open == 0.
ppp_input(ppp, inp);
if(pppos->open == 0) //get out if they disconnected
break;
Fix it in a similar way which doesn't add new code by moving the
existing pppos->open check inside the byte loop.
2016-12-03 16:12:51 +01:00
Dirk Ziegelmeier
4bbed75cc4
Minor code layout cleanup in err.c and errno.h
2016-12-01 08:55:01 +01:00
Joel Cunningham
7d0aeaf539
Doc: correct minor mis-spelling in sys_arch.txt
...
This corrects a minor mis-spelling where "by" was mis-spelled as "ny"
2016-11-30 10:28:38 -06:00
Joel Cunningham
f28e63b2a3
Add netifapi macros for set link up/down
...
This commit extends the netifapi macros to support netif_set_link_up
and netif_set_link_down
2016-11-30 08:49:23 -06:00
Joel Cunningham
7f48289fcd
Increment ip.drop when dropping due to NULL netif
...
This commit increments the ip.drop statistic when an IP packet is
dropped due to no matching netif found and forwarding is disabled
This adds parity to the other places where mib2.ipinaddrerrors and
mib2.ipindiscards are incremented which also increment ip.drop
2016-11-30 08:49:22 -06:00
Axel Lin
12e35c4c12
mdns: Fix assertion message in mdns_resp_add_service_txtitem()
...
So we know which function emits the assertion.
Signed-off-by: Axel Lin <axel.lin@ingics.com >
2016-11-30 11:36:05 +01:00
Dirk Ziegelmeier
182d7c138a
Add #include <stddef.h> to a central place (arch.h) instead of #including it in several other files throughout lwip since size_t is needed in many places
...
See http://lwip.100.n7.nabble.com/Issue-in-arch-h-for-lwIP-2-0-0-td27948.html
2016-11-30 07:43:59 +01:00
Dirk Ziegelmeier
47fd67a35c
Remove TODO comments and one check from sockets.c indicating IPV6_V6ONLY socket option handling does not work
2016-11-28 15:56:59 +01:00
goldsimon
b934c3f471
fixed bug #49726 : setsockopt() set TCP_NODELAY TCP_KEEPALIVE ... with a listen state TCP will crash
2016-11-28 15:50:59 +01:00
goldsimon
2a882b6387
minor: fixed indent
2016-11-28 12:54:17 +01:00
goldsimon
ca9342c549
fixed bug #49725 (send-timeout: netwonn_write() can return ERR_OK without all bytes being written)
2016-11-28 12:51:45 +01:00
goldsimon
6f1304e03e
patch by Ambroz Bizjak: fixed bug #49717 (window size in received SYN and SYN-ACK assumed scaled)
2016-11-28 10:27:21 +01:00
Axel Lin
cac3dc8a46
netif: Trivial indent fix
...
Signed-off-by: Axel Lin <axel.lin@ingics.com >
2016-11-28 10:24:23 +01:00
Dirk Ziegelmeier
aea872431c
Fix naming of some inet_addr_* macros in inet.h
...
From inet4_addr_* to inet_addr_* - inet_addr is a "known word", don't change it
2016-11-25 22:13:12 +01:00
Axel Lin
1d4cbe768d
netif: Add proper lock protect for accessing netif->loop_first
...
All the reset part of the code accessing netif->loop_first has lock protection,
the only missing part is "while (netif->loop_first != NULL)".
Fix it by adding lock protect around the while loop.
Also convert the code to use while{} loop instead of do .. while{} loop,
then we can avoid NULL test for in pointer in each loop and reduce a level of indent.
Signed-off-by: Axel Lin <axel.lin@ingics.com >
2016-11-25 13:02:23 +01:00
goldsimon
0e07ed4b13
fixed bug #49676 (Possible endless loop when parsing dhcp options) & added unit test for that
2016-11-25 10:03:43 +01:00
Richard Sailer
2ed755764e
doxygen/generate.sh: Add shebang line
...
This file had the x bit set.
But executing it produced an error, since it was
missing the "#!/bin/sh" line.
This patch adds the "#!/bin/sh" line and makes generate.sh directly executable.
2016-11-25 09:12:40 +01:00
goldsimon
f419231dc3
fixed typo in CHANGELOG
2016-11-24 11:31:46 +01:00
Ambroz Bizjak
8ba7363d11
Optimize passing contiguous nocopy buffers to tcp_write
...
While TCP_OVERSIZE works only when tcp_write() is used with
TCP_WRITE_FLAG_COPY, this new code achieves
similar benefits for the use case that the caller manages their own
send buffers and passes successive chunks of those to tcp_write()
without TCP_WRITE_FLAG_COPY.
In particular, if a buffer is passed to
tcp_write() that is adjacent in memory to the previously passed
buffer, it will be combined into the previous ROM pbuf reference
whenever possible, thus extending that ROM pbuf rather than allocating
a new ROM pbuf.
For the aforementioned use case, the advantages of this code are
twofold:
1) fewer ROM pbufs need to be allocated to send the same data, and,
2) the MAC layer gets outgoing TCP packets with shorter pbuf chains.
Original patch by Ambroz Bizjak <ambrop7@gmail.com >
Edited by David van Moolenbroek <david@minix3.org >
Signed-off-by: goldsimon <goldsimon@gmx.de >
2016-11-24 11:27:34 +01:00
goldsimon
4c8620e03b
Added important post-2.0.0 changes to CHANGELOG to keep track of changes for future 2.0.1 release
2016-11-24 11:21:00 +01:00
goldsimon
eb1de78ce1
prepare CHANGELOG for post-2.0.0
2016-11-24 11:12:22 +01:00
Joel Cunningham
5030fa81a0
bug #49684 , api_msg: treat non-blocking ERR_MEM as ERR_WOULDBLOCK
...
This corrects a case in lwip_netconn_do_writemore() where if a
non-blocking socket receives ERR_MEM in a call to tcp_write(), it would
return ERR_MEM, which would result in ENOMEM coming out of the socket
layer
This case can be gracefully handled by returning ERR_WOULDBLOCK since the
socket is already marked as no longer writable and sent_tcp/poll_tcp will
mark the socket as writable again based on available buffer space
This is very similiar to how ERR_MEM is resolved for blocking sockets
2016-11-23 15:03:43 -06:00
Dirk Ziegelmeier
0f87cb92b8
Add note about UDP multicast behavior fix to UPGRADING document
2016-11-23 13:10:16 +01:00
Dirk Ziegelmeier
09547832ba
Fix bug #49662 : UDP layer should filter incoming multicast datagrams against the bound IP address
...
Change lwIP UDP API to match socket behavior. Multicast traffic is now only received on a UDP PCB (and therefore on a UDP socket/netconn) when the PCB is bound to IP_ADDR_ANY.
2016-11-23 12:46:35 +01:00
Sylvain Rochet
8c3c96baf7
PPP, L2TP: fix PPPOL2TP_AUTH_SUPPORT == 0 support
...
Fix compiler warnings on unused parameters and a function signature
mismatch in PPPAPI.
2016-11-22 22:13:24 +01:00
sg
03a9aac157
dns_enqueue(): minor readability improvement: add local variable "age" to store result of subtraction
2016-11-22 21:34:12 +01:00
David van Moolenbroek
68ec20fffc
ipv4/ipv6: restrict loopback-destined traffic
...
Generally speaking, packets with a loopback destination address -
127.0.0.1 for IPv4 and ::1 for IPv6 - should not be accepted on
non-loopback interfaces. For IPv4, this is implied by RFC 1122
Sec. 3.2.1.3. For IPv6, it is mandated by RFC 4291 Sec. 2.5.3.
Failure to perform this filtering may have security implications, as
applications that bind sockets to loopback addresses may not expect
that nodes on the local external network be able to produce traffic
that will arrive at such sockets.
With this patch, lwIP drops packets that are sent to a loopback
address but do not originate from the interface that has the loopback
address assigned to it. This approach works regardless of whether it
is lwIP or the system using it that implements a loopback netif. The
only exception that must be made is for configurations that enable
netif packet loopback but disable the lwIP loopback netif: in that
case, loopback packets are routed across non-loopback netifs and would
thus be lost by the new filter as well.
For IPv6, loopback-destined packets are also no longer forwarded; the
IPv4 forwarding code already had a check for that.
As a small performance improvement, the IPv6 link-local/loopback
address check is now performed only once per packet rather than
repeatedly for every candidate netif.
2016-11-22 20:51:36 +01:00
Dirk Ziegelmeier
4076b12ee9
Revert "Apply patch #9165 : Allowing udp src port to be 0 in cases when we don't care about outgoing port"
...
This reverts commit 31b0237c50 .
2016-11-22 14:35:45 +01:00
David van Moolenbroek
0034abfa45
Always check whether netif_default is NULL
...
In general, netif_default may be NULL, and various places in the code
already check for this case before attempting to dereference the
netif_default pointer. Some places do not perform this check though,
and may cause null pointer dereferences if netif_default is not set.
This patch adds NULL checks to those places as well.
2016-11-21 10:16:28 +01:00
Dirk Ziegelmeier
31b0237c50
Apply patch #9165 : Allowing udp src port to be 0 in cases when we don't care about outgoing port
2016-11-18 08:13:15 +01:00
Dirk Ziegelmeier
9366c0eaab
I decided to keep the "complexity" of handling IPv6 mapped IPv4 addresses out of netconn API.
...
Only socket API understands this address type now.
2016-11-17 12:41:00 +01:00
Dirk Ziegelmeier
5d5eeca008
Once more: Try fix compile with clang
2016-11-17 09:23:57 +01:00
Dirk Ziegelmeier
4b7e0f50b7
Fix indent in api_lib.c
2016-11-17 09:14:29 +01:00
Dirk Ziegelmeier
44e430ebc2
Fix compile with MSVC 2010 and remove handling for IP6_ADDR_ANY in netconn_connect() - IP6_ADDR_ANY does not make sense in connect()
2016-11-17 09:12:38 +01:00
Dirk Ziegelmeier
180ba72a06
Dual-stack: Use IPv6 mapped IPv4 addresses in receive() and getaddr() only in socket API, not in netconn API.
...
It is better to present correct IP types in netconn API.
Netconn API now accepts IPv6 mapped IPv4 addresses as well as IPv6 and IPv4 in send(), bind() and connect(), but does NOT map IPv4 to IPv6 mapped IPv4 in getaddr() and receive() functions.
2016-11-17 08:51:07 +01:00
Dirk Ziegelmeier
792224ead0
Try to fix compile error with clang (found by Erik's Travis-CI)
2016-11-17 08:48:55 +01:00
Dirk Ziegelmeier
e8e853f2cb
Move ICMP6 protocol constants to include/lwip/prot/icmp6
2016-11-16 23:49:44 +01:00
Dirk Ziegelmeier
80a24c0399
raw, udp, tcp connect() does NOT need to match exact IP type - when PCB is bound to IPADDR_ANY_TYPE, it is OK to connect to IPv4 or IPv6
...
This should finally implement task #14187 : Dual Stack sendto with socket APIs
2016-11-16 23:39:43 +01:00
Dirk Ziegelmeier
d026a3954a
Dual-stack fixes in raw/udp/tcp
...
bind() may change IP type when previous type is IPADDR_TYPE_ANY
connect() IP type must exactly match bind IP type
Use correct IPADDRx_ANY type when calling ip_route()
2016-11-16 23:30:19 +01:00
Dirk Ziegelmeier
1712b06a64
Work on dual-stack netconn
...
IPv6 netconns are created as IPADDR_TYPE_ANY raw/udp/tcp PCBs internally
bind, connect and sendto now accept IPv6 mapped IPv4 addresses or IPv4 addresses as argument
getaddr and receive functions now return IPv6 mapped IPv4 addresses instead of IPv4 addresses
This behavior is close to BSD socket API
2016-11-16 22:58:38 +01:00
Dirk Ziegelmeier
010f3550b6
Cleanup macro parameter names
2016-11-16 21:37:41 +01:00
Dirk Ziegelmeier
b70ddf7b54
Cleanup unmap_ipv6_mapped_ipv4() macro
2016-11-16 21:37:41 +01:00
Dirk Ziegelmeier
1dd97e7d53
sockets.c, lwip_sendto(): Remove check whether IP address matches socket type. Is checked in lower layers anyway.
2016-11-16 21:37:41 +01:00
Dirk Ziegelmeier
2f37dc0606
api_msg.c: Partly add support for IPv6 mapped IPv4 addresses
...
- lwip_netconn_do_getaddr(): Convert IPv4 addresses to IPv6 mapped IPv4 addresses
- lwip_netconn_do_send(): Support IPv6 mapped IPv4 addresses
- Not done: connect(), bind()
2016-11-16 21:37:41 +01:00
Dirk Ziegelmeier
c1eb6d8aa4
Minor: Add macros to map/unmap IPv6 mapped IPv4 addresses
2016-11-16 21:37:41 +01:00
Dirk Ziegelmeier
ad17f345e7
mdns: Use strlen to determine string length of strings contained in a struct - padding seems to be applied to these strings, and sizeof() returns the _padded_ size???
...
Found by compiling with CLANG with address sanitizer enabled
2016-11-16 21:01:15 +01:00
Dirk Ziegelmeier
ee7a2f346c
inet.h: Consistently name some inet <-> ipaddr conversion macros
...
They operate on ip4_addr_t, not on ip_addr_t
This should be clearly visible in their names
2016-11-16 20:30:13 +01:00
Dirk Ziegelmeier
b99b7577fc
memp.c: Only check for overflow/underflow if an element could be allocated
...
In other words: Don't dereference NULL pointers
2016-11-16 20:15:51 +01:00
Joel Cunningham
f79eabd24b
bug #49533 : start persist timer when unsent seg can't fit in window
...
This commit returns LwIP to previous behavior where if the next unsent
segment can't be sent due to the current send window, we start the
persist timer. This is done to engage window probing in the case that
the subsequent window update from the receiver is dropped, thus
preventing connection deadlock
This commit refines the previous logic to only target the following case:
1) Next unsent segment doesn't fit within the send window (not
congestion) and there is some room in the window
2) Unacked queue is empty (otherwise data is inflight and the RTO timer
will take care of any dropped window updates)
See commit d8f090a759 (which removed this
behavior) to reference the old logic. The old logic falsely started the
persit timer when the RTO timer was already running.
2016-11-16 09:12:47 -06:00
Roberto Barbieri Carrera
81a32e9b06
Fixed bug #49610 : Sometimes, autoIP fails to reuse the same address
...
Signed-off-by: goldsimon <goldsimon@gmx.de >
2016-11-16 12:24:57 +01:00
Joel Cunningham
6dc3a2108a
WND_SCALE: duplicate define check & doc cleanup
...
This commit cleans up a duplicate #if check for LWIP_WND_SCALE in init.c
which was already under #if LWIP_WND_SCALE
This commit also improves documentation for TCP_WND in the window scaling
case to communicate TCP_WND is always the calculated (scaled) window value,
not the value reported in the TCP header
Our developers were confused by having to set both the window and scaling
factor and only after studying the usage of TCP_WND throughout the code, was
it determined to be the calculated (scaled) window
2016-11-11 16:06:54 -06:00
Dirk Ziegelmeier
f965034366
Fix inconsistent return value in udp_sendto_if() - ERR_RTE should always be returned when there is no available route
2016-11-11 11:13:26 +01:00
Dirk Ziegelmeier
fdcd8f6faf
Fix bug #49578 : lwip_socket_drop_registered_memberships API may not work with LWIP_SOCKET_OFFSET
2016-11-11 11:13:25 +01:00
Erik Ekman
b90682dc8b
Update email address
...
I am leaving Verisure at the end of the month.
2016-11-10 11:19:51 +01:00
Dirk Ziegelmeier
b9dc415178
master: Set version to 2.0.1
2016-11-10 09:59:05 +01:00
Axel Lin
d5dd5241e7
dhcp: Use DHCP_MAX_MSG_LEN_MIN_REQUIRED instead of hard-coded value
...
Signed-off-by: Axel Lin <axel.lin@ingics.com >
2016-11-07 12:36:38 +01:00
Sylvain Rochet
c4eb52dcff
PPP: set protocol_list[] const
...
This array is a constant list of protocols, save some ram space by
adding the const modifier it deserves.
2016-11-06 20:00:31 +01:00
Sylvain Rochet
1e6c4ac017
PPP, IPCP: check that the peer is allowed to use the IP address it wants
...
This is done in the pppd upstream and was disabled because we don't have
the allowed addresses list required for the auth_ip_addr function.
This is mostly necessary for PPP in server mode to prevent the peer to
use the IP address it wants instead of the one we want, which is
currently allowed.
Rewrite auth_ip_addr in a simple way where we forbid PPP peer to use
loopback net, a multicast address or a reserved class address. Added
to that we consider that PPP in server mode with peer required to
authenticate must provide the peer IP address, reject any IP address
wanted by peer different than the one we wanted. This is actually
an allowed addresses "list" of one entry that follows what is done
in the unused auth_ip_addr function.
2016-11-06 17:39:59 +01:00
Sylvain Rochet
b978d17ca0
PPP, IPCP: remove obvious FIXME
...
No-op. This is now unused code and it is pretty self explanatory what
int_option do; it checks that passed parameter is an unsigned integer.
2016-11-06 12:54:26 +01:00
Sylvain Rochet
dde55c6c0e
PPP, IPCP: fix reset state before reconnecting
...
Commit 7df5496e7b revealed a regression introduced in commit 5a71509353
which broke IPCP reset state.
ask_for_local was set to 0 if ouraddr initial value is 0, if
ask_for_local was false go->ouraddr was cleared in reset callback,
commit 5a71509353 breaks it by removing this clearing. This regression
was silent because the whole ppp pcb runtime data was cleared before
reconnecting until commit 7df5496e7b which removed this giant clearing.
Fix it by reintroducing ask_for_local boolean value, with proper initial
value following what unused function ip_check_options do.
Fixes: 7df5496e7b ("PPP, rework initial/reconnect cleanup")
Fixes: 5a71509353 ("PPP, CORE, IPCP: removed useless ask_for_local boolean")
2016-11-05 22:07:04 +01:00
Dirk Ziegelmeier
5d22679c67
Use API function instead of accessing struct members directly
2016-11-05 16:14:11 +01:00
Dirk Ziegelmeier
132dafa3fc
Correct macro parentheses in tcpip_priv.h
2016-11-05 15:15:08 +01:00
Dirk Ziegelmeier
54d76ffd6d
Remove superfluous local variable in raw.c
2016-11-05 15:13:57 +01:00
Dirk Ziegelmeier
b6f32caaad
Fix inet_addr_to_ipaddr_p() macro
2016-11-05 10:51:06 +01:00
David van Moolenbroek
1c9e603299
netif: fix reset of IPv6 addresses in netif_add()
...
Previously, only the state of the first IPv6 address would be reset,
thus possibly keeping other addresses valid (even though zeroed).
2016-11-04 20:18:25 +01:00
Axel Lin
1a7ba24d13
memp: Fix memp_overflow_check_all failure
...
p needs to point to LWIP_MEM_ALIGN(memp_pools[i]->base) otherwise it will cause
assertion in overflow checking.
Fixes: c838e1ed5b ("Implement possibility to declare private memory pools")
Signed-off-by: Axel Lin <axel.lin@ingics.com >
2016-11-04 20:16:24 +01:00
Joel Cunningham
d4384cfac4
Sockets: check external FD_SETSIZE against number of sockets
...
This commit adds a compiler check to verify an external FD_SETSIZE has
enough space to store the configured number of sockets
2016-11-03 08:59:19 -05:00
Erik Ekman
a82ec4499f
memp: Check for null in memp_free
...
When memp_free_pool was split out from memp_free (c838e1ed5b ),
the check for freeing the null pointer was lost.
This resulted in the null value being put back in the list of free
objects, causing all subsequent allocations of that type to fail.
2016-11-03 12:17:01 +01:00
Joel Cunningham
7d8989e3ea
TCP documentation: fix tcp_pbuf_prealloc typo
...
This commit fixes a typo in the tcp_pbuf_prealloc documentation that
used "willo" in place of "will"
2016-11-02 14:10:20 -05:00
Dirk Ziegelmeier
5079e4552c
Document non-standard functions in sys abstraction layer
2016-10-23 10:34:52 +02:00
Axel Lin
e040132d92
PPP, documentation: Fix example code
...
Fix the example code in status_cb() because dns_getserver() returns
const ip_addr_t *.
Signed-off-by: Axel Lin <axel.lin@ingics.com >
2016-10-23 10:00:54 +02:00
David van Moolenbroek
760281207e
mld6: fix conditional checksumming
...
The mld_group structure no longer has a 'netif' field, as such
structures are now linked from the corresponding netif structure.
For conditional checksumming, use the calling function's netif
reference instead.
2016-10-23 10:00:47 +02:00
Axel Lin
20fde0be6c
ip4_frag: Use LWIP_MIN instead of open-coded
...
Signed-off-by: Axel Lin <axel.lin@ingics.com >
2016-10-19 08:37:39 +02:00
Dirk Ziegelmeier
67895e7bdd
Fixup new IPv4 fragmentation code - thanks to Zach Smith
2016-10-19 08:36:43 +02:00
Dirk Ziegelmeier
801f26ee0c
Minor documentation update
2016-10-16 19:07:55 +02:00
Axel Lin
4dffe521a3
api_msg.c: Trivial code cleanup
...
Slightly improve readability by testing apiflags with NETCONN_DONTBLOCK.
Also remove an empty else clause.
Signed-off-by: Axel Lin <axel.lin@ingics.com >
2016-10-14 09:20:10 +02:00
Dirk Ziegelmeier
f5f8ab5acf
Fix bug #49328 : Crash error in ip6_frag due to Assertion Fail
2016-10-13 08:50:47 +02:00
Dirk Ziegelmeier
e3a9f01fe4
Implement task #14180 : IPv6 code should not reuse ip6_current_dest_addr() as temporary storage
2016-10-12 21:41:02 +02:00
Dirk Ziegelmeier
37d5691b19
Fix bug #49321 : error.h missing opening "#ifdef __cplusplus"
...
Reported by Martin Kortmann
2016-10-12 07:37:39 +02:00
Erik Ekman
725feb0d4a
mdns: Use netif_get/set_client_data helpers
2016-10-11 11:34:59 +02:00
goldsimon
6edde498e3
pbuf_copy: try to fix GCC const warning
2016-10-11 09:52:44 +02:00
goldsimon
d5bfec2e52
ip4_frag: restore "lwip_ntohs" after last change
2016-10-11 09:52:20 +02:00
goldsimon
576f49ee2b
Fixed bug #46467 : ip_frag() shouldn't modify pbuf in case of a retransmission
2016-10-11 09:47:03 +02:00
goldsimon
697be5c2c3
Make some pbuf functions take const pbuf pointers
2016-10-11 09:23:45 +02:00
Axel Lin
c9cfbe27c1
tcp_out: Remove misleading comment in tcp_pbuf_prealloc()
...
This comment is incorrect since commit 7d0dab9d7d
"partly fixed bug #25882 : TCP hangs on MSS > pcb->snd_wnd
(by not creating segments bigger than half the window)".
Signed-off-by: Axel Lin <axel.lin@ingics.com >
2016-10-11 09:11:47 +02:00
sg
0a343948d9
Fix netconn/socket race condition when receiving RST while waiting on recvmbox
2016-10-10 21:35:07 +02:00
Dirk Ziegelmeier
ed239c4e71
Apply patch #9139 : Invalid format string in dhcp.c
...
by Thomas Mueller
2016-10-10 09:57:07 +02:00
Dirk Ziegelmeier
695c81762c
Minor: Fix comment in etharp.c
2016-10-09 12:28:34 +02:00
Dirk Ziegelmeier
f6e27940bd
Make lwIP compile with clang -Wdocumentation -> several documentation fixes
2016-10-09 12:21:39 +02:00
Dirk Ziegelmeier
9cd555c51a
Minor: documentation typo fix
2016-10-09 10:24:26 +02:00
Dirk Ziegelmeier
4e74ae4bc9
Minor: documentation updates
2016-10-09 10:23:36 +02:00
Dirk Ziegelmeier
5477aa5a42
Minor: Documentation update
2016-10-09 09:41:26 +02:00
Ari Suutari
70ccea9207
Make sys_restart_timeouts public also for !NO_SYS targets
2016-10-07 20:31:15 +02:00
goldsimon
69be49fdc3
Try to fix !defined(LWIP_PROVIDE_ERRNO)
2016-10-07 16:22:33 +02:00
Axel Lin
740182de3c
err: Fixup error code range checking in err_to_errno
...
This also fixes build error in non-debug build because err_strerr is
guarded by LWIP_DEBUG.
Fixes: a1c0a0185b ("bug #48823 : posix errors should be removed from arch.h (to new file 'lwip/errno.h'))"
Signed-off-by: Axel Lin <axel.lin@ingics.com >
2016-10-07 07:41:21 +02:00
Dirk Ziegelmeier
ad3530ee10
One more compile fix in err.c
2016-10-06 20:20:07 +02:00
Dirk Ziegelmeier
86a92543de
Try to fix unix build after Simon's errno changes (need sys_arch.h)
2016-10-06 16:01:32 +02:00
goldsimon
2afc2a52d5
Fix comment on sys_mbox_new() (bug #49279 )
2016-10-06 13:25:11 +02:00
goldsimon
a1c0a0185b
bug #48823 : posix errors should be removed from arch.h (to new file 'lwip/errno.h')
2016-10-06 13:21:00 +02:00
Dirk Ziegelmeier
05419912e0
def.h: Provide hton* / ntoh* functions to users by default for compatibility (can be turned off)
...
Add note to UPGRADING document
2016-10-06 13:13:10 +02:00
Dirk Ziegelmeier
13fb616bb2
Cleanup hton*/ntoh* function handling and platform abstraction
...
Let lwip use functions/macros prefixed by lwip_ internally to avoid naming clashes with external #includes.
Remove over-complicated #define handling in def.h
Make functions easier to override in cc.h. The following is sufficient now (no more LWIP_PLATFORM_BYTESWAP):
#define lwip_htons(x) <your_htons>
#define lwip_htonl(x) <your_htonl>
2016-10-06 12:55:57 +02:00
Dirk Ziegelmeier
0c06073819
Avoid code duplication in def.c
2016-10-06 09:26:59 +02:00
Dirk Ziegelmeier
50e09ccd2c
Add note about new abstactions for itoa(), strnicmp(), stricmp() and strnstr() to UPGRADING document
2016-10-06 09:22:16 +02:00
Dirk Ziegelmeier
fa211096c2
Fix macro name clash with windows headers in TFTP server
...
Reported by Gisle Vanem
2016-10-05 21:02:46 +02:00
Axel Lin
87172d6d35
mdns: Use NETIF_TO_HOST at appropriate places
...
Trivial cleanup, use NETIF_TO_HOST macro to get mdns_host from netif.
Signed-off-by: Axel Lin <axel.lin@ingics.com >
2016-10-05 11:23:08 +02:00
Elias Reichart
60a507f88b
ETHARP_TABLE_MATCH_NETIF is also used in the etharp_output shortcut
2016-10-04 22:15:59 +02:00
David van Moolenbroek
0d7805a86a
tcp: fix FIN ACK handling with unsent data
...
TCP's snd_nxt represents the next sequence number after sent data, and
as such does not cover any unsent data queued on the connection. The
current implementation does not take the latter point into account
when processing FIN acknowledgments, mistakenly assuming that an
outgoing FIN is ACK'ed when the acknowledgment covers up to snd_nxt
while there is still unsent data. This patch adds a check for unsent
data to correct this, effectively preventing that TCP connections are
closed prematurely.
2016-10-04 22:12:13 +02:00
David van Moolenbroek
9ba9dee2aa
tcp: advance next seq nr for zero window probes
...
It is possible that the byte sent as a zero window probe is accepted
and acknowledged by the receiver side without the window being opened.
In that case, the stream has effectively advanced by one byte, and
since lwIP did not take this into account on the sender side, the
result was a desynchronization between the sender and the receiver.
That situation could occur even on a lwIP loopback device, after
filling up the receiver side's receive buffer, and resulted in an ACK
storm. This patch corrects the problem by advancing the sender's next
sequence number by one as needed when sending a zero window probe.
2016-10-04 22:06:05 +02:00
Dirk Ziegelmeier
95754ba95a
Another try to fix bug #49264 : Crash Error when LWIP_SOCKET_OFFSET is in use
2016-10-04 14:05:56 +02:00
Dirk Ziegelmeier
bef7873042
ND6: Always set neighbor_cache.state together with counter value to avoid inconsistency
2016-10-04 13:59:05 +02:00
Dirk Ziegelmeier
ec236da972
Add comment for my last changes
2016-10-04 13:36:30 +02:00
Dirk Ziegelmeier
ee27daffc4
Fix bug #48876 : nd6: timers should be in ticks, not ms
...
delay_time and stale_time are ticks now.
reachable_time and invalidation_timer are untouched since they may originate from telegram values -> not converting them to ticks avoids an integer division
2016-10-04 13:30:23 +02:00
goldsimon
cdc97d2779
Correctly fix bug #49209 : netconn_drain() fails to handle 'netconn_aborted' pointer
2016-10-04 12:35:51 +02:00
goldsimon
d9c6badc55
Revert "Fixed bug #49209 : netconn_drain() fails to handle 'netconn_aborted' pointer"
...
This reverts commit 0e2354e658 .
2016-10-04 12:35:50 +02:00
Dirk Ziegelmeier
30251b1404
Fix bug #49264 : Crash Error when LWIP_SOCKET_OFFSET is in use
...
Handle LWIP_SOCKET_OFFSET in lwip_socket_drop_registered_memberships, lwip_socket_unregister_membership and lwip_socket_register_membership.
2016-10-04 12:34:53 +02:00
Dirk Ziegelmeier
d1ed89b2e4
Fix accidental TAB in tftp_server.h
2016-10-04 10:31:43 +02:00
Dirk Ziegelmeier
81549578bf
Fix compile of TFTP with MSVC
2016-10-04 08:54:52 +02:00
Dirk Ziegelmeier
f8683499a6
TFTP: Add missing newline at end of file
2016-10-03 14:33:57 +02:00
Dirk Ziegelmeier
1e5efee7cb
TFTP server depends on UDP
2016-10-03 09:50:34 +02:00
Dirk Ziegelmeier
b040544628
task #14150 : Add TFTP server from Logan Gunthorpe
...
Originally written by Logan Gunthorpe, modifications/fixes/IPv6 by Dirk Ziegelmeier
2016-10-03 09:47:41 +02:00
Dirk Ziegelmeier
eb77c839fc
Minor: comment in pbuf.c
2016-10-03 09:45:59 +02:00
Axel Lin
5e15125b3d
igmp: Fix optimized code by always skipping the first entry in the linked groups list
...
commit 8c52afb6ca ("igmp: Optimize code by always skipping the first entry in the linked groups list - it is always the "allsystems" entry")
accidently changes the code logic. it should check groupref rather than group.
Signed-off-by: Axel Lin <axel.lin@ingics.com >
2016-10-02 19:36:59 +02:00
Dirk Ziegelmeier
8f8f56914b
Fix bug #47731 : IGMP state transition missing
...
Set state variable according to RFC 2236 on timeout in delaying member state
2016-10-01 21:27:00 +02:00
Dirk Ziegelmeier
b33070e0cf
Add documentation for bug #49139 : IGMP "All Systems" vs MLD "All Nodes" inconsistency
2016-10-01 21:13:05 +02:00
Dirk Ziegelmeier
8c52afb6ca
igmp: Optimize code by always skipping the first entry in the linked groups list - it is always the "allsystems" entry
2016-10-01 17:28:36 +02:00
Dirk Ziegelmeier
df5a79966d
Fix bug #48886 : raw pcbs are not handled on netif address change
2016-10-01 17:13:33 +02:00
Dirk Ziegelmeier
d7f8d33506
Minor: update NO_SYS_SampleCode.c for IPv6
2016-09-30 09:35:27 +02:00
Dirk Ziegelmeier
db9c866fff
Minor: Documentation update
2016-09-30 09:05:33 +02:00
Dirk Ziegelmeier
149701b347
Fix bug #49218 : pbuf_clen() overflow as a result of tcp_write concatenation
...
Let pbuf_clen() return u16_t
2016-09-30 09:04:36 +02:00
Dirk Ziegelmeier
682b82aad8
Improve documentation: Some words about multiple execution contexts in lwIP
2016-09-29 12:51:45 +02:00
Dirk Ziegelmeier
65796cd827
"Fix" bug #49078 : lwip cannot establish ipv6 connection, because of failed to fill ipv6 source address in Neighbor Solicitation Message by adding a note to netif_add not to forget to create a link-local IPv6 address
2016-09-29 12:02:50 +02:00
Dirk Ziegelmeier
40846260b5
Add comment about possible definitions for non-standard functions
2016-09-29 10:44:53 +02:00
Dirk Ziegelmeier
af04864094
Remove non-standard strnlen() call in snmp_msg.c
2016-09-29 08:30:33 +02:00
Dirk Ziegelmeier
5ddd2aef4b
Substitute custom itoa implementation mdns by lwip_itoa() and strlen() call
2016-09-29 08:25:57 +02:00
Dirk Ziegelmeier
17e6c9dd02
Add #include <string.h> in def.c since lwip_strnstr uses strlen and strcmp
2016-09-29 08:08:26 +02:00
Dirk Ziegelmeier
0e7f48d81c
Fix compile of new functions in def.c - I accidentally put them in a #ifdef section
...
Thanks to Daniel Elstner
2016-09-28 22:26:55 +02:00
Dirk Ziegelmeier
461b3531c7
httpd.c: add missing default in case statement
2016-09-28 22:05:52 +02:00
Dirk Ziegelmeier
4144d54642
Fix implementation of lwip_itoa to take more parameters
2016-09-28 22:05:18 +02:00
Dirk Ziegelmeier
837b7b3f98
Fix comment in my last commit
2016-09-28 21:55:29 +02:00
Dirk Ziegelmeier
1f68b32485
Cleanup handling of non-standard functions in lwIP
...
- itoa
- strnicmp, stricmp/strcasecmp
- strnstr
Related to patch #9115 : httpd.c: strcasecmp for GCC and stricmp for Windows
2016-09-28 21:52:11 +02:00
Dirk Ziegelmeier
f8d19e28de
Minor: Documentation updates
2016-09-28 20:58:02 +02:00
Erik Ekman
f3cec74bd6
mdns: Use macro to get mdns_host from netif v2
...
Add missing )
2016-09-28 18:15:11 +02:00
Erik Ekman
87e815030c
mdns: Use macro to get mdns_host from netif
2016-09-28 18:00:48 +02:00
Erik Ekman
78498981e2
mdns: Update error message after argument type changed
...
Method argument is no longer netif, but a mdns_host
2016-09-28 18:00:44 +02:00
Dirk Ziegelmeier
633696c153
Implement consistent IPx_ADDR_ANYx macro naming between IPv4 and IPv6
...
- rename IP4_ADDR_ANY to IP4_ADDR_ANY4
- IP4_ADDR_ANY (= IP_ADDR_ANY) is now IPv4 any address in ip_addr_t format
2016-09-28 12:56:57 +02:00
goldsimon
0e2354e658
Fixed bug #49209 : netconn_drain() fails to handle 'netconn_aborted' pointer
2016-09-28 12:53:07 +02:00
Dirk Ziegelmeier
5d811d799c
Minor: Documentation updates
2016-09-27 21:18:03 +02:00
Dirk Ziegelmeier
6abcd00f71
Convert IP address type numbers to an enum to improve documentation
2016-09-27 09:46:51 +02:00
Dirk Ziegelmeier
97b774ceb9
Minor: Documentation updates
2016-09-26 21:45:29 +02:00
Daniel Elstner
2f085aa441
ND6: Join/leave groups directly on the netif
2016-09-26 11:44:00 +02:00
Daniel Elstner
354e385453
Fix infinite loop in new MLD6 code
2016-09-26 11:43:59 +02:00
Dirk Ziegelmeier
c7c6b7ce93
Rework IGMP and MLD6 code to store group info per-netif.
...
Reasoning:
- Makes code in single-netif case perform better and smaller
- IGMP / MLD6 code is a little bit easier to read and understand
- Easier to get multicast groups per netif when implementing drivers
Downside: In multi-netif mode, there are two more pointers on each netif, even if IGMP/MLD6 is not used on it. But these systems should not be so memory-constrained that this will matter.
2016-09-21 13:33:33 +02:00
Dirk Ziegelmeier
c25de8f317
Update comment in MDNS and pbuf.c
2016-09-21 12:37:31 +02:00
Daniel Elstner
c9bae5ea9b
Fix bug #49134 : Do not announce invalid IPv4 address via mDNS
...
In a dual stack configuration it is not really feasible to wait
until the IPv4 address is valid before starting the mDNS responder.
If there is no DHCPv4 server in the network, the IPv4 address may
never become valid, which should however not preclude IPv6 mDNS
from working.
2016-09-21 12:31:13 +02:00
Dirk Ziegelmeier
dbd847b70c
Fix bugfix for bug #49136 : No SNMPv2 SetRequest response when OID does not exist
...
Last commit broke SNMPv1 answers
2016-09-20 14:28:40 +02:00
Dirk Ziegelmeier
19e2780656
Fix bug #49136 : No SNMPv2 SetRequest response when OID does not exist
2016-09-20 14:06:20 +02:00
Dirk Ziegelmeier
eb3a08308d
Improve my last docs
2016-09-20 09:14:32 +02:00
Dirk Ziegelmeier
470dae613e
Documentation: Add example for zero-copy RX using custom PBUF
2016-09-20 09:03:49 +02:00
Daniel Elstner
22907c7b27
bug #74921 : check prefix_length, not length
2016-09-19 18:38:05 +02:00
Dirk Ziegelmeier
623f9ce046
Remove one debug message from Daniel's patch
2016-09-19 12:32:43 +02:00
Daniel Elstner
4d4710dadf
Bug #49125 addendum: Remove group from list before callback
...
When leaving a multicast group, remove the group from the list
before invoking the MAC filter callback. This avoids the need
for the callee to skip over the group that is about to be deleted.
2016-09-19 12:26:51 +02:00
Dirk Ziegelmeier
2facd2d64d
Apply modified patch from Daniel Elstner to fix bug #49124 : mDNS should not use snprintf()
2016-09-19 12:20:20 +02:00
Dirk Ziegelmeier
ee4cd45c98
Fix bug #49125 : Need a way to iterate multicast groups for MAC filtering
...
-> let list heads be a public symbol
2016-09-19 08:45:57 +02:00
Dirk Ziegelmeier
58c8e0f8ca
Implement request by Marco Veeneman: Make snmp_send_trap() public
2016-09-15 10:41:05 +02:00
Dirk Ziegelmeier
8dbd1abdc4
Minor coding style fixes while reading SNMP code
2016-09-12 12:55:24 +02:00
Dirk Ziegelmeier
ef0dc65515
Fix GCC warning "invalid suffix on literal; C++11 requires a space between literal and string macro" in arch.h. Pointed out by Thomas Nittel.
2016-09-12 07:38:06 +02:00
Dirk Ziegelmeier
8cd43a3dd9
Documentation: Add one more note PCB is already freed in tcp_err callback.
2016-09-09 17:36:49 +02:00
Erik Ekman
4a73bcbc65
mdns: Revert answer count patch
...
Answers written to outpackets can be additional answers
or normal answers to questions.
2016-09-09 17:04:12 +02:00
Axel Lin
f38705c38c
mdns: Update answers counter in mdns_add_answer rather than each caller
...
This simplifies the code and less error prone.
Signed-off-by: Axel Lin <axel.lin@ingics.com >
2016-09-09 16:42:49 +02:00
Joel Cunningham
b7c2553b46
bug #48964 : Make PBUF_POOL sanity checks contingent on PBUF_POOL_SIZE
...
This commit adds support to the sanity checks in init.c to ensure that
PBUF_POOL is in use
In ports with drivers/netifs that use PBUF_REF for the RX pathway, there
is no need for the PBUF_POOL memory pool. This allows the port to define
PBUF_POOL_SIZE to 0
2016-09-07 09:11:19 -05:00
Axel Lin
f8a95aa27f
dns: Drop unnecessary txid variable in dns_check_entry
...
Signed-off-by: Axel Lin <axel.lin@ingics.com >
2016-09-07 14:56:01 +02:00
Dirk Ziegelmeier
d66442ba91
Fix compile when TCP, UDP and RAW are disabled
2016-09-07 08:11:30 +02:00
Dirk Ziegelmeier
aeae4e91db
Fix compile when UDP is disabled
2016-09-06 12:30:15 +02:00
sg
34682facd1
Remove ip4_frag IP_FRAG_USES_STATIC_BUF code: nearly the same as the other code, but IP_FRAG_USES_STATIC_BUF doesn't work when queuing pbufs
2016-08-31 21:00:10 +02:00
Dirk Ziegelmeier
ac6b64cf66
Implement a more readable fix for pbuf_memcmp than my last fix
2016-08-31 20:24:37 +02:00
Dirk Ziegelmeier
b944ceb89d
Fix compile when LWIP_NUM_NETIF_CLIENT_DATA == 0 and AUTOIP or DHCP are enabled
2016-08-31 20:17:04 +02:00
Axel Lin
ab8a1a0430
netbuf: Fixup a copule LWIP_ERROR messages
...
Fix trivial copy-n-paste mistake.
Signed-off-by: Axel Lin <axel.lin@ingics.com >
Signed-off-by: Dirk Ziegelmeier <dirk@ziegelmeier.net >
2016-08-31 12:23:12 +02:00
Dirk Ziegelmeier
4325aca0f7
Fix pbuf_memcmp() implementation by using pbuf_try_get_at() instead of pbuf_get_at(). Payload out-of-bounds access was not handled correctly.
2016-08-31 10:35:42 +02:00
sg
23147b0e21
added more out of range checks to dns_recv() (see bug #48924 )
2016-08-30 22:18:10 +02:00
Dirk Ziegelmeier
9078f31544
Minor: memcpy -> MEMCPY / SMEMCPY
2016-08-30 21:56:09 +02:00
sg
a08ed9148d
added pbuf_try_get_at() (much like pbuf_get_at() but can return out-of-pbuf error)
2016-08-30 21:35:37 +02:00
Dirk Ziegelmeier
8d45162a59
Fix usage of uninitialized data in dhcp.c by checking pbuf_copy_partial() return value
2016-08-30 21:33:43 +02:00
Dirk Ziegelmeier
f5135b05d9
Minor coding style fixes in mdns.c
2016-08-30 21:21:32 +02:00
Dirk Ziegelmeier
2137f49d32
Fix usage of uninitialized data in nd6.c because of unchecked pbuf_copy_partial() return value
2016-08-30 21:20:58 +02:00
Dirk Ziegelmeier
aef3d2cb87
Minor coding style fix in pbuf.c
2016-08-30 21:09:24 +02:00
Dirk Ziegelmeier
840d1e60fa
Fix bug #48924 : Potential out of bound reads in DNS codes of lwip project by adding checks for pbuf_copy_partial() return values.
...
Add some comments to clarify handling of untrusted network data handling.
2016-08-30 21:09:24 +02:00
Axel Lin
198fa5dbfa
Remove duplicated include for lwip/inet_chksum.h
...
Include it once is enough.
Signed-off-by: Axel Lin <axel.lin@ingics.com >
Signed-off-by: Dirk Ziegelmeier <dirk@ziegelmeier.net >
2016-08-30 09:47:43 +02:00
Axel Lin
ef827e85b8
apps/mdns: Fixup LWIP_ERROR message in mdns_build_host_domain
...
Signed-off-by: Axel Lin <axel.lin@ingics.com >
Signed-off-by: Dirk Ziegelmeier <dirk@ziegelmeier.net >
2016-08-30 08:35:40 +02:00
Dirk Ziegelmeier
e545262d98
Remove superfluous parameter from mdns_domain_debug_print()
2016-08-29 19:32:39 +02:00
Dirk Ziegelmeier
fb62e9350f
Fix wrong sizeof() and remove superfluous NULL pointer check in MDNS
2016-08-29 19:15:22 +02:00
Axel Lin
db6aa82a10
memp: Fix comment for memp_overflow_check_element_overflow/underflow
...
These functions now take desc rather than memp_type as second parameter.
Signed-off-by: Axel Lin <axel.lin@ingics.com >
2016-08-28 20:33:57 +02:00
Joel Cunningham
c9dff6b5aa
Correct TCP_OOSEQ_MAX_* opt.h documentation
...
This corrects documentation on TCP_OOSEQ_MAX_BYTES and _PBUFS to list
their dependency on TCP_QUEUE_OOSEQ==1 (out of order sequence queueing
enabled) rather than ==0 (disabled)
2016-08-26 09:33:14 -05:00
Dirk Ziegelmeier
4b45baee10
Add some dual-stack notes to documentation
2016-08-26 15:58:18 +02:00
Dirk Ziegelmeier
05a6d82fa1
Let comment in pbuf.h be consistent with provided example function
2016-08-26 15:39:15 +02:00
Dirk Ziegelmeier
0d510dd66d
Add API macros for netif client data handling and update documentation accordingly
2016-08-26 11:21:49 +02:00
Dirk Ziegelmeier
537bd836c9
Minor: More documentation updates
2016-08-25 22:23:11 +02:00
Dirk Ziegelmeier
57468b8a30
Minor: Several documentation updates
2016-08-25 22:04:04 +02:00
sg
452f5d6296
fix tcpip.c for LWIP_TIMERS==0
2016-08-25 21:15:26 +02:00
Dirk Ziegelmeier
2980a12373
Fix ntohs -> htons in ethernet.c
2016-08-25 14:25:16 +02:00
goldsimon
89aa4e7d79
fixed bug #47921 : link-local prefix in router advertisement must not be processes for SLAAC (patch by abhishek ambure)
2016-08-25 14:21:30 +02:00
goldsimon
3e23eb764b
fixed compiling TCP_OOSEQ_MAX_BYTES || TCP_OOSEQ_MAX_PBUFS (local variable 'p' was hidden)
2016-08-25 14:21:29 +02:00
Dirk Ziegelmeier
aeb3834219
Add debug assert to my last commit and improve comment in opt.h
2016-08-25 14:12:49 +02:00
Dirk Ziegelmeier
475d49440c
Fix handling of LWIP_HOOK_VLAN_SET(). Previous implementation supplied uninitialized arguments to the macro (struct eth_hdr).
...
Change macro signature to be universal: netif, pbuf, src, dst, eth_type - whatever the user needs to decide about VLAN header.
Return value <0 means "no VLAN header", 0 <= return_value <= 0xFFFF -> value is prio_vid of header.
Clean up ethernet_output function to be more readable.
2016-08-25 14:07:35 +02:00
Axel Lin
a2ca85a260
tcp: Make tcp_state_str/tcp_backoff/tcp_persist_backoff static
...
They are only referenced in tcp.c, so make them static.
Signed-off-by: Axel Lin <axel.lin@ingics.com >
Signed-off-by: goldsimon <goldsimon@gmx.de >
2016-08-25 11:20:10 +02:00
sg
4c390ad39c
update netif address change triggers to tpc & udp to work with IPv6, too
2016-08-24 20:51:05 +02:00
Erik Ekman
a1db05c11e
Fix const argument warning in netif_ip6_addr_set
...
../../../../../lwip/src/netif/ppp/ppp.c:1276:37: error: passing
'const ip6_addr_t *' (aka 'const struct ip6_addr *') to parameter of type
'ip6_addr_t *' (aka 'struct ip6_addr *') discards qualifiers
[-Werror,-Wincompatible-pointer-types-discards-qualifiers]
netif_ip6_addr_set(pcb->netif, 0, IP6_ADDR_ANY6);
^~~~~~~~~~~~~
../../../../../lwip/src/include/lwip/ip_addr.h:340:24: note: expanded from macro
'IP6_ADDR_ANY6'
^~~~~~~~~~~~~~~~~~~~~~~~~
../../../../../lwip/src/include/lwip/netif.h:436:73: note: passing argument to
parameter 'addr6' here
void netif_ip6_addr_set(struct netif *netif, s8_t addr_idx, ip6_addr_t *addr6);
2016-08-24 14:41:48 +02:00
Axel Lin
bf5866b27d
tcp: Prevents a 0 sized (invalid) backlog
...
commit 44e1a2d8e2 accidently includes below changes in tcp_listen_with_backlog
- tcp_backlog_set(lpcb, backlog);
+ lpcb->backlog = backlog;
Thus pass 0 to the backlog parameter of netconn_listen_with_backlog() fails.
Fixes: 44e1a2d8e2 ("define tcp_backlog_set() as dummy-define when backlog feature is disable")
Signed-off-by: Axel Lin <axel.lin@ingics.com >
Signed-off-by: goldsimon <goldsimon@gmx.de >
2016-08-24 12:20:28 +02:00
goldsimon
298ec340e5
set netif IPv6 address & state via function to implement change triggers (task #13517 )
2016-08-24 09:19:53 +02:00
goldsimon
1ba0e17157
ip6_addr: a valid address is either preferred or deprecated, no need to reserve 3 bits for that
2016-08-24 09:06:48 +02:00
Dirk Ziegelmeier
43ddf6eee6
Fix debug strings in ethernet_output
2016-08-24 08:46:32 +02:00
Dirk Ziegelmeier
8426dfa14d
Remove misleading comments from udp_send() and raw_send(). A pbuf may be added automatically in front of the chain to be able to send PBUF_REFs
2016-08-24 08:45:37 +02:00
Dirk Ziegelmeier
6fc7f84497
Minor: documentation updates
2016-08-24 08:19:51 +02:00
Dirk Ziegelmeier
831b7fc7d3
Add note to pbuf_type about correct TX/RX type selection
2016-08-24 08:09:03 +02:00
Dirk Ziegelmeier
d9b0236525
Fix MDNS did not allocate TX packets from RAM but from POOL
2016-08-24 08:04:04 +02:00
Dirk Ziegelmeier
e78bc41116
Document ethernet level functions
2016-08-24 08:01:36 +02:00
Dirk Ziegelmeier
c719c466b3
Remove SIZEOF_ETHARP_PACKET_TX #define, it is not needed any more after my last cleanups
2016-08-23 20:41:37 +02:00
Dirk Ziegelmeier
31778193da
Work on bug #48868 : Cleanup etharp.c not to use struct eth_hdr: Cleanup etharp_input() to use ethernet_output()
2016-08-23 17:23:21 +02:00
Dirk Ziegelmeier
6caa7b9927
Cleanup etharp_arp_input() signature to match the sig of other input functions (pbuf, netif). Rename to etharp_input()
2016-08-23 17:03:51 +02:00
Dirk Ziegelmeier
979bee386c
Work on bug #48868 : Cleanup etharp.c not to use struct eth_hdr: Cleanup etharp_raw() to use ethernet_output()
2016-08-23 16:58:17 +02:00
Dirk Ziegelmeier
d2f52e19d5
Fix doxygen comment in ethernet.c
2016-08-23 16:09:32 +02:00
Dirk Ziegelmeier
56dc574bed
Fix comment in pbuf layer description
2016-08-23 16:07:48 +02:00
goldsimon
e4c74109cd
fixed bug #47652 : there is always a delay to send the first Neighbor Solicitation for the new add INCOMPLETE state neighbor entry
2016-08-23 15:50:48 +02:00
goldsimon
fd5b34ae43
ip4_forward(): fixed compiling IP_FORWARD_ALLOW_TX_ON_RX_NETIF==1
2016-08-23 15:26:05 +02:00
goldsimon
306171c93b
DHCP: fixed compiling LWIP_DHCP_BOOTP_FILE==1
2016-08-23 15:25:39 +02:00
goldsimon
d99d91dae9
removed ETHARP_TRUST_IP_MAC since it is insecure and we don't need it any more after implementing unicast ARP renewal towards arp entry timeout
2016-08-23 13:00:15 +02:00
Dirk Ziegelmeier
fc54556d80
Code beautification in LWIP_HOOK_UNKNOWN_ETH_PROTOCOL usage
2016-08-23 12:55:21 +02:00
Dirk Ziegelmeier
0d5eea288c
Clarify LWIP_HOOK_UNKNOWN_ETH_PROTOCOL in opt.h
2016-08-23 12:54:29 +02:00
Dirk Ziegelmeier
4456c7d230
Fix regression in etharp.c: Allocate correct pbuf layer
2016-08-23 12:32:57 +02:00
Dirk Ziegelmeier
f170dde1c6
Work on bug #48824 : ethernet.c extensions: Implement hook for unknown ethernet protocols
2016-08-23 10:48:38 +02:00
Dirk Ziegelmeier
bae4d6398c
Fix some comments to reference ethernet_output now
2016-08-23 10:23:59 +02:00
Dirk Ziegelmeier
18136c047b
Work on bug #48824 : ethernet.c extensions: Implement ethernet_output();
...
Fixes bug #48862 : ethip6 does not support setting vlan
2016-08-23 10:15:03 +02:00
Dirk Ziegelmeier
d9eaf6f310
docs: Remove link to example ports again, this should rather go to lwIP wiki...
2016-08-23 09:34:44 +02:00
Axel Lin
42c193821c
netbuf: Use memset to zero the allocated memory for netbuf_new
...
Use memset to zero the allocated memory rather than explicitly init each field.
Signed-off-by: Axel Lin <axel.lin@ingics.com >
Signed-off-by: goldsimon <goldsimon@gmx.de >
2016-08-23 08:59:11 +02:00
Axel Lin
1c5c96a50a
pbuf: Use SYS_ARCH_INC in pbuf_ref()
...
Use SYS_ARCH_INC to simplify the code.
Signed-off-by: Axel Lin <axel.lin@ingics.com >
Signed-off-by: goldsimon <goldsimon@gmx.de >
2016-08-23 08:59:10 +02:00
Axel Lin
40f2bed5c4
mem: Simplify the code for try bigger pool in mem_malloc
...
Signed-off-by: Axel Lin <axel.lin@ingics.com >
Signed-off-by: sg <goldsimon@gmx.de >
2016-08-20 11:29:57 +02:00
Dirk Ziegelmeier
21c99b6ebb
Add documentation page about example lwIP ports. Start with FreeRTOS from Pavel Pisa.
2016-08-20 09:23:29 +02:00
Axel Lin
a032ccafe7
mem: Fix trivial comment typo about using custom pools
...
Signed-off-by: Axel Lin <axel.lin@ingics.com >
2016-08-20 09:17:37 +02:00
goldsimon
4f4d16260f
minor: fixed typo
2016-08-19 15:40:36 +02:00
goldsimon
6b1e1af3d1
combine MAC filter actions for IGMP and MLD6 (IGMP has compatibility defines for old code, MLD6 filter functions must be adapted)
2016-08-19 13:54:14 +02:00
Axel Lin
b3bae1b44c
memp: Fix unused variable build error when MEMP_SANITY_REGION_BEFORE/AFTER is 0
...
MEMP_SANITY_REGION_BEFORE and MEMP_SANITY_REGION_AFTER can be overridden in
lwipopts.h, if one of it is set to 0 we got build error due to unused variable.
Fix unused variable build error when MEMP_OVERFLOW_CHECK >= 1 &&
(MEMP_SANITY_REGION_BEFORE == 0 || MEMP_SANITY_REGION_AFTER == 0).
Signed-off-by: Axel Lin <axel.lin@ingics.com >
Signed-off-by: goldsimon <goldsimon@gmx.de >
2016-08-19 13:47:37 +02:00
Dirk Ziegelmeier
730080f20e
Fix doxygen comment in lwip/prot/igmp.h
2016-08-19 13:15:23 +02:00
goldsimon
a189941da6
make igmp/mld6 filter actions an enum and define them in netif.h where the callback function prototypes are defined
2016-08-19 13:10:57 +02:00
Dirk Ziegelmeier
f93a6e3310
Rename lwip/prot/arp.h to lwip/prot/etharp.h for consistence
2016-08-19 13:09:58 +02:00
Dirk Ziegelmeier
5e36815867
init.c: Implement check for correct implementation of struct packing in lwip port
2016-08-19 13:05:51 +02:00
Dirk Ziegelmeier
01d8e5013f
Add missing include in prot/igmp.h
2016-08-19 13:02:17 +02:00
Dirk Ziegelmeier
6688033bc4
Move IGMP protocol struct to prot/igmp.h
2016-08-19 12:50:41 +02:00
goldsimon
ed566cceaa
minor cleaup in (eth)arp
2016-08-19 12:49:02 +02:00
goldsimon
55d05092ef
simplify memp.c code a bit
2016-08-19 12:25:48 +02:00
Axel Lin
0e9ef19cfb
memp: Remove memp_overflow_init() function
...
There is only one caller using memp_overflow_init(), and at that context
calling memp_overflow_init_element() actually simplifes the code.
Thus remove memp_overflow_init() function.
Signed-off-by: Axel Lin <axel.lin@ingics.com >
Signed-off-by: goldsimon <goldsimon@gmx.de >
2016-08-19 12:25:47 +02:00
Dirk Ziegelmeier
fefb782bfe
Apply fix by Marco Veeneman in SNMPv3: The outbound_padding is calculated wrong in snmp_complete_outbound_frame()
2016-08-19 12:22:59 +02:00
Dirk Ziegelmeier
12609c951c
Fix compile of SNMPv3 code with MSVC
2016-08-19 12:22:58 +02:00
Axel Lin
64f79e7ffc
PPP, PPPoE: Include netif/ethernet.h to fix build error
...
Fix below build errors:
In file included from ../../../../../lwip/src/include/netif/ppp/ppp_opts.h:31:0,
from ../../../../../lwip/src/netif/ppp/pppoe.c:71:
../../../../../lwip/src/netif/ppp/pppoe.c: In function ‘pppoe_timeout’:
../../../../../lwip/src/netif/ppp/pppoe.c:861:30: error: ‘ethbroadcast’ undeclared (first use in this function)
MEMCPY(&sc->sc_dest, ethbroadcast.addr, sizeof(sc->sc_dest));
^
../../../../../lwip/src/include/lwip/opt.h:137:52: note: in definition of macro ‘MEMCPY’
#define MEMCPY(dst,src,len) memcpy(dst,src,len)
^
../../../../../lwip/src/netif/ppp/pppoe.c:861:30: note: each undeclared identifier is reported only once for each function it appears in
MEMCPY(&sc->sc_dest, ethbroadcast.addr, sizeof(sc->sc_dest));
^
../../../../../lwip/src/include/lwip/opt.h:137:52: note: in definition of macro ‘MEMCPY’
#define MEMCPY(dst,src,len) memcpy(dst,src,len)
^
../../../../../lwip/src/netif/ppp/pppoe.c: In function ‘pppoe_connect’:
../../../../../lwip/src/netif/ppp/pppoe.c:899:24: error: ‘ethbroadcast’ undeclared (first use in this function)
MEMCPY(&sc->sc_dest, ethbroadcast.addr, sizeof(sc->sc_dest));
^
../../../../../lwip/src/include/lwip/opt.h:137:52: note: in definition of macro ‘MEMCPY’
#define MEMCPY(dst,src,len) memcpy(dst,src,len)
^
../../Common.mk:94: recipe for target 'pppoe.o' failed
make: *** [pppoe.o] Error 1
Fixes: 8eb9db18a2 ("Reduce usage of netif/ethernet.h header, mostly lwip/prot/ethernet.h is sufficient")
Signed-off-by: Axel Lin <axel.lin@ingics.com >
Signed-off-by: goldsimon <goldsimon@gmx.de >
2016-08-19 12:12:57 +02:00
goldsimon
ebd1bf8a49
fixed typo :-(
2016-08-19 11:03:09 +02:00
goldsimon
4a7dafc6a6
fixed compiling mdns.c after moving things to mdns_priv.h
2016-08-19 11:02:37 +02:00
goldsimon
1e6f33d44b
tcp: move tcp header flags definitions to 'prot'
2016-08-19 10:41:01 +02:00
goldsimon
96c3c48ba7
mdns: moved private things into mdns_priv.h
2016-08-19 09:52:30 +02:00
goldsimon
14fb48cd7a
minor: whitespace cleanups
2016-08-19 09:41:34 +02:00
goldsimon
9725a496b5
moved 2 enums from 'prot' headers to where they belong (dns, dhcp)
2016-08-19 09:41:33 +02:00
Dirk Ziegelmeier
967516aa40
Add #include to netif/ethernet.h to netif/etharp.h to maintian compatibility
2016-08-19 09:15:35 +02:00
Dirk Ziegelmeier
e844159f0a
Fix warning in test_etharp.c
2016-08-19 09:03:57 +02:00
Dirk Ziegelmeier
11386a26d9
Fix compile of DHCP unit test
2016-08-19 09:00:35 +02:00
Dirk Ziegelmeier
8eb9db18a2
Reduce usage of netif/ethernet.h header, mostly lwip/prot/ethernet.h is sufficient
2016-08-19 08:36:00 +02:00
sg
43d6812b3e
IPv6 addr: clarify tentative count/LWIP_IPV6_DUP_DETECT_ATTEMPTS
2016-08-18 22:02:57 +02:00
Dirk Ziegelmeier
7c0d952379
Add explicit documentation page about reporting bugs
2016-08-18 21:09:34 +02:00
Dirk Ziegelmeier
c4e3be814f
Work on bug #48728 : headers should cleanly separate API vs. implementation
...
ARP
2016-08-18 20:58:51 +02:00
Dirk Ziegelmeier
ad357a4c89
Work on bug #48728 : headers should cleanly separate API vs. implementation
...
ICMP
2016-08-18 20:55:09 +02:00
Dirk Ziegelmeier
2d503f4433
Work on bug #48728 : headers should cleanly separate API vs. implementation
...
ICMP6
2016-08-18 20:52:00 +02:00
Dirk Ziegelmeier
5df88220c4
Fix compile of MDNS unit test with GCC
2016-08-18 20:43:33 +02:00
Dirk Ziegelmeier
458211c2af
Comment fixes in my last commits
2016-08-18 20:41:39 +02:00
Dirk Ziegelmeier
84e139f20c
Work on bug #48728 : headers should cleanly separate API vs. implementation
...
IP6
2016-08-18 20:40:15 +02:00
Dirk Ziegelmeier
81c68f529b
Work on bug #48728 : headers should cleanly separate API vs. implementation
...
MLD6
2016-08-18 20:36:44 +02:00
Dirk Ziegelmeier
f299b4b7cf
Work on bug #48728 : headers should cleanly separate API vs. implementation
...
Ethernet
2016-08-18 20:33:38 +02:00
Dirk Ziegelmeier
8d68400387
Work on bug #48728 : headers should cleanly separate API vs. implementation
...
ND6
2016-08-18 20:28:03 +02:00
Dirk Ziegelmeier
d89fa2dcbc
Work on bug #48728 : headers should cleanly separate API vs. implementation
...
UDP
2016-08-18 20:22:35 +02:00
Dirk Ziegelmeier
16293125a6
Work on bug #48728 : headers should cleanly separate API vs. implementation
...
TCP
2016-08-18 20:22:14 +02:00
Axel Lin
e24fde05db
memp: Fix memp_overflow_check_element_overflow assertion
...
Use LWIP_MEM_ALIGN() in memp_overflow_init() to get alignment address for memp.
This fixes assertion in memp_overflow_check_element_overflow when
MEMP_OVERFLOW_CHECK is set.
Signed-off-by: Axel Lin <axel.lin@ingics.com >
2016-08-18 19:24:34 +02:00
Axel Lin
ef31afb921
memp: Fix build error when LWIP_HOOK_MEMP_AVAILABLE is defined
...
Fix below build error.
../../../../../lwip/src/core/memp.c: In function ‘memp_free’:
../../../../../lwip/src/core/memp.c:490:31: error: request for member ‘tab’ in something not a structure or union
old_first = memp_pools[type].tab;
^
../../Common.mk:94: recipe for target 'memp.o' failed
make: *** [memp.o] Error 1
Fixes: de9054cb7a ("memp: cleaned up MEMP_MEM_MALLOC")
Signed-off-by: Axel Lin <axel.lin@ingics.com >
2016-08-18 19:20:26 +02:00
Dirk Ziegelmeier
a8c8e08984
Minor: cleanups in unit test code
2016-08-18 13:02:59 +02:00
Dirk Ziegelmeier
97fae7e41b
Code cleanup in autoip.c and dhcp.c
2016-08-18 12:49:59 +02:00
Dirk Ziegelmeier
7f60cb3889
Improve netif client data API for lwIP internal clients - these can use a compile-time constant to access their data now
2016-08-18 12:37:21 +02:00
Dirk Ziegelmeier
ebf7959880
Coding style fixes in netif.c
2016-08-18 11:44:19 +02:00
Dirk Ziegelmeier
0c7a59b5db
Minor: Documentation fixes
2016-08-18 11:06:50 +02:00
Dirk Ziegelmeier
c9ad58308a
Minor documentation fixes
2016-08-18 10:59:18 +02:00
Dirk Ziegelmeier
a262a2f252
MDNS: Add callback to be called manually when IP has changed to announce new IP
2016-08-18 10:59:08 +02:00
Dirk Ziegelmeier
fa6a2d48cc
Fix DHCP unit test after my last changes
2016-08-18 06:09:02 +02:00
Dirk Ziegelmeier
c62bfd8146
Port AUTOIP to new netif client data API
2016-08-17 21:26:08 +02:00
Dirk Ziegelmeier
1db9631e7d
Port DHCP to new netif client data API
2016-08-17 21:04:44 +02:00
Dirk Ziegelmeier
c8c804140d
Fix possible NULL pointer dereference in mdns.c introduced in my last commit
2016-08-17 21:00:59 +02:00
Dirk Ziegelmeier
ee815e4e7a
Finish porting MDNS to new netif client data API
2016-08-17 20:09:28 +02:00
Dirk Ziegelmeier
c28fb298b7
Introduce an API to store arbitrary data pointers in struct netif
...
Let MDNS to use the new API
TODO: AutoIP, DHCP
2016-08-17 16:37:15 +02:00
Dirk Ziegelmeier
93b286e508
Also rename LWIP_MDNS to LWIP_MDNS_RESPONDER in unit tests...
2016-08-17 16:03:42 +02:00
Dirk Ziegelmeier
2a90f33757
MDNS responder: two functions can take struct mdns_host instead of netif as argument
2016-08-17 12:32:33 +02:00
Dirk Ziegelmeier
efb7b3d5f8
Rename LWIP_MDNS to LWIP_MDNS_RESPONDER
2016-08-17 12:07:38 +02:00
Dirk Ziegelmeier
02d51e3ac5
Add missing file doxygen header in two mdns files
2016-08-16 09:46:19 +02:00
Dirk Ziegelmeier
fec657bb38
MDNS: Substitute a few strlens by sizeof()
2016-08-16 09:33:53 +02:00
Dirk Ziegelmeier
858287fc3a
MDNS: Fix several MSVC warnings
2016-08-16 08:33:16 +02:00
Dirk Ziegelmeier
af6b707e9a
mdns_opts.h: Add missing include lwip/opt.h
2016-08-16 08:28:59 +02:00
Dirk Ziegelmeier
ab72ed8517
Fix options #include in mdns code
2016-08-16 08:22:41 +02:00
Dirk Ziegelmeier
482a4d2ce9
MDNS: Correct setting TTL when IGMP is not enabled
2016-08-16 08:09:19 +02:00
Dirk Ziegelmeier
c61c8f3766
Use udp_get_multicast_ttl/udp_set_multicast_ttl accessors where applicable
2016-08-16 08:08:06 +02:00
Dirk Ziegelmeier
af48bec63c
Update MDNS docs after porting to dual-stack API
2016-08-14 17:12:01 +02:00
Dirk Ziegelmeier
39ac8e2c57
Remove some MDNS functions from documentation, they are only visible for unit tests
2016-08-14 17:08:39 +02:00
Dirk Ziegelmeier
52449e12c0
Forgot to save before committing...
2016-08-14 16:56:34 +02:00
Dirk Ziegelmeier
2335c1a73c
Port MDNS to new dual-stack API
2016-08-14 16:47:45 +02:00
Dirk Ziegelmeier
ebe0e6f98d
Some documentation cosmetics in mdns.c
2016-08-14 15:42:22 +02:00
Dirk Ziegelmeier
4d85def20a
Update README applications sections
2016-08-14 15:39:58 +02:00
Dirk Ziegelmeier
b472648e40
Fix wrong copyright header in mdns_opts.h
2016-08-14 15:36:41 +02:00
Dirk Ziegelmeier
a2894ede1c
MDNS: make a few arguments const where suitable
2016-08-14 15:31:49 +02:00
Dirk Ziegelmeier
306113c8c3
Add MDNS to doxygen docs
2016-08-14 15:22:05 +02:00
Erik Ekman
4919932c49
Apply patch #8755 : Multicast DNS responder support from Erik Ekman
2016-08-14 15:07:45 +02:00
Sylvain Rochet
4af297fc20
PPP: fix don't print valid LCP echo request/reply packets if the link is up
...
The check for link up was missing, meaning valid LCP echo request/reply
packets are filtered whatever the PPP state is, despite what the comment
says.
Fix it by checking the PPP state as we would like to have done when it
was written.
2016-08-13 16:02:38 +02:00
Sylvain Rochet
4e1f8effaf
PPP: fix ppp_write internal documentation
...
This function returns an err_t, not a number of characters written.
2016-08-13 16:02:38 +02:00
Dirk Ziegelmeier
5493220c93
Move DNS protocol structs to separate header. Needed for Erik Ekman's MDNS implementation.
2016-08-13 09:05:28 +02:00
Dirk Ziegelmeier
ce6ea0df15
Convert SNMP snmp_vb_enumerator_err_t to a typedef and fix resulting compile error
2016-08-12 22:59:21 +02:00
Dirk Ziegelmeier
6dcb2b2415
Work on bug #48730 : Enums should be used instead of multiple defines (where applicable)
2016-08-12 22:51:43 +02:00
Dirk Ziegelmeier
36b9caed23
Fix compile of unit test
2016-08-11 23:54:59 +02:00
Dirk Ziegelmeier
13251526fa
Strip path prefix in doxygen docs - no /home/dziegel/ in the future :-)
2016-08-11 21:25:28 +02:00
Dirk Ziegelmeier
b34baff546
Convert state #defines in autoip.h and dhcp.h to enums. May be useful in *_state structs to simplify debugging in the future.
2016-08-11 21:04:39 +02:00
goldsimon
6f62fe5998
ensure the 'prot' headers are as small & portable as possible
2016-08-11 15:11:34 +02:00
goldsimon
dc7340bbd5
started with bug #48728 : move protocol definitions to 'include/prot/*.h' files (started with some IPv4 protocols)
2016-08-11 14:36:09 +02:00
Ajay Bhargav
d95ab511d0
netif:ppp: fix mempool build issues when PPP is enabled
...
During documentation updated LWIP_MEMPOOL_PROTOTYPE was moved inside
"#if MEMP_MEM_MALLOC" which cause ppp build to break. This patch fix that
issue.
ref commit-id: 2f950a7dcc
Signed-off-by: Ajay Bhargav <contact@rickeyworld.info >
2016-08-11 12:54:55 +02:00
goldsimon
bf3e8e6a48
minor coding style fixes in IPv6 code
2016-08-11 09:23:43 +02:00
Sylvain Rochet
3194c9c4cf
PPP: filter more packets in ppp_dump_packet
...
VJ packets, Compressed packets, IPv4 and IPv6 packets are useless in
the PPP packet dump. We properly filtered IPv4 and IPv6 packets but
we forgot filtering VJ and Compressed packets.
Improve the filtering rule to filter packets which are not auth
protocol (< 0xC000) and which are not control protocol (0x8000 bit
not set).
2016-08-10 23:39:28 +02:00
Axel Lin
18fcc1d504
[PATCH] debug: Add braces around empty body in an 'if' statement
...
I have below code in my cc.h:
#ifdef MYSDK_LWIP_DEBUG
#define LWIP_PLATFORM_ASSERT(x) MYSDK_ASSERTION_FAIL_ACTION()
#else
#define LWIP_PLATFORM_ASSERT(x)
#endif /* ifdef MYSDK_LWIP_DEBUG */
I got below error when in non-debug build:
src/include/lwip/debug.h:76:32: error: suggest braces around empty body in an 'if' statement [-Werror=empty-body]
LWIP_PLATFORM_ASSERT(message); } while(0)
^
Fix the build error by adding braces around empty body in an 'if' statement.
Signed-off-by: Axel Lin <axel.lin@ingics.com >
Signed-off-by: sg <goldsimon@gmx.de >
2016-08-09 21:52:13 +02:00
Dirk Ziegelmeier
5c0944e01a
Don't document tcp_send_empty_ack and tcp_keepalive - users should never need them
2016-08-09 10:17:16 +02:00
Dirk Ziegelmeier
5a09fd3e35
Don't document ip4_route and ip6_route, users should use ip_route instead
2016-08-09 10:16:40 +02:00
Dirk Ziegelmeier
0005b7c2d0
Revert my last change in sntp.c - allow usage of custom error values in err_t
2016-08-09 08:20:28 +02:00
Dirk Ziegelmeier
6ba03d543f
Activate TCP backlog in documentation
2016-08-09 08:18:42 +02:00
Dirk Ziegelmeier
61dae47a71
Relete SNMP README and incorporate it's text in doxygen docs
2016-08-08 22:40:57 +02:00
Dirk Ziegelmeier
85ab39985a
Fix a few incorrect uses of err_t. Found by converting lwip error codes to an enum, but I'm not sure wether I want to commit the actual enum conversion.
2016-08-08 22:15:01 +02:00
Dirk Ziegelmeier
e5284ec616
Minor: documentation cosmetics
2016-08-08 22:01:38 +02:00
Dirk Ziegelmeier
4b41ef551e
Add note about Filelists.mk in UPGRADING document
2016-08-08 21:55:08 +02:00
sg
a2fd68098e
minor: macros should not end with underscore(s)
2016-08-08 21:47:53 +02:00
Dirk Ziegelmeier
1631307bb3
tcp.c: Partly undo Simon's changes from today (repairs doxygen docs)
2016-08-08 21:42:27 +02:00
Dirk Ziegelmeier
10332773ff
Remove tcp_accepted() from rawapi.txt. Thanks to Sergio Caprile for pointing this out!
2016-08-08 16:09:26 +02:00
Dirk Ziegelmeier
fa568f7750
Fix typos in docs
2016-08-08 12:16:17 +02:00
Sylvain Rochet
282b8a2b6c
PPP: set disconnect state before closing link protocol in ppp_close
...
If LCP is not started yet, we are only closing the link protocol, in
this case we have to set the disconnect state ourself because PPP
is not actually started yet.
2016-08-08 11:55:31 +02:00
Dirk Ziegelmeier
b1dfd00f92
Minor netif documentation update
2016-08-08 09:16:15 +02:00
goldsimon
eba6ae0122
minor: add a comment about where to define LWIP_RAND()
2016-08-08 09:14:50 +02:00
goldsimon
219438fb24
cleanup: move stdlib.h include to mem.c, where it belongs
2016-08-08 09:11:24 +02:00
Axel Lin
e4c01a064e
mem: Include stdlib.h to fix build warnings when MEM_LIBC_MALLOC is set
...
Include stdlib.h to fix below build warnings when MEM_LIBC_MALLOC is set:
src/core/mem.c:119:3: warning: implicit declaration of function 'malloc' [-Wimplicit-function-declaration]
void* ret = mem_clib_malloc(size + MEM_LIBC_STATSHELPER_SIZE);
^
src/core/mem.c:96:25: warning: incompatible implicit declaration of built-in function 'malloc'
#define mem_clib_malloc malloc
^
src/core/mem.c:119:15: note: in expansion of macro 'mem_clib_malloc'
void* ret = mem_clib_malloc(size + MEM_LIBC_STATSHELPER_SIZE);
^
src/core/mem.c: In function 'mem_free':
src/core/mem.c:146:3: warning: implicit declaration of function 'free' [-Wimplicit-function-declaration]
mem_clib_free(rmem);
^
src/core/mem.c:93:23: warning: incompatible implicit declaration of built-in function 'free'
#define mem_clib_free free
^
src/core/mem.c:146:3: note: in expansion of macro 'mem_clib_free'
mem_clib_free(rmem);
^
Signed-off-by: Axel Lin <axel.lin@ingics.com >
2016-08-08 09:05:55 +02:00
goldsimon
08378b7d4b
Improve LWIP_EVENT_API compilation
2016-08-08 08:49:14 +02:00
David van Moolenbroek
fc66fb830c
Fix compilation for LWIP_EVENT_API
...
Without LWIP_CALLBACK_API, is no error callback function pointer in
the TCP PCB, nor is it needed, so do not attempt to access it.
2016-08-08 08:48:28 +02:00
Dirk Ziegelmeier
fa8797b86d
Fix PBUF_LINK_HLEN value in documentation
2016-08-08 08:20:42 +02:00
Sylvain Rochet
953dd5b628
PPP, PPPoE: remove useless checks
...
pppoe_softc_list is always not null when pppoe_find_softc_by_session is
called, furthermore pppoe_softc_list being null here does not hurt.
session is still checked whatsoever in pppoe_find_softc_by_session,
prechecking the session value for a value which can't really happen
except for forged frames does not add any value.
2016-08-08 00:14:45 +02:00
Sylvain Rochet
455a41822e
PPP, PPPoL2TP: cleanup connection state reset
...
Remove unnecessary cleanup at the end of session, cleanup as much as
possible in the connect callback instead. It follows what PPPoE is
currently doing and it makes everything simpler to read.
2016-08-07 23:25:48 +02:00
Sylvain Rochet
1ea1026961
PPP, PPPoE: cleanup connection state reset
...
Instead of relying on cleanup at the end of session, cleanup as much as
possible in the connect callback. It removes duplicated code and make
everything simpler to read.
While we are at it, remove useless initialization code from create
and connect functions.
2016-08-07 23:25:48 +02:00
Sylvain Rochet
09c22e13fe
PPP: close link protocol if LCP is not started in ppp_close
...
ppp_close might try to close LCP even if LCP is not started, it happens
because because the PPP session might be waiting for the link protocol
to come up and we do not check that.
We say in the PPP documentation that ppp_close() can be called anytime,
so, if link protocol is currently trying to connect, we must cancel
the link connection.
Fix it by calling the link protocol disconnect callback if LCP is not
started yet.
2016-08-07 23:25:48 +02:00
Sylvain Rochet
7c02a85424
PPP, PPPoE: add support for disconnecting in link initiation state in disconnect callback
...
Disconnect callback does not currently support a disconnect event while
initiation is in progress. Retry timer is not stopped and PADT frame is
sent whatever the current state is. PADT frame can only be sent if we
received a PADS frame, otherwise sc_session is 0 and sending a PADT
frame is meaningless.
Fix both issues to allow calling the disconnect callback whatever the
PPPoE state is.
2016-08-07 23:25:48 +02:00
Sylvain Rochet
d15ebc6a4c
PPP: don't restart LCP closing if termination is already in progress
...
We say in the PPP documentation that ppp_close() can be called anytime,
as of today, this is not entirely true, there are still conditions that
are not handled properly.
If PPP is already disconnecting, ppp_close() must do nothing and returns
ERR_INPROGRESS instead of messing up the PPP disconnection state.
2016-08-07 23:25:48 +02:00
Sylvain Rochet
f185104ac6
PPP: revamp PPP state order
...
Master state is almost exactly the same thing as dead state, move it
next to dead state. Holdoff state is actually the state just before
initialize, move it before initialize.
The goal is to be able to use > running or => terminate condition to
check a currently running disconnection phase, which is not possible
today without excluding master and holdoff states.
2016-08-07 23:25:48 +02:00
Sylvain Rochet
5811948b0a
PPP: remove PPP_PHASE_MASTER conditions if multilink mode is disabled
...
PPP_PHASE_MASTER state is only used if multilink mode is enabled. Since
we don't support multilink mode checking for this state only add some
code for no value added at all.
Build-out PPP_PHASE_MASTER state check if multilink mode is disabled.
2016-08-07 23:25:48 +02:00
Sylvain Rochet
dd0779c204
PPP, move VJ_SUPPORT disabling if LWIP_TCP is not enabled to PPP options
...
Van Jacobson TCP header compression only apply if TCP is enabled,
therefore we need to disable VJ compression if TCP is disabled.
We already have conditions to enforce VJ disabling if IPv4 is disabled
or if PPPoS is disabled, add TCP to those conditions and remove
unecessary VJ_SUPPORT && LWIP_TCP conditions.
2016-08-07 23:25:48 +02:00
Dirk Ziegelmeier
898e69118a
Minor: documentation fix
2016-08-07 20:21:27 +02:00
Dirk Ziegelmeier
f55c0e7864
Move rawapi.txt description to main page - this doc really should be found and read by users
2016-08-07 20:21:27 +02:00
Dirk Ziegelmeier
3ca4eb5cd8
Minor pbuf layer doc update
2016-08-07 20:21:27 +02:00
Dirk Ziegelmeier
6af213787a
Fix clang address sanitizer errors in unit tests (buffers too small)
2016-08-07 20:21:27 +02:00
Axel Lin
0a7db8a9a5
PPP: remove double include for lwip/sys.h
...
Including it once is enough.
Signed-off-by: Axel Lin <axel.lin@ingics.com >
Signed-off-by: Sylvain Rochet <gradator@gradator.net >
2016-08-07 12:35:50 +02:00
Dirk Ziegelmeier
0673fcdb44
Fix mentioning functions that do not take pbufs as argument in pbuf layer docs
2016-08-07 10:16:18 +02:00
Dirk Ziegelmeier
980a919c9a
Don't document IP type specific output functions, users should use IP type independent ones
2016-08-07 10:13:50 +02:00
Dirk Ziegelmeier
8d07629b71
Some documentation cleanups and include more comments that have been already in code into doxygen docs
2016-08-07 10:05:34 +02:00
Dirk Ziegelmeier
cf66233873
PBUF layer documentation clarification
2016-08-06 22:28:12 +02:00
Dirk Ziegelmeier
b94c8ee76f
Add some more functions and macros to documentation
2016-08-06 22:16:49 +02:00
Dirk Ziegelmeier
73131b1677
Fix doxygen warning in ip6.c
2016-08-06 20:29:35 +02:00
Dirk Ziegelmeier
87855b0e0e
Update doxgen docs: PBUF layers, IPv4 and IPv6 functions, add some missing tcp raw API functions
2016-08-06 20:28:49 +02:00
Dirk Ziegelmeier
2acfa0ebe7
Update NO_SYS_SampleCode.c: Don't access heap in IRQ
2016-08-06 20:28:01 +02:00
Dirk Ziegelmeier
a20cdc597a
Fix comment in sample code
2016-08-05 09:55:48 +02:00
Dirk Ziegelmeier
70ee63ef3d
Documentation: Add example code for NO_SYS use case
2016-08-05 09:53:50 +02:00
Sylvain Rochet
c2a5480ac7
PPP: remove useless ppp_link_start function
...
This function only set PPP to initialize phase, and it is only called at
the very beginning of functions where it is called. It means we could
as well set the initialize phase before calling those functions in the
PPP core.
2016-08-04 23:52:54 +02:00
Sylvain Rochet
01561b26ef
PPP: set phase to establish before starting LCP
...
PPP is currently in initialize phase until authentication is started
or until we start IPCP negotiation.
It works, because PPP states are mostly used for user information, most
state are actually useless for PPP itself. Being in initialize state
while PPP is started is not very consistent, switch to establish phase
before starting LCP.
2016-08-04 23:43:46 +02:00
Sylvain Rochet
9b47b6393b
PPP, PPPoE: remove useless PPPoE state conditions
...
sc->sc_ethif can't be NULL, it is set definitively in pppoe_create.
PPPoE can't by anything else than PADI sent in pppoe_send_padi, it
is only called when this is true.
PPPoE state can't be anything else than initial state in
pppoe_connect, this function is called from PPP core only when PPP
is in the dead phase, if PPP is in the dead phase it means the link
protocol is dead as well.
PPPoE can't be anything else than data phase in pppoe_disconnect
this function is only called by PPP core only when PPP session is up,
if PPP session is UP it means the link protocol is UP as well.
PPPoE can't by anything else than PADR sent in pppoe_send_padr, it
is only called when this is true.
PPPoE can't by anything else than PADO sent in pppoe_send_pado, it
is only called when this is true.
PPPoE can't by anything else than PADO sent in pppoe_send_pads, it
is only called when this is true.
PPPoE can't be anything else than session phase in pppoe_xmit,
function is only called by pppoe_write and pppoe_netif_output
which are both called by PPP core only when PPP session is up, if
PPP session is UP it means the link protocol is UP as well.
2016-08-04 23:06:30 +02:00
Sylvain Rochet
e8d8c5dcc9
PPP, L2TP: remove useless L2TP state conditions
...
L2TP state can't be anything else than initial state in
pppol2tp_connect, this function is called from PPP core only when PPP
is in the dead phase, if PPP is in the dead phase it means the link
protocol is dead as well.
L2TP can't be anything else than data phase in pppol2tp_xmit, this
function is only called by pppol2tp_write and pppol2tp_netif_output
which are both called by PPP core only when PPP session is up, if
PPP session is UP it means the link protocol is UP as well.
L2TP can't be anything else than data phase in pppol2tp_disconnect,
this function is only called by PPP core only when PPP session is up,
if PPP session is UP it means the link protocol is UP as well.
2016-08-04 23:03:03 +02:00
Sylvain Rochet
bae67915ab
PPP: fix dead phase set too early
...
When we are disconnecting, we should switch to PPP dead phase at the
very end, because this is our final disconnection phase allowing
reconnect, therefore we should switch to dead phase after the link
protocol finished disconnecting.
We are currently switching to dead phase when LCP detected that the link
is down, this is obviously wrong. Fix this flaw by continuing in
disconnect phase until ppp_link_end is called from link protocol.
2016-08-04 22:06:45 +02:00
sg
5f774270b6
minor: tabs -> spaces
2016-08-03 21:25:32 +02:00
David van Moolenbroek
02221cf5dc
Rename IP_HDRINCL to LWIP_IP_HDRINCL
...
In the BSD socket API world, IP_HDRINCL is a socket option for "raw"
sockets that indicates whether sent packets already include an IP
header. Within lwIP, "IP_HDRINCL" is redefined as a special value
that indicates to lwIP-internal functions that an IP header is already
included. While somewhat related, the two meanings are different and,
on platforms that define the IP_HDRINCL socket option, this results in
a conflict. This patch renames the lwIP one to "LWIP_IP_HDRINCL",
thus resolving the conflict.
2016-08-03 20:51:21 +02:00
sg
6383ef88b4
had a look through the docs...
2016-08-03 20:40:52 +02:00
sg
dd110309e5
update some FILES list files
2016-08-03 20:21:54 +02:00
Dirk Ziegelmeier
4c06a737a4
Add redirection page for HTML doxygen output so one does not have to search for index.html in the huge output/html directory
2016-08-03 12:34:17 +02:00
Dirk Ziegelmeier
da83946e75
Add one more documentation sentence in tcp.c
2016-08-03 12:34:16 +02:00
goldsimon
3d379c97ec
IPv6 is NOT experimental any more :-)
2016-08-03 12:28:56 +02:00
goldsimon
018294d287
remove doubled include (tcpip.h)
2016-08-01 09:44:18 +02:00
goldsimon
247d2e97a0
minor: removed trailing spaces
2016-08-01 09:36:15 +02:00
goldsimon
92f385aaed
fixed compiling lowpan6 for NO_SYS==1
2016-08-01 09:35:59 +02:00
Dirk Ziegelmeier
2f7e6d0661
Remove hard reference from netif.c to tcpip.c - avoids pulling in unnecessary code
2016-08-01 09:32:54 +02:00
Dirk Ziegelmeier
e4d75a75ea
Remove accidentally committed file
2016-07-31 20:01:33 +02:00
Dirk Ziegelmeier
501cfbe02b
Document netconn API some more
2016-07-31 16:59:12 +02:00
Dirk Ziegelmeier
a7979d7d24
Document lwIP error codes
2016-07-31 16:08:17 +02:00
Dirk Ziegelmeier
52d6d696ae
Document lwIP version #defines
2016-07-31 16:05:42 +02:00
Dirk Ziegelmeier
e76b8b2551
Document SNMP MIB2 netif stats counters
2016-07-31 16:02:22 +02:00
Dirk Ziegelmeier
d00609257b
Fix doxygen warning in netif.h (forgotten title)
2016-07-31 15:49:32 +02:00
Dirk Ziegelmeier
6cc7f38c99
Fix typo in lwip.Doxyfile
2016-07-30 11:08:05 +02:00
Dirk Ziegelmeier
2c2d11fa4d
Update documentation of netif_input function
2016-07-30 10:40:36 +02:00
Dirk Ziegelmeier
4cb7e31d2d
Add missing #include in netif.c
2016-07-30 10:36:11 +02:00
Dirk Ziegelmeier
0c7d015ec4
Further improvement to netif input function autoselection: Select between netif_input() and tcpip_input() depending on NO_SYS setting
2016-07-30 10:29:14 +02:00
Dirk Ziegelmeier
4b67c582f6
Create netif_input function that decides according to netif flags where to pass an incoming packet.
...
Allow to pass a NULL pointer to netif_add() input function - if so, use the function mentioned above as input function.
2016-07-30 10:19:16 +02:00
Dirk Ziegelmeier
5f9c944da4
Add some netif related macros to docs
2016-07-30 10:06:06 +02:00
goldsimon
b7da649944
sio.h: include opt.h for checking #ifndef's
2016-07-29 08:01:41 +02:00
Dirk Ziegelmeier
90fba8773f
Revert "Fix my messing of opt.h and the other options files - it was actually caused by a cyclic #include which I did not see"
...
It still does not work, due to #undef of options in opt.h, the documentation of many files is incomplete
This reverts commit 3f0dae29e9 .
2016-07-28 23:34:16 +02:00
Dirk Ziegelmeier
3f0dae29e9
Fix my messing of opt.h and the other options files - it was actually caused by a cyclic #include which I did not see
...
Read the comments inside opt.h if you are interested.
2016-07-28 18:59:36 +02:00
Dirk Ziegelmeier
9fb9033815
Move MIB compiler to contrib, it's a better place for it
2016-07-28 14:33:15 +02:00
Dirk Ziegelmeier
8c620d9206
Restructure IPv6 config options
...
Add generate.bat to generate docs quickly under Windows OS
2016-07-28 09:21:16 +02:00
goldsimon
b4efa33b7c
Removed the LWIP_HAVE_SLIPIF option: either the linker removes it when not used or you'll have to not compile it
2016-07-28 09:02:19 +02:00
Dirk Ziegelmeier
71dc8f8f53
opt.h loopback options cleanup
2016-07-28 09:00:37 +02:00
Dirk Ziegelmeier
161ee4f4b2
Work on opt.h hierarchy
2016-07-28 08:47:51 +02:00
Dirk Ziegelmeier
eac1005c9c
Start to add hierarchy to opt.h doxygen docs
2016-07-28 08:41:21 +02:00
Dirk Ziegelmeier
b0284a6927
Move definition of options group from main_page.h to opt.h - it's more consistent like that
2016-07-28 08:27:49 +02:00
goldsimon
bdaec1691e
doxygen: put the new timer defines into their own section
2016-07-28 08:20:18 +02:00
goldsimon
5bcaefddd4
lwiperf: improved documentation, removed unused enum members
2016-07-28 08:07:02 +02:00
Dirk Ziegelmeier
f7e12d835c
Add NETBIOSNS options to doxygen docs
2016-07-28 08:05:57 +02:00
Dirk Ziegelmeier
93ad162aa6
Add SNMP and HTTPD options to doxygen docs
2016-07-28 08:03:32 +02:00
Dirk Ziegelmeier
f322e782f8
Add SNTP options to doxygen docs
2016-07-28 07:48:46 +02:00
sg
23cf45d252
d'oh! (fixed messed-up timeouts.h)
2016-07-27 21:48:29 +02:00
sg
56102c1b1c
fixed messed-up opt.h
2016-07-27 21:47:36 +02:00
sg
53dc94d570
added LWIP_TIMERS_CUSTOM to override the default implementation of timeouts
2016-07-27 21:46:16 +02:00
sg
a326b057b3
Fix bug #48568 (timeouts does not support late firing properly) by assuming sys_check_timeouts() jitter can' be too bad
2016-07-27 21:17:15 +02:00
Dirk Ziegelmeier
1bb2539f74
Make options documentation a child of lwIP section
2016-07-27 20:49:19 +02:00
Dirk Ziegelmeier
b14032c531
Fix doxygen warning in opt.h
2016-07-27 20:34:23 +02:00
Dirk Ziegelmeier
70927892e1
Fix doxygen warning about debug parameters in memp.c
...
Remove documentation from them, it is not important
2016-07-27 20:34:23 +02:00
Dirk Ziegelmeier
0e6f2049ad
Minor main_page.h cosmetics
2016-07-27 20:34:23 +02:00
Dirk Ziegelmeier
b2b1ec14f5
Make hook macros visible to doxygen
2016-07-27 20:34:23 +02:00
Dirk Ziegelmeier
a39c040571
opt.h documentation cosmetics
2016-07-27 20:34:23 +02:00
Dirk Ziegelmeier
fb7998699d
Minor doxygen options fix
2016-07-27 20:34:23 +02:00
Dirk Ziegelmeier
d89378e3f8
opt.h documentation cleanups
2016-07-27 20:34:23 +02:00
Dirk Ziegelmeier
63fdb3bb62
Document opt.h - due to a bad bug in doxygen, I had to litter the whole file with "|| __DOXYGEN__" to make it work :-(
...
Doxygen does not handle #ifndef foo #define foo #endif properly. It does not see the #define foo inside.
If someone has objections or a fix for it, please tell me.
2016-07-27 20:34:23 +02:00
Dirk Ziegelmeier
31f941e172
More documentation updates
2016-07-27 20:34:23 +02:00
sg
8ece46d5d2
snmp threadsync_data: "u8" -> "err" (typedef snmp_err_t is an enum, not u8_t)
2016-07-27 20:28:39 +02:00
Dirk Ziegelmeier
0cb1d1144d
Integrate README file into doxygen docs instead of duplicating its content in main_page.h
2016-07-27 19:09:52 +02:00
Dirk Ziegelmeier
aece68639a
Integrate snmp_agent.txt in doxygen documentation, delete outdated file
2016-07-27 18:58:28 +02:00
Dirk Ziegelmeier
eb3261d6e0
Add some more TCP RAW API functions to documentation
2016-07-27 13:46:54 +02:00
Dirk Ziegelmeier
9305bf2ace
Add doxygen changes to changelog
2016-07-27 13:41:41 +02:00
Dirk Ziegelmeier
0b5c393361
Improve documentation grouping in sys abstraction layer
2016-07-27 13:16:24 +02:00
Dirk Ziegelmeier
6c7eef7ac0
More documentation updates
2016-07-27 13:14:31 +02:00
Dirk Ziegelmeier
ef5c1b6590
Work on lwIP documentation
2016-07-27 13:09:33 +02:00
Dirk Ziegelmeier
fc7aa7a247
Move content from contrib.h and upgrading.h to main_page.h
2016-07-27 13:07:29 +02:00
Dirk Ziegelmeier
ccc830c99c
Work on lwIP documentation
2016-07-27 13:03:36 +02:00
goldsimon
af97f9b239
fixed gcc compiler error in do_memp_free_pool(): obviously, SYS_ARCH_DECL_PROTECT() must be the last declaration...
2016-07-27 08:26:42 +02:00
Dirk Ziegelmeier
6618189342
Add UPGRADING document to doxygen docs
2016-07-27 08:21:54 +02:00
Dirk Ziegelmeier
6b524367a3
Documentation review with Simon, minor changes
2016-07-27 08:05:38 +02:00
Dirk Ziegelmeier
1993b0257c
Document SNMP MIB2 functions
2016-07-27 06:37:26 +02:00
Dirk Ziegelmeier
6bce7509f7
Fix doxygen warning in sys.h due to wrong @ref
2016-07-26 23:17:07 +02:00
Dirk Ziegelmeier
7e4d934f7a
Docs: generate search index
2016-07-26 23:14:38 +02:00
Dirk Ziegelmeier
4a7d07a2e0
Document netdb API, add socket functions implemented by lwip to documentation, just for reference
2016-07-26 22:06:54 +02:00
Dirk Ziegelmeier
765181a97c
inet6.c was missing in Filelists.mk
2016-07-26 22:06:04 +02:00
Dirk Ziegelmeier
7b770dd9b6
Document 6LoWPAN and SLIP netif
2016-07-26 20:10:17 +02:00
Dirk Ziegelmeier
7f43fcab71
Document system abstraction layer in doxygen module style
2016-07-26 20:03:04 +02:00
Dirk Ziegelmeier
c7e20150f0
Update and restructure docs of some lwip core functions
2016-07-26 19:42:16 +02:00
Dirk Ziegelmeier
c6831648e2
Document apps in doxygen module style, create more top-level categories to structure documentation
2016-07-26 19:30:05 +02:00
Dirk Ziegelmeier
8a9de94b1f
Restructure documentation. Create two top-level sections for thread-safe and callback-style APIs.
2016-07-26 18:39:53 +02:00
Dirk Ziegelmeier
8140c77d7d
Document Socket API in doxygen module style
2016-07-26 18:26:58 +02:00
Dirk Ziegelmeier
67d674a59c
Document IGMP and MLD6 API in doxygen module style
2016-07-26 18:20:30 +02:00
Dirk Ziegelmeier
dc0859b8d1
Document DHCP and AUTOIP API in doxygen module style
2016-07-26 18:10:05 +02:00
Dirk Ziegelmeier
9c10daba93
Document netif API in doxygen module style
2016-07-26 17:53:07 +02:00
Dirk Ziegelmeier
0fea2bc02e
Document netconn API in doxygen module style
2016-07-26 17:40:55 +02:00
Dirk Ziegelmeier
ce19c59bb2
Document ip address function in doxygen module style
2016-07-26 17:11:01 +02:00
Dirk Ziegelmeier
8643782e5d
Document netif and lwIP in doxygen module style
2016-07-26 16:53:27 +02:00
Dirk Ziegelmeier
bd79f6c055
Document DNS, memory pools and PBUFs as modules
2016-07-26 16:40:13 +02:00
Dirk Ziegelmeier
40bc80b551
Fix compile of snmp_mib2_system.c after my last SNMP API change
2016-07-26 16:39:34 +02:00
goldsimon
e030118750
moved MEM_LIBC_MALLOC code from mem.h to mem.c:
...
- it's not worth littering mem.h just to save some bytes to prevent the additional call;
- MEM_STATS now also work when MEM_LIBC_MALLOC is enabled
2016-07-26 15:02:36 +02:00
Dirk Ziegelmeier
59295be4ef
Some more RAW API documentation updates
...
Improve structure of documentation: PPP is now a module, too
2016-07-26 13:53:59 +02:00
Dirk Ziegelmeier
10acd8303d
Start to document public RAW API via doxygen
2016-07-26 13:38:43 +02:00
Dirk Ziegelmeier
73ee4cbbf7
MIB compiler: Back to .NET 4.0 to maintain compatibility to VS2010
2016-07-26 12:59:28 +02:00
Dirk Ziegelmeier
f6468510c6
Adapt MIB compiler to changed function signature of my last commit. Done with patch #9044 : SNMP response for failed get operation.
2016-07-26 12:59:27 +02:00
Dirk Ziegelmeier
a62e4452a2
Work on patch #9044 : SNMP response for failed get operation
...
Inspired by Marco Veeneman. Change signature of get_value function to return s16_t, where values <0 indicate an error. This is mapped to SNMP_ERR_GENERROR.
2016-07-26 12:59:26 +02:00
goldsimon
168ad22761
fixed custom pools after last memp cleanup
2016-07-26 12:26:52 +02:00
goldsimon
fb75f48751
Make lwip_cyclic_timers[] const
2016-07-26 09:08:29 +02:00
goldsimon
ca71eea56f
httpd: reverted accidentally committed change (came in with de9054cb7a when fixing memp things)
2016-07-26 07:29:59 +02:00
sg
00598b0b46
fix mem stats for MEM_USE_POOLS==1
2016-07-25 22:08:32 +02:00
sg
4f5ff37c5d
fixed bogus compiler error for MEM_USE_POOLS==1 and MEMP_USE_CUSTOM_POOLS==0
2016-07-25 21:43:45 +02:00
Dirk Ziegelmeier
80be1a6bf8
Add links to new documentation pages in the relevant files
2016-07-25 08:20:39 +02:00
Dirk Ziegelmeier
d75ece2505
Add some of the .txt files in /doc subdir to doxygen documentation
2016-07-25 08:16:39 +02:00
Erik Ekman
28dd0813ab
Disable SYS_LIGHTWEIGHT_PROT in unit tests
2016-07-22 09:34:05 +02:00
sg
194d624077
Finished aborted sentence on comment about NO_SYS :-)
2016-07-21 22:22:36 +02:00
sg
de9054cb7a
memp: cleaned up MEMP_MEM_MALLOC:
...
- support memp stats when MEMP_MEM_MALLOC==1 (bug #48442 );
- hide MEMP_MEM_MALLOC in memp.c instead of messing up the header file;
- make MEMP_OVERFLOW_CHECK work when MEMP_MEM_MALLOC==1
2016-07-21 22:17:32 +02:00
sg
413eeef5fa
minor: moved sanity check from mem.c to init.c
2016-07-21 22:16:05 +02:00
sg
6e6ce4fb78
Make SYS_LIGHTWEIGHT_PROT==1 the default since it's more often used like that and it's more safe as default; improved some option's comments
2016-07-21 22:10:02 +02:00
sg
f98c3dd4b5
LWIP_MPU_COMPATIBLE: help dumb compilers to see 'msg' is used (MSVC :(
2016-07-21 21:54:13 +02:00
sg
806298583b
Filelists.mk: make init.c the first file compiled, to have the sanity checks first
2016-07-21 20:47:43 +02:00
Sylvain Rochet
764343ebc7
Revert "PPP: restore PPPoE devices without Ethernet ARP support, i.e. PPPoE only devices"
...
This reverts commit d43c092f17 .
We don't actually need it, init.c is including ppp_opts.h and is doing
the following:
#if !LWIP_ETHERNET && (LWIP_ARP || PPPOE_SUPPORT)
#error "LWIP_ETHERNET needs to be turned on for LWIP_ARP or PPPOE_SUPPORT"
#endif
so the LWIP_ETHERNET fixup is not necessary per se, compatibility with
previously used lwipopts.h files is broken but at least user is warned.
2016-07-21 13:53:43 +02:00
goldsimon
523b11e664
fixed bug #48543 (TCP sent callback may prematurely report sent data when only part of a segment is acked) and don't include SYN/FIN in snd_buf counter (patch by Ambroz Bizjak)
2016-07-21 13:47:52 +02:00
Sylvain Rochet
d43c092f17
PPP: restore PPPoE devices without Ethernet ARP support, i.e. PPPoE only devices
...
Ethernet support is required for PPPoE but Ethernet support is only set
by default in opt.h if ARP is enabled, which is wrong because the right
condition is ARP and/or PPPoE, unfortunately PPPOE_SUPPORT can't be used
in opt.h because it is not defined if ppp_opts.h is not included before
opt.h in user code.
Fixup the LWIP_ETHERNET configuration value in ppp_opts.h in order to
force Ethernet support if PPPoE is enabled.
Fixes: 3ad2ad2329 ("Remove reference to PPPOE_SUPPORT in opt.h - leads
to compile errors because it has no default definition (only in
ppp_opts.h)"
2016-07-21 13:19:04 +02:00
Dirk Ziegelmeier
9cc3fb2e63
Fix comment in opt.h
2016-07-21 12:58:03 +02:00
Dirk Ziegelmeier
802a4f2a14
Fix compiling of snmp_mib2_ip.c when ARP is not enabled
2016-07-21 12:54:15 +02:00
Dirk Ziegelmeier
3ad2ad2329
Remove reference to PPPOE_SUPPORT in opt.h - leads to compile errors because it has no default definition (only in ppp_opts.h)
2016-07-21 12:53:33 +02:00
Dirk Ziegelmeier
299a19e135
Add travis-ci Continous integration to docs
2016-07-20 20:06:45 +02:00
goldsimon
e8ffac852e
Fixed bug #48551 (autoip_supplied_address() does not work when address is first assigned); fixed AutoIP timeouts
2016-07-20 08:28:16 +02:00
sg
98d58ffd59
minor: fixed wrong indentation
2016-07-19 22:38:34 +02:00
sg
97b8e88e69
netif_set_addr(): when removing an address (setting address to ANY), we have to remove it *before* changing netmask/gw to ensure that tcp RST segment can be sent correctly
2016-07-19 22:34:22 +02:00
sg
24a339a609
autoip: made private things private, use etharp_* shortcuts instead of etharp_raw()
2016-07-19 22:27:20 +02:00
sg
86e419425b
minor: code layout only
2016-07-19 22:06:59 +02:00
sg
d0a79ff085
fixed bug #48477 (ARP input packet might update static entry)
2016-07-19 22:01:42 +02:00
sg
dff46e3816
Fixed bug #48539 (possible crash when packet received in SYN_SENT state)
2016-07-19 21:23:21 +02:00
sg
b06f14c11f
worked on UPGRADING for 2.0.0
2016-07-19 20:38:08 +02:00
goldsimon
579fffd2ec
fixed task #14084 : make dhcp_supplied_address() usable in netif change callbacks triggered by changing the netif address assigned by dhcp
2016-07-19 12:58:21 +02:00
Dirk Ziegelmeier
5d4c1432c2
Fix bug #48436 : Naming clash for timers.c (with FreeRTOS)
...
Rename timers.* to timeouts.*
2016-07-19 12:44:12 +02:00
goldsimon
6adeb706a6
change tcp_pcb->acked to be a global variable: used in one call stack only (idea by Ambroz Bizjak)
2016-07-19 10:38:01 +02:00
goldsimon
c641ae3d3d
minor: tabs->spaces
2016-07-19 10:36:43 +02:00
Dirk Ziegelmeier
72208cddfa
Rename ip_frag.* to ip4_frag.*
2016-07-19 10:12:56 +02:00
Dirk Ziegelmeier
7037b340c1
Move etharp to core/ipv4, which is a more appropriate place for it
2016-07-19 09:29:51 +02:00
Dirk Ziegelmeier
06c7404461
Fix bug #48510 , DHCP requires ARP
...
Use solution 2 proposed by Jens Nielsen
2016-07-19 09:10:21 +02:00
goldsimon
6c0d78caaa
Fixed trying to send RST for unconnected (but bound) pcb
2016-07-19 09:05:48 +02:00
Dirk Ziegelmeier
4ec3d29168
Fix bug #48504 : tcp_debug_print_pcbs reads nonexisting tcp_pcb fields
2016-07-19 08:54:44 +02:00
Dirk Ziegelmeier
09636c5b92
Let lwip_stats appear in docs
2016-07-19 08:32:13 +02:00
Dirk Ziegelmeier
cb99ca099e
docs: RTF manual does not look good, deactivate it in lwip.Doxyfile
2016-07-19 08:27:09 +02:00
Dirk Ziegelmeier
2f950a7dcc
Some documentation updates
2016-07-18 23:00:41 +02:00
Dirk Ziegelmeier
a324c7a8e4
Update #defines in lwip.Doxyfile to generate meaningful memp.c docs
2016-07-16 19:04:12 +02:00
Dirk Ziegelmeier
4ea1d62d45
Update some doxygen comments
2016-07-16 17:56:29 +02:00
sg
421dab87e8
fixed bug #48476 (TCP sent callback called wrongly due to picking up old pcb->acked
2016-07-11 21:43:39 +02:00
Dirk Ziegelmeier
01e5d6d819
memp.c: No need to init variables located in BSS section
2016-07-08 11:44:28 +02:00
Ambroz Bizjak
18c332ae51
fixed bug #48402 (Bug in skipping over TCP options)
...
Signed-off-by: goldsimon <goldsimon@gmx.de >
2016-07-08 11:27:50 +02:00
goldsimon
9a355502e1
snmp: fix compiling traps :-(
2016-07-08 10:56:24 +02:00
goldsimon
52da49cd81
snmp: changed name (snmp_length_outbound_varbind -> snmp_varbind_length)
2016-07-08 10:24:06 +02:00
goldsimon
288fc8ede3
fixed unit tests after changing memp stats
2016-07-08 10:20:04 +02:00
goldsimon
6293a835e9
fixed compiling: forgot to move one line :-(
2016-07-08 10:16:46 +02:00
Dirk Ziegelmeier
6af4215f27
Next try to fix test_udp.c (can't compile it at my current machine)
2016-07-08 10:12:22 +02:00
goldsimon
2df636fe77
memp: fixed STATS initialization
2016-07-08 10:06:36 +02:00
goldsimon
e302b1bbd2
httpd: fixed using pools, fixed missing default value of LWIP_HTTPD_SSI_RAW, fixed typo
2016-07-08 10:06:35 +02:00
Dirk Ziegelmeier
c483520081
Fix compile of UDP unit test
2016-07-08 08:22:43 +02:00
goldsimon
959042aa88
memp: fixed compiling various combinations of memp stats (display etc.)
2016-07-08 08:21:57 +02:00
Dirk Ziegelmeier
a463119597
Revert "MEMP memory can now be declared static since LWIP_DECLARE_MEMORY_ALIGNED was introduced today"
...
This reverts commit e9b0003085 .
It should still be publically accessible to be able to add prototype declarations anyway.
2016-07-08 08:18:37 +02:00
Dirk Ziegelmeier
e0918d706e
Re-add a few MEMP stats accessors - users may want to access/display MEMP stats
2016-07-08 08:17:46 +02:00
Dirk Ziegelmeier
b939e9536d
Minor: move some macros from memp.h to memp_priv.h
2016-07-07 22:05:30 +02:00
Dirk Ziegelmeier
e9b0003085
MEMP memory can now be declared static since LWIP_DECLARE_MEMORY_ALIGNED was introduced today
2016-07-07 22:01:41 +02:00
Dirk Ziegelmeier
087ecab891
Add some comments to places where we cast through a void* to get rid of alignment warnings
2016-07-07 21:56:43 +02:00
Dirk Ziegelmeier
212eacd9d6
Fix bug #48356 : private memp pools have no statistic counters
...
Implement struct stats_mem instance for each pool, let lwip_stats.mem[] point to these instances
2016-07-07 21:55:51 +02:00
Marco Veeneman
dcd52510ce
Reduce code duplication in SNMP agent traps implementation.
...
See patch #9038 : SNMP Traps with varbinds, file #37748 by Marco Veeneman
2016-07-07 21:00:07 +02:00
Dirk Ziegelmeier
98e92f6550
Move alignment related #defines from mem.h to a better place: arch.h.
...
mem.h should only describe heap API, not architecture/port specific alignment helper macros.
2016-07-07 13:51:34 +02:00
Dirk Ziegelmeier
b91e47b518
Implement portable and overridable allocation of memory buffers
...
Fixes bug #48300 (Private mempools allocate foreign memory), bug #48354 (Portable alignment defines/include required for static allocation) and bug #47092 (Tag memory buffers like memp_memory_xxx and ram_heap with a macro so that attributes can be attached to their definitions)
Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de >
2016-07-07 13:35:13 +02:00
goldsimon
811b237bd7
dns: fixed declaration and usage of DNS_LOOKUP_LOCAL_EXTERN()
2016-07-07 13:02:47 +02:00
goldsimon
7e3de89646
minor: coding style
2016-07-07 13:02:18 +02:00
Dirk Ziegelmeier
4b136d631a
Fix (correct) clang warning about increased alignment requirements in netifapi.c and pppapi.c
2016-07-05 08:59:25 +02:00
Dirk Ziegelmeier
5a1b9bf808
SNMP traps quick fix: Do not return err_t as u16_t in snmp_varbind_len. This need further cleanup.
2016-07-05 08:48:59 +02:00
goldsimon
14ca418ac0
minor: coding style fixes
2016-07-05 07:36:51 +02:00
Dirk Ziegelmeier
cb5f7859fd
Apply patch #9038 : SNMP Traps with varbinds
...
Applied with modifications. Original patch from Marco Veeneman.
2016-07-04 21:11:20 +02:00
goldsimon
2fdea8b79b
fixed bug #48398 (dns: entries reused during found-callback could be aborted if ttl==0)
2016-07-04 13:55:20 +02:00
Michael Brown
2e26fc9224
tcp: Avoid 3-second delay for a half-open connection
...
If lwIP encounters a half-open connection (e.g. due to a restarted
application reusing the same port numbers) it will correctly send a
RST but will not resend the SYN until one retransmission timeout later
(approximately three seconds). This can increase the time taken by
lpxelinux.0 to fetch its configuration file from a few milliseconds to
around 30 seconds.
Fix by immediately retransmitting the SYN whenever a half-open
connection is detected.
Signed-off-by: Michael Brown <mcb30@ipxe.org >
Signed-off-by: goldsimon <goldsimon@gmx.de >
2016-07-04 12:25:22 +02:00
goldsimon
fd83f4fb22
Fix bug #48359 (dns entries are not set to state DONE)
2016-07-04 10:22:20 +02:00
Sylvain Rochet
d362e167c0
PPP, documentation: fix notify phase callback documentation
...
A little grammar fix and an indentation fix in example code.
2016-07-03 19:11:28 +02:00
Sylvain Rochet
a12c149093
PPP, documentation: add notify phase callback (PPP_NOTIFY_PHASE) documentation
...
Notify phase callback, enabled using the PPP_NOTIFY_PHASE config option,
let user configure a callback that is called on each PPP internal state
change. This documents how to use it.
2016-07-03 19:05:32 +02:00
Dirk Ziegelmeier
afa2a96085
Apply patch from Ambroz Bizjak:
...
I think that "#define SZT_F PRIuPTR" has a much better chance
of being right, making the assumption that uintptr_t is the same as
size_t.
Dirk: I think Ambroz is right.
2016-07-03 09:30:47 +02:00
Sylvain Rochet
9d0546839c
init: fix NO_SYS targets build
...
lwip/src/core/init.c:256:32: error: "LWIP_COMPAT_MUTEX" is not defined [-Werror=undef]
#if LWIP_TCPIP_CORE_LOCKING && LWIP_COMPAT_MUTEX && !defined(LWIP_COMPAT_MUTEX_ALLOWED)
^
Setting LWIP_TCPIP_CORE_LOCKING is meaningless for NO_SYS targets,
therefore checking if LWIP_COMPAT_MUTEX is set does not make sense.
Introduced by 42dfa71f97 : Make LWIP_TCPIP_CORE_LOCKING==1 the default
(and warn if LWIP_COMPAT_MUTEX==1 in that case as mutexes are required
to prevent priority inversion on tcpip_thread operations)
2016-07-02 21:53:24 +02:00
Sylvain Rochet
28aaf2caf4
PPP: introduce ppp_set_neg_pcomp, ppp_set_neg_accomp, ppp_set_neg_asyncmap, ppp_set_asyncmap
...
We are now able to add as many macros as necessary to change the PPP
configuration. Those are various usually used PPP options.
2016-07-02 21:42:51 +02:00
Sylvain Rochet
40e9eae791
PPP: improve various comments on options
2016-07-02 21:24:26 +02:00
Sylvain Rochet
f0dbba6406
PPP, PPPoE, PPPoL2TP: enforce disabling of silent and passive modes
...
PPP is just the upper protocol for PPPoE and PPPoL2TP, meaning it is only
started once "E" or L2TP is established. Therefore waiting indefinitely
for LCP packets on the PPP side does not make sense at all, if the lower
level protocol is UP, PPP *MUST* comes up as well or we should restart from
the beginning.
2016-07-02 21:10:24 +02:00
Sylvain Rochet
a99fe1fa32
PPP, LCP: restart flag is not used, build out
...
We don't support restart mode. Build out unused restart LCP flag.
2016-07-02 21:05:01 +02:00
Sylvain Rochet
e7069d6e82
PPP: introduce ppp_set_passive and ppp_set_silent
...
There is two passive modes for PPPoS, passive more, for which we will
try to connect and then listen silently, and silent mode, for which we
will listen silently from the beginning.
Introduce ppp_set_passive and ppp_set_silent so the mode can be chosen
before connecting/listening.
2016-07-02 21:03:48 +02:00
Sylvain Rochet
b97c4d96e2
PPP, SERVER: fix build if PAP_SUPPORT is not enabled
...
If PAP_SUPPORT is not enabled, we can't consider a failed PAP auth as
a null auth.
2016-07-02 20:02:47 +02:00
Sylvain Rochet
f21aede031
PPP: don't build ppp_set_auth if no authenticator are enabled
...
For our few users which might disable all authenticators to save some
flash, ensure that everything using authentication is build out.
2016-07-02 19:43:08 +02:00
Sylvain Rochet
c1c3d0e1ba
PPP: fix build when MSCHAP authentication feature is disabled at compile time
...
All modules using PolarSSL embedded library are now using pppcrypt.h.
This header use to be only necessary for MSCHAP and was not built if
MSCHAP wasn't enabled, we unfortunately left the build condition.
Introduced by 3417a02b25 : PPP: add a function map for hashes and ciphers
to prepare for mbed TLS support.
2016-07-02 19:36:34 +02:00
Sylvain Rochet
50b5b4c4dd
PPP, PPPAPI: remove useless pppapi_set_auth function
...
Setting PPP authentication most only be done when the PPP PCB is in the
dead phase (i.e. disconnected). This is safe to access the PPP PCB
members while the session is down, therefore providing a thread-safe
function of it is meaningless and it might even be misleading.
All our new ppp_set_* functions do not have their equivalent
pppapi_set_* functions and they are not going to have them. At least
we make ppp_set_auth consistent with all others ppp_set_*, so that it
doesn't look like special.
2016-07-02 19:09:50 +02:00
Sylvain Rochet
b9b36084a5
PPP: introduce ppp_set_mppe
...
Helper function to setup MPPE (Microsoft Point to Point Encryption) for
a PPP link. Allows enabling/disabled MPPE itself, enabling/disabling
stateless support, and whether we are willing to negotiate 40-bit
and/or 128-bit encryptions.
2016-07-02 18:53:59 +02:00
Sylvain Rochet
f226e107a6
PPP: updated pppd followup
2016-07-02 17:13:10 +02:00
Sylvain Rochet
d4f824398c
PPP, from PPPD upstream: fix sign-extension when displaying bytes in octal
...
print_string() displays characters as \\%.03o but without first
casting it from "char" to "unsigned char" so it gets sign-extended
to an int. This causes output like \37777777630 instead of \230.
(Based from pppd commit 5e8c3cb256a7e86e3572a82a75d51c6850efdbdc)
2016-07-02 17:12:38 +02:00
Sylvain Rochet
b438a0d6fd
PPP, PPPoE: fix potential out-of-bound if AC cookie is too long
...
Found by coverity.
Introduced by c0e7d54e37 "Removed 2 mem_mallocs: error string can be a
global variable, include memory for sc_ac_cookie in struct pppoe_softc;
commented out unused code (sc_service_name/sc_concentrator_name)".
Fixes it by bailing out if received AC cookie is to big for us, this
can't really happen anyway.
2016-07-02 16:20:57 +02:00
Sylvain Rochet
7c368b7f36
PPP, PPPoS: use offsetof in place of the traditional NULL hack
...
There is absolutely no reason I did it this way in the first
place, maybe I feared that not all compilers have a proper
implementation of offsetof() ? It sounds stupid.
2016-07-02 15:11:02 +02:00
goldsimon
06782c699c
httpd: fixed persistent connections for files not containing HTTP header
2016-07-01 12:43:03 +02:00
sg
42dfa71f97
Make LWIP_TCPIP_CORE_LOCKING==1 the default (and warn if LWIP_COMPAT_MUTEX==1 in that case as mutexes are required to prevent priority inversion on tcpip_thread operations)
2016-06-30 22:37:37 +02:00
Dirk Ziegelmeier
d3e55185c6
Apply patch #9034 : Use stdint.h and inttypes.h in lwip/arch.h
...
Ports now only need to define datatypes and format strings on compilers that do not provide these two headers. Known good: GCC, IAR. Known bad: MSVC 2010.
2016-06-30 20:15:22 +02:00
goldsimon
e6bc591a1e
fixed bug #48170 (Vulnerable to TCP RST spoofing) (original patch by Fabian Koch)
2016-06-30 08:50:42 +02:00
goldsimon
d31d2ee882
Revert "fixed bug #48170 (patch by Fabian Koch)"
...
This reverts commit 236bc19422 .
The fix introduced bug #48328 -> reverted
2016-06-30 08:41:50 +02:00
Dirk Ziegelmeier
91b5d8ad1e
Patch by Marco Veeneman: Generic snmpv1 traps should be sent from .1.3.6.1.2.1.11 (iso.org.dod.internet.mgmt.mib-2.snmp).
2016-06-29 22:16:43 +02:00
Dirk Ziegelmeier
aecbefc728
Patch by Marco Veeneman: Tthe variable bindings field is missing in the trap message. Even if there are no varbinds attached to the trap, this field should still be present.
2016-06-29 22:14:37 +02:00
Sylvain Rochet
ecbe45bf43
PPP, VJ: fixes potentially unaligned *u16_t and *u32_t accesses
...
Unfortunately, there is no standard way to declare a pointer with
potentially unaligned accesses. The only portable way is to create
packed struct.
VJ support uses optimized accesses to IP and TCP struct to check a
whole part of them at once to speed up the (de)compressor.
This commit wrap potentially unaligned *u16_t and *u32_t accesses with
packed struct so all compilers are able to deal with them properly.
Closes : #48308
2016-06-28 22:58:47 +02:00
Dirk Ziegelmeier
a0e8c2dd8f
Revert commit e40175ef05: Fix a few more CLANG alignment warnings - clang warns although the target struct is packed (and may therefore be unaligned) :-(
...
It was caused by a local problem on my PC, I forgot that I modified cc.h... :-( Sorry for that!
2016-06-28 21:54:48 +02:00
Dirk Ziegelmeier
500e748888
Fix [bug #48330 ] Memory leak in snmp_send_trap function
...
Forgot to free pbuf after sending it
2016-06-28 21:31:12 +02:00
Erik Ekman
4047702928
Fix clang warning about unreachable code
...
Do check with preprocessor instead
2016-06-27 22:32:18 +02:00
Dirk Ziegelmeier
5d356c96f5
Minor: cleanup my last commit
2016-06-27 20:57:22 +02:00
Dirk Ziegelmeier
39545d2c6d
Fix clang warning about unreachable code
2016-06-27 20:56:21 +02:00
Dirk Ziegelmeier
e40175ef05
Fix a few more CLANG alignment warnings - clang warns although the target struct is packed (and may therefore be unaligned) :-(
2016-06-27 20:54:17 +02:00
goldsimon
2d7a6a5d94
remove "LWIP_HTTPD_MAX_CGI_PARAMETERS" from httpd.h (has already been moved to httpd_opts.h
2016-06-27 11:03:46 +02:00
goldsimon
c164869f6d
snmp: use 'tcpip_callback' instead of '.._with_block'
2016-06-27 11:01:34 +02:00
goldsimon
236bc19422
fixed bug #48170 (patch by Fabian Koch)
2016-06-27 10:31:36 +02:00
Sylvain Rochet
ddac5b1895
PPP: introduce ppp_set_listen_time
...
Wait for up to the specified milliseconds for a valid PPP packet from
the peer. At the end of this time, or when a valid PPP packet is
received from the peer, we commence negotiation by sending our first
LCP packet.
This is useful because PPP does not deal properly when both peers
are sending the first LCP packet in the exact same time, which causes
delays because they both wait for a reply for their own packet.
2016-06-26 22:51:40 +02:00
Sylvain Rochet
9a70715371
PPP, SERVER: move silent mode set from pppos_listen to ppp_listen
...
This flag would be required for any low level protocol used. Move it
from pppos_listen to ppp_listen.
2016-06-26 22:37:41 +02:00
Sylvain Rochet
96296947fc
PPP: introduce ppp_set_auth_required macro
...
PPP auth required flag is currently hardcoded to true if PPP is
acting as a server and set to false if PPP is acting as a client.
This is probably the most wanted behavior, but since we now have the
ability to change that at runtime, allow users to do it.
It means we can now have a server which asks the client to authenticate
or vice versa. This is pretty unusual thought. What we don't support
yet is mutual authentication with a different set of user and password
per direction which is even less usual.
2016-06-26 22:31:02 +02:00
Sylvain Rochet
8b9886bfe2
PPP, documentation: rework client configuration vs server configuration
...
Better describe what should be done for a client session and for a
server session.
2016-06-26 21:59:25 +02:00
Sylvain Rochet
9015c28406
PPP, DNS: introduce ppp_set_usepeerdns macro
...
PPP use peer DNS setting is currently hardcoded to true if PPP is
acting as a client and set to false if PPP is actinf as a server.
This is probably the most wanted behavior, but since we now have the
ability to change that at runtime, allow users to do it.
We don't have a way to have a different default configuration if the
PPP PCB is going to be used as a client or as a server, therefore the
default configuration should be fine for both of them. Since enabling
peer DNS by default is dangerous for server mode, the default is now
not to ask for DNS servers and it should now be explicitely enabled
if needed, update the documentation accordingly.
2016-06-26 21:36:48 +02:00
Sylvain Rochet
b77fcef1a5
PPP, L2TP: remove unnecessary l2tp->udp null check
...
l2tp->udp can't be null here, pppol2tp_create returns a NULL L2TP PCB
if UDP PCB failed to be created. Remove useless null check.
2016-06-26 21:17:54 +02:00
Sylvain Rochet
6fb074874b
PPP, Documentation: add PPP server(listener) documentation
...
Now that creating a PPP listener session is a bit less obvious than
before (but much versatile!), add documentation about the most common
way to setup a PPP listener.
2016-06-26 20:32:28 +02:00
Sylvain Rochet
3d684cda23
PPP, PPPoS, SERVER: remove useless struct ppp_addrs* argument from pppos_listen
...
Now that we have helpers to set those members externaly, pppos_listen
struct ppp_addrs* argument does not add any value. In addition it
was not a well chosen design choice because the user needed to keep a
copy of struct ppp_addrs when listening again for a new connection.
2016-06-26 20:26:35 +02:00
Sylvain Rochet
71ca26b212
PPP, add configuration macros to set IPCP our, his, and DNS IPv4 addresses
...
Mostly for PPP server support, but not limited too, we need a way to
configure static IPv4 addresses for our side (our), peer side (his),
and two DNS server addresses if peer asks for them.
2016-06-26 19:44:44 +02:00
Sylvain Rochet
4a5422cd11
PPP, PPPoS, SERVER: fix DNS servers support
...
DNS servers should be set in IPCP allowoptions instead of wantoptions.
In addition if server mode is enabled we need to disable usepeerdns
config flag so we are not asking DNS servers to our client.
2016-06-26 19:16:51 +02:00
Dirk Ziegelmeier
38c0255fa2
Fix a few more CLANG format string warnings (from unix check project)
2016-06-25 13:24:48 +02:00
Dirk Ziegelmeier
102f5882d5
Fix several CLANG format string warnings
2016-06-25 13:06:31 +02:00
Dirk Ziegelmeier
19e2b15c41
Fix alignment warnings in snmp agent - we know these structs are aligned according to requirements when they are casted because they have been instantiated as the target type (clang)
2016-06-24 21:21:38 +02:00
Dirk Ziegelmeier
a929f418e7
Fix format string in httpd.c (clang)
2016-06-24 21:16:44 +02:00
Dirk Ziegelmeier
0116c3cd76
Fix "no newline at end of file" warnings (clang)
2016-06-24 21:16:12 +02:00
Dirk Ziegelmeier
2c1bd363e6
Try again - fix bug #48300 : Private mempools allocate foreign memory
2016-06-24 12:33:20 +02:00
Erik Ekman
efd3fb8f4e
Fix pedantic dhcp test error
...
../../../../lwip/test/unit/dhcp/test_dhcp.c:121:34: error: comma at end
of enumerator list [-Werror=edantic]
cc1: all warnings being treated as errors
2016-06-24 09:24:15 +02:00
Erik Ekman
94e502fc8a
Switch to C-style comments in test lwipopts
2016-06-24 09:16:56 +02:00
Sylvain Rochet
224d5a9f33
PPP, fix comment about opt.h (moved to ppp_opts.h)
...
PPP defines were moved from opt.h to ppp_opts.h but comments
referencing opt.h in PPP were not updated.
2016-06-23 23:17:39 +02:00
Dirk Ziegelmeier
d133999e1d
Fix warnings in unit test code when compiling with stricter GCC settings
2016-06-23 22:30:37 +02:00
Dirk Ziegelmeier
98c741976b
Fix bug #48300 : Private mempools allocate foreign memory
...
Add padding to memory pool mem according to alignment
2016-06-23 20:20:19 +02:00
Dirk Ziegelmeier
502f08cb92
ip.h doxygen documentation updates
2016-06-22 21:22:47 +02:00
Dirk Ziegelmeier
1af40e7de2
SNMP doxygen updates
2016-06-22 21:11:59 +02:00
Dirk Ziegelmeier
75c5829a57
Lots of documentation updates
2016-06-22 20:46:19 +02:00
Dirk Ziegelmeier
8dc77ef558
doxygen updates - include IPv6 in documentation. Exclude include/netif/ppp/polarssl.
...
Convert TODO -> @todo
2016-06-22 20:18:23 +02:00
Sylvain Rochet
cfe5182380
timers: fix wrong timings for !NO_SYS targets
...
issue 1:
sys_arch_sem_wait() is supposed to return an elapsed time in ms, what could
happen given a > 1 kHz calling rate for high throughput systems is that it
might always returns 0 ms. This is a problem for systems which compute the
elapsed time from a high precision clock source.
This is what is currently happening in the unix port in sys_arch_sem_wait():
start time -> 1000000000; // ns
-- less than a ms before an event arrive --
end time -> 1000xxxxxx; // ns
return value -> (end time - start time)/1000000 -> 0
The return value is used to reduce the next timer interval, if
sys_arch_sem_wait() always return 0 no more timers are fired anymore
issue 2:
The current timer implementation for !NO_SYS targets only count elapsed
time while -waiting- for semaphore and doesn't count at all the time
spent by the stack to process packets. For CPU bound traffic patterns no
more timers are fired anymore.
Both are serious design issues which cannot be easily fixed without reworking
everything. This patch uses the properly implemented timers for NO_SYS targets
for !NO_SYS targets and merge them both into one single timers implementation.
2016-06-20 16:17:55 +02:00
Sylvain Rochet
2040f4f0b1
PPP, trivial debug messages fixes/add
...
This change only add one debug message to ppp_link_start function
and fix the message debug string of ppp_link_failed and ppp_link_end.
2016-06-20 00:42:17 +02:00
Sylvain Rochet
7b4bd3343b
PPP, rename ppp_clear function to ppp_link_start
...
This function does not clear anything anymore. What it is now is an
optional way to notify PPP that link layer is started, changing the
PPP state from "dead" to "initialize". Rename it accordingly to what
the function really is.
2016-06-20 00:32:54 +02:00
Sylvain Rochet
1d108b400f
PPP, move various connect cleanup from ppp_clear to ppp_start
...
What we really need here is to cleanup the PPP environment before
starting LCP, we don't care about the PPP state before LCP is
started. Move cleanups from ppp_clear to ppp_start to clean them
just before we need them cleaned.
2016-06-20 00:25:59 +02:00
Sylvain Rochet
42d50eba4e
PPP, move protocols initialization from ppp_clear to ppp_new
...
What protocols init functions are meant to is to be called once to set
the default configuration before user specific configuration is set.
Until now, we reset to the default configuration just before
reconnecting, thus without allowing any time frame to let users change
it. That was fine until one user asked to be able to do that.
This change move protocols init functions calls from ppp_clear to
ppp_new, meaning user configuration is not overwritten anymore.
2016-06-19 23:48:08 +02:00
Sylvain Rochet
7df5496e7b
PPP, rework initial/reconnect cleanup
...
Our previous way of doing it was to clear everything except a small part
of the ppp_pcb structure and then populate the structure with default
values using protocols init functions.
But it means the user is currently not allowed to change the default
configuration except the few flags and values that are currently
available in the ppp_settings structure.
Instead of adding more and more fields to the ppp_settings structure,
actually making them duplicate of already existing structure members
of ppp_pcb, but unfortunately cleaned, we carefully checked that
everything is properly cleaned during protocol lowerdown/close and
replaced our giant memset to selective memset of the few ppp_pcb
members that are not properly cleaned.
2016-06-19 23:26:47 +02:00
Sylvain Rochet
c751802fad
PPP, CCP, move user configuration from ccp_init to ccp_resetci
...
ccp_init() is meant to be called once, providing default configuration
before user specific configuration is applied. In pppd user configuration
is set just after all protocol init functions are called, in lwIP we
use protocol reset functions to do that, which is more or less the same.
Therefore, be consistent and move CCP user configuration from ccp_init
to ccp_resetci.
2016-06-19 19:49:46 +02:00
goldsimon
6d95a34971
icmp ping response: fix invalid checksum (and possible assertion failure) when ip header contains options (is it correct that we mirror back all options)
2016-06-17 10:07:49 +02:00
goldsimon
61e067b98a
Check for minimum IPv4 header length in rx packets
2016-06-17 09:36:14 +02:00
goldsimon
fda778f6b6
ip6_reass: don't crash if frag header isn't the first (or not in the first pbuf)
2016-06-16 13:51:38 +02:00
Erik Ekman
d98e25a783
nd6: Handle incorrect ICMP option length in RA
...
Make sure ICMPv6 options have a valid length before
parsing them.
Found with afl-fuzz.
2016-06-14 15:06:49 +02:00
sg
4e241fbf14
some minor improvements to the tcp options checking code
2016-06-13 20:41:58 +02:00
Henrik Persson
b9a2ee8aaa
[PATCH] Drop instead of ASSERT in tcp_input header parsing
...
Since allowing input validation to trip the ASSERT handler is bad,
let's just drop the packets instead if validation fails.
Signed-off-by: sg <goldsimon@gmx.de >
2016-06-13 20:08:43 +02:00
Erik Ekman
25652254a5
Update PPP after DNS api change
2016-06-13 10:35:27 +02:00
Dirk Ziegelmeier
5e7b343d52
Fix dns_getserver to return a pointer, not a value
2016-06-13 09:00:46 +02:00
Dirk Ziegelmeier
606b6990ff
Reorganize links in doxygen documentation
2016-06-12 10:41:44 +02:00
Dirk Ziegelmeier
270378387c
Fix broken link in doxygen docs
2016-06-12 10:39:33 +02:00
Dirk Ziegelmeier
9ddde3ef4a
Fix doxygen warnings
2016-06-11 22:57:55 +02:00
Dirk Ziegelmeier
5a056cc861
Update main documentation page
2016-06-11 22:50:53 +02:00
goldsimon
5d9f59daa4
httpd makefsdata: make http response server string configurable via command line, tiny fixes to usage and command interpretation
2016-06-10 13:35:38 +02:00
goldsimon
076f1ee89e
minor: coding style cleanup in snmp code
2016-06-09 14:28:04 +02:00
goldsimon
010b0e2972
snmp: don't assert-fail on zero-length OID
2016-06-09 11:47:15 +02:00
goldsimon
952da88b84
httpd: explicitly added 2 includes that came in through tcp.h by accident...
2016-05-31 16:18:14 +02:00
Dirk Ziegelmeier
9be133777b
Add threading note to api.h
2016-05-25 21:42:59 +02:00
Dirk Ziegelmeier
6be7e221a5
Fix a few doxygen warnings
2016-05-24 22:29:18 +02:00
Dirk Ziegelmeier
a364427ae5
Resurrect doxygen main page (main_page.h)
2016-05-24 21:27:38 +02:00
Dirk Ziegelmeier
451277e7f0
Include all lwIP files in doxygen documentation
2016-05-24 21:03:41 +02:00
Dirk Ziegelmeier
51f3cdfd5a
Fix UTF-8 encoding of sntp files (Frédéric Bernon)
2016-05-24 13:14:18 +02:00
goldsimon
344de0e119
fixed comments on netconn_shutdown to prevent using full-duplex wording...
2016-05-24 10:01:03 +02:00
Jan Breuer
bfd3baa20e
netif: add additional getters/setters
2016-05-23 22:29:53 +02:00
sg
631c458c55
Fixed invalid DEBUGF level SERIOUS when pbuf_header fails (it returns '1': this is not serious!)
2016-05-23 22:06:02 +02:00
Dirk Ziegelmeier
6c8c3fd48c
Fix more doxygen errors
2016-05-23 21:38:18 +02:00
Dirk Ziegelmeier
90a656ed78
Fix several doxygen errors all over the code
2016-05-23 21:18:16 +02:00
Dirk Ziegelmeier
f4bf0dff85
Update doxygen file to work with recent doxygen versions
2016-05-23 20:16:20 +02:00
Dirk Ziegelmeier
59af802fb6
Add spaces around string concatenation macro (fixes compile on some compilers)
2016-05-23 10:34:58 +02:00
Jan Breuer
ebd103775d
ipv6_addr: Render last zero in ip6addr_ntoa_r if not in first empty block
2016-05-23 09:54:54 +02:00
goldsimon
bd177ff38f
added comment, fixed coding style
2016-05-23 09:47:14 +02:00
Jan Breuer
ac21a5f370
nd6: add cleanup function
2016-05-23 09:44:27 +02:00
Dirk Ziegelmeier
ac0af0d7c7
Fix return value of sntp_getserver() call to return a pointer
2016-05-20 11:02:02 +02:00
Dirk Ziegelmeier
8e7b8a32f9
Rename LwipMibViewer to MibViewer since it does not depend on lwip specific code
2016-05-15 13:09:57 +02:00
Axel Lin
ab989c3551
PPP: Use LWIP_ARRAYSIZE at appropriate places
...
Use LWIP_ARRAYSIZE to simplify the code.
Signed-off-by: Axel Lin <axel.lin@ingics.com >
Reviewed-by: Sylvain Rochet <gradator@gradator.net >
[Sylvain Rochet <gradator@gradator.net >: added missing casts]
Signed-off-by: Sylvain Rochet <gradator@gradator.net >
2016-05-12 23:08:34 +02:00
Axel Lin
8c0f620d83
dns: Use LWIP_ARRAYSIZE instead of open coded
...
Signed-off-by: Axel Lin <axel.lin@ingics.com >
2016-05-11 12:20:15 +02:00
Axel Lin
7e9377a9c7
dhcp: Use LWIP_ARRAYSIZE to get the number of array entries
...
dhcp_discover_request_options is u8_t array, so the result is the same.
But use LWIP_ARRAYSIZE to get the number of array entries is better
because it works for all types.
Signed-off-by: Axel Lin <axel.lin@ingics.com >
2016-05-11 12:15:12 +02:00
Sylvain Rochet
9f69bf82df
PPP, documentation, updated to recent changes
...
Fixed PPPAPI include path.
Improved note about SIO's farewell.
2016-05-11 10:56:49 +02:00
goldsimon
c6949d88d9
fixed unused variable warning in tcpip_api_call() for certain configurations
2016-05-11 09:43:06 +02:00
Sylvain Rochet
45c6279bb0
PPP, documentation, update next release version
...
Next release will be 2.0.0 instead of 1.5.0, change that in the
documentation.
2016-05-11 00:42:59 +02:00
Sylvain Rochet
b9389c6eaf
PPP: remove sio.h from included files
...
PPP is not using the SIO API anymore for quite a while. Remove now
useless sio.h from included files.
2016-05-11 00:19:27 +02:00
Sylvain Rochet
b08f73be44
snmpv3: replace arch/cc.h to lwip/arch.h in included files
...
Only "lwip/arch.h" is expected to include "arch/cc.h". This is the same
spirit than "lwip/opt.h" for "lwipopts.h" and "lwip/sys.h" for
"arch/sys_arch.h".
2016-05-10 23:25:14 +02:00
Sylvain Rochet
33fc20cca2
PPP: use mbed TLS sanitize functions if available
...
mbed TLS offers sanitize functions to zero-ise memory containing
cryptographic keys, use them if built with external mbed TLS library.
2016-05-08 21:58:56 +02:00
Sylvain Rochet
5df4f70a96
PPP: add a new LWIP_USE_EXTERNAL_MBEDTLS PPP option
...
PPP users can now choose to use an external mbed TLS copy instead of using
our internal old version (but released under a BSDish license) PolarSSL copy.
2016-05-08 21:26:19 +02:00
Sylvain Rochet
9f3aff0cdf
PPP: add a new LWIP_USE_EXTERNAL_POLARSSL PPP option
...
In order to welcome mbed TLS, we need to ease the switch to:
- embedded PolarSSL 0.10.1-bsd copy
or - external PolarSSL
or - external mbed TLS
This change cleanup all our previously used LWIP_INCLUDED_POLARSSL_* defines,
which were not really useful after all, making them internal build triggers
only, and this change provides a new unique global flag to use an external
PolarSSL copy.
2016-05-08 20:23:21 +02:00
Sylvain Rochet
3417a02b25
PPP: add a function map for hashes and ciphers to prepare for mbed TLS support
...
Unfortunately, all functions were renamed when PolarSSL was renamed to
mbed TLS, breaking the API. In order to continue supporting our embedded
PolarSSL copy while allowing our users to use mbed TLS, we need a function
map to deal with the API break.
This commit add a function map for all hashes and ciphers we are currently
using.
2016-05-08 20:20:42 +02:00
Sylvain Rochet
1dcd5d31d7
pbuf: fix undefined PBUF_POOL_FREE_OOSEQ if TCP_QUEUE_OOSEQ is disabled
...
lwip/src/core/timers.c: In function ‘sys_check_timeouts’:
lwip/src/core/timers.c:328:5: error: "PBUF_POOL_FREE_OOSEQ" is not defined [-Werror=undef]
#if PBUF_POOL_FREE_OOSEQ
Fix it by declaring an empty PBUF_CHECK_FREE_OOSEQ() function if feature is
not enabled.
2016-05-08 03:09:51 +02:00
Sylvain Rochet
73b8026cb9
PPP, code cleaning
...
lwIP indentation is 2 characters, fix ppp_init indentation.
2016-05-07 01:51:52 +02:00
Sylvain Rochet
fc2701ae03
PPP, ppp_init function is back, re-add magic_init
...
Work on PPP MEMPOOL re-added the previously removed ppp_init function
because we considered it useless. Re-add magic_init which was
previously in ppp_init and removed in commit 15fbfb7363 , it does
not hurt doing so and might fill the gap if we failed understanding
the crypto implication about removing it.
2016-05-07 01:48:17 +02:00
Dirk Ziegelmeier
4a6c444a17
httpd: Use newly created LWIP_VERSION_STRING
2016-05-04 10:24:12 +02:00
goldsimon
05961a27cf
d'OH! (forgot end of comment)
2016-05-04 10:10:13 +02:00
goldsimon
93665a7659
Change version info from 1.5.0(dev) to 2.0.0(dev), added LWIP_VERSION_STRING ("1.2.3" with a suffix for git dev or rcX unless release version)
2016-05-04 10:03:48 +02:00
Dirk Ziegelmeier
49badf39a1
Fix bug #47805 : dhcp_recv can dereference NULL pointer
2016-04-29 11:16:33 +02:00
Dirk Ziegelmeier
2e05856f90
Fix bug #47641 : lwIP would accept IPv6 source addresses from the network that are mapped IPv4 adresses
2016-04-27 21:35:34 +02:00
Dirk Ziegelmeier
30e6f908ee
Fix bug #47512 : MPU_COMPATIBLE may fail on empty pool
2016-04-27 21:14:17 +02:00
Dirk Ziegelmeier
e653ac9db7
Remove netconn_recved() call - it was only needed in sockets implementation and contributed to bug #47512
...
Simon and I think it can be removed - the receive window handling get a little less precise, but that should be OK for a lightweight stack.
Receive window is now updated with the whole pbuf size (instead of only count of read bytes from socket) as soon as socket implementation gets a pbuf from netconn layer.
Work on bug #47512 : MPU_COMPATIBLE may fail on empty pool (still not finished)
2016-04-27 21:02:16 +02:00
Dirk Ziegelmeier
21354af674
Work on bug #47512 : MPU_COMPATIBLE may fail on empty pool (still not finished)
2016-04-27 12:49:06 +02:00
goldsimon
c981b726f8
fixed bug #47601 (wrong NS request at DAD)
2016-04-27 10:19:13 +02:00
Dirk Ziegelmeier
21e6e1c824
Fix compile errors found by Erik Ekman's Travis-CI
2016-04-26 22:09:23 +02:00
Dirk Ziegelmeier
b07031479c
Revert "tcpip_send_msg_wait_sem() can return void now due to my last changes"
...
My brain was asleep
This reverts commit 475be665ff .
2016-04-26 22:03:18 +02:00
Dirk Ziegelmeier
475be665ff
tcpip_send_msg_wait_sem() can return void now due to my last changes
2016-04-26 21:40:19 +02:00
Dirk Ziegelmeier
3d38af5174
Work on bug #47512 : MPU_COMPATIBLE may fail on empty pool (not finished!)
2016-04-26 21:33:02 +02:00
Dirk Ziegelmeier
b28a80375b
Fix bug #47446 : tcpip api calls: fail if mbox is invalid instead of returning an error
2016-04-26 21:09:03 +02:00
Dirk Ziegelmeier
a5d4a27ae1
Fix compile warnings (==errors) in new httpd
2016-04-26 20:53:25 +02:00
goldsimon
afd9ee9147
fixed bug #47743 (Closing listening tcp pcb is not posible without assert)
2016-04-26 13:27:17 +02:00
Dirk Ziegelmeier
afd1bb938e
Fix compile of Simon's last change on MSVC
2016-04-26 13:19:32 +02:00
goldsimon
025d5591eb
httpd improvements: added persistent connections, improved asynchronous read mode, compile-time deflate compression, new CGI mode, SSI handler can be called with tag string (instead of tag index)
2016-04-26 13:00:27 +02:00
Dirk Ziegelmeier
7d77a52ea5
Fix compile when PPP is not enabled - Macro MEMP_NUM_PPP_PCB always needs to be #defined
2016-04-25 22:24:33 +02:00
Dirk Ziegelmeier
2b5250dd9d
Fix bug #47507 : PPP API does not support LWIP_MPU_COMPATIBLE
...
I'd be glad if someone would test it :-)
Sylvain, if you don't like this patch feel free to revert it
2016-04-25 21:23:14 +02:00
Dirk Ziegelmeier
8ce49499ae
tcpip_priv.h: More API improvements
2016-04-25 21:21:16 +02:00
Dirk Ziegelmeier
5a123a3405
tcpip_priv.h: More flexible API by including return value in API_VAR_ALLOC macro
2016-04-25 21:00:28 +02:00
Dirk Ziegelmeier
0d0b935d3d
tcpip_priv.h: Add helper macros for APIs that use private mempools
2016-04-25 20:51:26 +02:00
Dirk Ziegelmeier
2be86fbc3e
Fix compile of api_lib.c when LWIP_MPU_COMPATIBLE is enabled
2016-04-25 20:50:14 +02:00
Dirk Ziegelmeier
bb908366a5
More PPP cleanups
2016-04-25 20:08:29 +02:00
Dirk Ziegelmeier
73d8f14ebd
Fix compile when PPP is not enabled
2016-04-25 20:08:29 +02:00
Dirk Ziegelmeier
ffa340a68c
task #13907 : PPP cleanups: Move PPP mempools out of lwIP core to PPP code
2016-04-25 20:08:29 +02:00
Dirk Ziegelmeier
b8b83c2994
Move some definitions from tcpip_priv.h to better places since they are of "public interest" (LWIP core locking mode, watchdog trigger)
2016-04-23 10:24:17 +02:00
Dirk Ziegelmeier
4d1a2e6699
Fix projects without PPP do not compile any more
2016-04-22 06:24:01 +02:00
Sylvain Rochet
15fbfb7363
PPP, remove useless ppp_init function
...
Simon says:
ppp_init() does not seem to be used. The only thing it does is calling
magic_init(), which is not required because it its called again later
from ppp_input().
Also, the time from startup is rather constant, so calling sys_jiffies()
from ppp_init() does not create a random number.
2016-04-21 23:25:48 +02:00
Sylvain Rochet
54f7cae12c
PPP, fix reserved identifier violation (removed leading underscores from header include guards)
2016-04-21 23:15:49 +02:00
Dirk Ziegelmeier
76d25befb4
Work on task #13907 PPP cleanups: Move PPP options from opt.h to dedicated ppp_opts.h file
2016-04-21 22:28:14 +02:00
Dirk Ziegelmeier
749f7fae1a
Move PPP API files to netif/ppp subdir
2016-04-21 21:47:26 +02:00
Dirk Ziegelmeier
61d07f88f0
Fix bug #47749 : #define ETHARP_TRUST_IP_MAC does not compile
2016-04-21 21:21:56 +02:00
Joel Cunningham
8ac1b4825a
udp: use netif addr as src for multicast sockets
...
Sockets bound to a multicast address could not transmit multicast
packets because the pcb local address did not match the netif address
even if the outgoing netif was resolved correctly.
To correct the issue, pcbs with a multicast local address will use
the outgoing netif address as the source address in IPv4.
2016-04-18 16:36:13 -04:00
Dirk Ziegelmeier
87354abf0f
snmpv3_mbedtls.c: snmpv3_crypt() is only needed when LWIP_SNMP_V3_CRYPTO is enabled
2016-04-14 08:26:29 +02:00
Dirk Ziegelmeier
0b6370b9b8
SNMPv3: Make receiving DES encrypted frames work, sending still fails because of broken padding
2016-04-11 22:04:28 +02:00
Dirk Ziegelmeier
92f5da8412
two minor fixes in snmpv3_mbedtls.c
2016-04-07 06:58:58 +02:00
Dirk Ziegelmeier
309e072238
Create new IP_IS_V4 macros and use them at instead of !IP_IS_V6 - since we now have an IPADDR_ANY_TYPE, just checking for !V6 does not mean it is V4
2016-04-06 22:31:31 +02:00
Dirk Ziegelmeier
ab2c65549d
Avoid divisions / module in SNMP code on stupid compilers
...
Signed-off-by: goldsimon <goldsimon@gmx.de >
2016-04-06 11:16:54 +02:00
sg
ca1b8288de
prepare for overriding current timeout implementation: all stack-internal caclic timers are avaliable in the lwip_cyclic_timers array
2016-04-05 23:01:57 +02:00
sg
8c7f513f4d
patch #8358 : allow more combinations of listening PCB for IPv6
2016-04-05 22:04:19 +02:00
sg
16c70dd60e
fixed bug# 43739 (Accept not reporting errors about aborted connections): netconn_accept() returns ERR_ABRT (sockets: ECONNABORTED) for aborted connections, ERR_CLSD (sockets: EINVAL) if the listening netconn is closed, which better seems to follow the standard
2016-04-05 21:42:10 +02:00
sg
03e9c88488
fixed bug #47625 (Error in compilation of C++ source using netifapi macros) by changing NULL define for __cplusplus
2016-04-05 21:04:06 +02:00
sg
0731eda0b3
make autoip_supplied_address() take a const pointer, too
2016-04-05 20:38:11 +02:00
Dirk Ziegelmeier
083c6123d6
snmpv3_dummy.c: Add newline at end of file
2016-04-05 13:18:54 +02:00
Dirk Ziegelmeier
12a4cae404
Apply [patch #8969 ] from Freddie Chopin: Constify netif in dhcp_supplied_address()
2016-04-05 13:18:27 +02:00
Dirk Ziegelmeier
3a26e8b6cc
Fix build when snmpv3 is not available. One more thanks, Erik :-)
2016-04-04 22:10:59 +02:00
Dirk Ziegelmeier
28652d4d51
Fix build when mbedtls is not available :-) Thanks Erik!
2016-04-04 22:07:50 +02:00
Dirk Ziegelmeier
b67427bd3b
Commit Elias Oenal's SNMPv3 work, with some restructuring:
...
- The abstraction from crypto framework was not well suitable to MBEDTLS, so I decided to move everything into an own file.
- I removed several #defines and created function prototypes instead - this is more type-safe, and users don't need to reinvent the function signatures.
- Header files were splitted into a public and a private part.
- Only SNMPv3 authentication was tested, privacy not yet.
2016-04-04 18:55:32 +02:00
Dirk Ziegelmeier
3a7c998f91
Fix bug #47592 : pppapi_do_ppp_set_notify_phase_callback has invalid parameter type
...
... and one more I missed in my conversion yesterday
2016-04-01 10:38:27 +02:00
Dirk Ziegelmeier
141aeaab3d
Fix shadowing warning (when compiling in C++) in TCPIP call API. Reported by Freddie Chopin.
2016-03-31 19:52:20 +02:00
Dirk Ziegelmeier
c8b65f6c1d
Fix #define IPADDR_STRLEN_MAX in IPv6 only and dual-stack case
2016-03-30 11:20:54 +02:00
Dirk Ziegelmeier
d70d9bf866
SNTP: Add function to get SNTP enabled state
2016-03-30 11:20:16 +02:00
Dirk Ziegelmeier
4bd57882b0
Fix SNMP compile on Win32 due to missing #includes
2016-03-29 16:51:33 +02:00
Dirk Ziegelmeier
52fdc6bb3e
Partly apply Elias Oenal's SNMP V3 patch, part 2: Add SNMPv3 support routines. Crypto does not work yet.
2016-03-29 10:28:33 +02:00
Dirk Ziegelmeier
d0c3baf340
Partly apply Elias Oenal's SNMP V3 patch. There is more to come, the work is incomplete at the moment and does not compile when LWIP_SNMP_V3 is enabled.
2016-03-29 10:28:33 +02:00
Dirk Ziegelmeier
6f43057662
Update changelog
2016-03-29 10:28:33 +02:00
Dirk Ziegelmeier
d8784a77b7
Fix bug #47556 : snmp agent uses wrong err 'ERR_ABRT' - use ERR_ARG as old code. Was tested to be != ERR_OK only, so actual code did not matter
2016-03-28 16:57:36 +02:00
sg
27f03798b9
Fixed possible problems with tcp_backlog_delayed/tcp_backlog_accepted
2016-03-25 16:19:39 +01:00
goldsimon
5b0a47ca87
removed unused return values of tcp_listen_input & tcp_timewait_input; fixed unused variable warning
2016-03-24 15:06:31 +01:00
Dirk Ziegelmeier
9b0a0841e9
Fix compile of snmp/snmp_mib2.c - don't know why I didn't notice yesterday...
2016-03-24 14:31:33 +01:00
goldsimon
0b4bc5ea31
minor whitespace change only
2016-03-24 07:15:27 +01:00
Dirk Ziegelmeier
cab341976e
SNMP: Reduce #includes of snmp_mib2.c
2016-03-23 22:36:02 +01:00
Dirk Ziegelmeier
52a3bf5d43
SNMP: Cleanups after my last changes
2016-03-23 22:32:47 +01:00
Dirk Ziegelmeier
63c2dc926e
SNMP: Move MIB2 ip subtree to separate file to get snmp_mib2.c smaller
2016-03-23 22:32:47 +01:00
Dirk Ziegelmeier
cc477361ad
SNMP: Move MIB2 system subtree to separate file to get snmp_mib2.c smaller
2016-03-23 22:32:47 +01:00
Dirk Ziegelmeier
377885581f
SNMP: Move MIB2 interfaces subtree to separate file to get snmp_mib2.c smaller
2016-03-23 22:32:47 +01:00
Dirk Ziegelmeier
7321420d8c
SNMP: Move MIB2 ICMP subtree to separate file to get snmp_mib2.c smaller
2016-03-23 22:32:47 +01:00
Dirk Ziegelmeier
9466d64a9a
SNMP: Move MIB2 TCP subtree to separate file to get snmp_mib2.c smaller
2016-03-23 22:32:47 +01:00
Dirk Ziegelmeier
d929a4b17e
SNMP: Move MIB2 UDP subtree to separate file to get snmp_mib2.c smaller
2016-03-23 22:32:46 +01:00
Dirk Ziegelmeier
945607e094
SNMP: Move MIB2 SNMP subtree to separate file to get snmp_mib2.c smaller
2016-03-23 22:32:46 +01:00
sg
7721b20179
call accept-callback with ERR_MEM when allocating a pcb fails on passive open to inform the application about this error; ATTENTION: applications have to handle NULL pcb in accept callback!
2016-03-23 21:57:38 +01:00
sg
c6b742812d
fixed bug #38203 : DHCP options are not recorded in all DHCP ack messages (patch by Florent Matignon)
2016-03-23 21:06:52 +01:00
goldsimon
85d5fbdc7f
lwip_accept: fixed returning EOPNOTSUPP instead of -1 (EOPNOTSUPP is set as socket error)
2016-03-23 14:27:40 +01:00
Axel Lin
449fc98a55
tcp_alloc(): Remove superfluous initialization for pcb->keep_cnt_sent
...
It's already done by memset(0). This was missed in commit 5794ac2340
"tcp_alloc(): remove explicit =0 already done by memset(0)", fix it.
Signed-off-by: Axel Lin <axel.lin@ingics.com >
2016-03-23 14:26:32 +01:00
Dirk Ziegelmeier
7e7f2f31ff
Cleanup and simplify tcpip_api_call() implementation a bit
2016-03-22 21:52:11 +01:00
Dirk Ziegelmeier
a1fc91afa8
Fix newly introduced tcpip_api_call did not return correct return value
2016-03-22 21:34:05 +01:00
goldsimon
c39ef75cb3
... and another compiler error: tcp_nagle_enable() must stay at tcpflags_t, not using u16_t
2016-03-22 15:58:00 +01:00
goldsimon
7bda462031
fixed wrong commit: compatibility-define tcp_accepted() was accidentally commented-out
2016-03-22 15:54:14 +01:00
Dirk Ziegelmeier
f97bf85fd6
udp.c: Allow udp_connect() on a dual-stack UDP PCB (type IPADDR_TYPE_ANY). This may be useful in some applications - no need to keep separate storage for target IP.
2016-03-22 15:12:16 +01:00
Dirk Ziegelmeier
a9c7ead6b7
Update git ignore list for LwipMibCompiler
2016-03-22 15:07:07 +01:00
sg
dd80759bb9
tcp: changed accept handling to be done internally: the application does not have to call tcp_accepted() any more. Instead, when delaying accept (e.g. sockets do), call tcp_backlog_delayed()/tcp_backlog_accepted() (fixes bug #46696 )
2016-03-22 07:30:44 +01:00
sg
a1c78ea7bf
ignore dns response parsing errors, only abort resolving for correct responses or error responses from correct server (bug #47459 )
2016-03-22 07:22:17 +01:00
sg
5794ac2340
tcp_alloc(): remove explicit =0 already done by memset(0)
2016-03-18 22:05:17 +01:00
sg
44e1a2d8e2
define tcp_backlog_set() as dummy-define when backlog feature is disable
2016-03-18 20:05:04 +01:00
Joel Cunningham
3a62a45bcd
Fix year in recent CHANGELOG entries
...
The year in the recent bugfix entries was 2013 instead of 2016
2016-03-18 10:09:25 -05:00
sg
149bb36805
fixed bug #47448 (netconn/socket leak if RST is received during close)
2016-03-17 21:49:01 +01:00
Joel Cunningham
93ccba9bcb
don't fail closing a socket/netconn when failing to allocate the FIN segment; blocking the calling thread for a while is better than risking leaking a netconn/socket (see bug #46701 )
...
Signed-off-by: sg <goldsimon@gmx.de >
2016-03-17 21:00:18 +01:00
sg
b24e5cd1c8
fixed compiling netconn_write_partly with LWIP_SO_SNDTIMEO==1 after recent api implementation changes (bug #47436 , patch by William Hayes)
2016-03-17 20:15:22 +01:00
Dirk Ziegelmeier
7fbb5fc82a
Fix netconn API in core locking mode
2016-03-17 09:31:50 +01:00
Dirk Ziegelmeier
464a8c9794
Delete script to compile MOBA MIB
2016-03-17 08:27:45 +01:00
Dirk Ziegelmeier
7aea739f87
PPPAPI: Don't return garbage in *_create calls in case tcpip_api_call() fails;
...
Let some functions return err_t instead of void because tcpip_api_call() may fail
2016-03-16 23:01:05 +01:00
sg
852d5b9c80
Optimize tcp_output runtime by not calling ip_route() for every segment sent
2016-03-16 22:31:33 +01:00
sg
b4d7238eb8
tcp_output_segment: don't count retransmitted segments in mib2.tcpoutsegs by detecting p->payload != tcphdr pointer; don't try to retransmit segments where p->ref != 1 (as it is invalid to mess up p->len/p->payload when we don't have exclusive access to the pbuf)
2016-03-16 22:22:20 +01:00
Dirk Ziegelmeier
ee87d28252
Rename tcpip_apimsg to netconn_apimsg (better suits naming convention in api_lib.c)
2016-03-16 22:02:47 +01:00
Dirk Ziegelmeier
6ffe12cede
Readd struct protoype in api.h
2016-03-16 21:57:25 +01:00
Dirk Ziegelmeier
d6adc1f6cb
Rename tcpip_send_api_msg to tcpip_send_msg_wait_sem (hopefully a little bit clearer name)
2016-03-16 21:57:24 +01:00
sg
5f8b5cbb20
reset rto timer on fast retransmission (see task #13757 , patch by Joel Cunningham)
2016-03-16 21:49:37 +01:00
sg
7b9cb98bbb
LWIP_TCPIP_CORE_LOCKING_INPUT is not experimental any more, as well
2016-03-16 21:48:47 +01:00
Dirk Ziegelmeier
222eb25eb5
Accidentally committed my MIB compiler test, sorry!
2016-03-16 21:38:22 +01:00
Dirk Ziegelmeier
dbfdb13166
LwipMibCompiler: Set MIB compiler as startup project instead of MIB viewer
2016-03-16 21:35:21 +01:00
Dirk Ziegelmeier
d38cdccbcd
netconn API: Remove api_msg wrapper struct, it is not needed any more
2016-03-16 21:35:21 +01:00
Dirk Ziegelmeier
2575c7fb5f
netconn API: Cleanup, remove lots of #defines, take advantage of new tcpip_send_api_msg function feature to abstract core locking away
2016-03-16 21:35:21 +01:00
Dirk Ziegelmeier
ea174560b1
tcpip.c tcpip_send_api_msg: Handle core locking case internally
2016-03-16 21:35:21 +01:00
Dirk Ziegelmeier
bc51dddcaf
Add some comments to functions and #defines. According to Simon, LWIP core locking is not experimental any more.
2016-03-16 21:35:21 +01:00
sg
f09dec5fb7
ethernetif.c: implement SNMP counters, simplify input function: no need to check ethType, ethernet_input() already does this
2016-03-16 21:26:31 +01:00
sg
8e8571da6a
fixed bug #46384 Segment size calculation bug with MSS != TCP_MSS
2016-03-16 16:56:15 +01:00
Dirk Ziegelmeier
0d576aa521
Fix bug #47426 incorrect typecast in pppapi.c
2016-03-16 12:37:08 +01:00
goldsimon
0e1b401abe
sntp: fixed constness for SNTP_SERVER_DNS==1
2016-03-14 14:29:26 +01:00
Dirk Ziegelmeier
bf7fc41e0f
LwipMibCompiler: Add windows command line example
2016-03-14 12:13:44 +01:00
Dirk Ziegelmeier
90bc1da434
LwipMibCompiler: Don't generate empty root nodes
2016-03-14 12:13:24 +01:00
Dirk Ziegelmeier
dc98e31e4d
LwipMibCompiler: MibTree: Adapt coding style to the rest of the C# project
2016-03-14 12:13:05 +01:00
Dirk Ziegelmeier
1d7996dc47
tcpip API calls: Implement LWIP_NETCONN_SEM_PER_THREAD support for ALL API calls
2016-03-13 19:43:49 +01:00
Dirk Ziegelmeier
2b3db52c70
pppol2tp.c: Avoid an #ifdef - there is a new UDP API function that can be used here
2016-03-12 12:26:23 +01:00
Jan Breuer
b65a22b32a
LwipMibCompiler: Don't preserve upper case on generated variables
2016-03-12 09:09:26 +01:00
Jan Breuer
b849e52c17
LwipMibCompiler: preserve upper case in comments
2016-03-12 09:09:22 +01:00
Jan Breuer
588b11185a
LwipMibCompiler: Remove false positive root entities
2016-03-12 09:05:19 +01:00
Jan Breuer
dfc963880a
LwipMibCompiler: Fix generating SnmpScalarArrayNode callbacks
2016-03-12 09:03:41 +01:00
Dirk Ziegelmeier
00975769a0
Minor TCPIP API call functions cleanup
2016-03-10 22:44:31 +01:00
Dirk Ziegelmeier
f7a3d6cca5
Port PPP API to new simple tcpip API call method
2016-03-10 22:44:25 +01:00
Dirk Ziegelmeier
8f71795844
Port netifapi to new simple tcpip API call method
2016-03-10 22:42:21 +01:00
Dirk Ziegelmeier
8106413644
tcpip.c: Implement an easier way for TCPIP API calls - client code does not have to deal with semaphores and core locking any more
2016-03-10 22:42:21 +01:00
sg
5e472badf1
Work on bug #44595 : remove check for recvmbox != NULL from netconn_recv() to let it return ERR_CLSD for half-closed TCP connections
2016-03-10 21:20:25 +01:00
Axel Lin
2a2f92f7c2
Make ERR_IS_FATAL() test first fatal error instead of last non-fatal error
...
This way, we don't need to update ERR_IS_FATAL() every time new non-fatal error
is added. Also drop 2 empty lines so the error constants present in 2 groups,
non-fatal errors and fatal errors.
2016-03-10 07:21:34 +01:00
Dirk Ziegelmeier
f3b7bca3cf
Fix bug #47370 : Port DNS client to IPv6
2016-03-09 19:25:06 +01:00
Dirk Ziegelmeier
9fbf5a4004
SNMP: Support LWIP_TCPIP_CORE_LOCKING sync method
2016-03-09 08:39:56 +01:00
sg
5d637360cc
fixed ERR_IS_FATAL() after changing ERR_IF to non-fatal
2016-03-08 21:04:21 +01:00
Dirk Ziegelmeier
7d8f0c781f
Fix wrong usage of LWIP_NETCONN_SEM_PER_THREAD macro in api_msg.h
2016-03-08 19:53:37 +01:00
Dirk Ziegelmeier
a212210c35
Add missing #include in memp.c
2016-03-08 19:53:01 +01:00
Dirk Ziegelmeier
ba40925335
tcpip_send_api_msg function is only needed in non-core-locking mode
2016-03-08 19:41:32 +01:00
Dirk Ziegelmeier
eab92ccb03
netifapi: Eliminate wrapper struct netifapi_msg and rename netifapi_msg_msg to netifapi_msg
2016-03-08 19:41:32 +01:00
Dirk Ziegelmeier
fc17d02451
Fix compile with LWIP_TCPIP_CORE_LOCKING
2016-03-08 19:41:32 +01:00
Dirk Ziegelmeier
37d514c949
Minor cleanups in #includes and comments
2016-03-08 19:41:32 +01:00
Dirk Ziegelmeier
a4297ef0fd
Reduce includes of tcpip_priv.h
2016-03-08 19:41:32 +01:00
Dirk Ziegelmeier
c65eca58c9
Decouple tcpip.c/tcpip_priv.h from netconn API
2016-03-08 19:41:32 +01:00
Dirk Ziegelmeier
18bb74e5c5
Decouple tcpip.c/tcpip_priv.h from PPP API
...
PPP API can now be moved to netif/ppp subdir
2016-03-08 19:41:32 +01:00
Dirk Ziegelmeier
af1978fa4e
Implement generic API message handling
...
Add generic tcpip_send_api_msg function
Let netif API and netconn API use it
Decouple tcpip.c and tcpip_priv.h from netif API
2016-03-08 19:41:32 +01:00
sg
5cf802eda0
dns_gethostbyname: return error code if no valid server is set instead of calling the 'found' callback in this case (fixes bug #46887 )
2016-03-07 19:47:39 +01:00
Joel Cunningham
80cc988f2f
Optimize sendmsg UDP pbuf chain creation
...
This commit optimizes the sendmsg UDP pbuf chain creation by not
allocating/freeing a netbuf per io vector and instead building a pbuf
chain directly in the sockets layer
2016-03-07 09:26:58 -06:00
sg
076795562e
fixed typo in one of the last commits
2016-03-06 20:59:50 +01:00
sg
f5fef6eebc
fixed bug #45353 : IPv6 router / neighbor relationship is not always consistent - patch by Stian Sebastian Skjelstad
2016-03-06 14:48:41 +01:00
sg
375ec36246
ERR_IF is not necessarily a fatal error (fixes bug #46338 : UDP netconns block after fatal error)
2016-03-05 16:15:04 +01:00
sg
b00a17059a
fixed icmp_send_response with LWIP_HOOK_IP4_ROUTE_SRC enabled
2016-03-05 15:57:40 +01:00
Dirk Ziegelmeier
bcab7fef84
netifapi.c: Fix compile when IPv4 is not enabled
2016-03-05 15:55:53 +01:00
sg
d2bb569ee4
bug #46094 : moved IPv4 routing hook functions down so that they implement actual routing (source-based IPv4 routing is not affected by this change)
2016-03-05 15:52:39 +01:00
Dirk Ziegelmeier
52b426a343
ip_addr.h: Use IP_GET_TYPE macro in other macros
2016-03-05 14:35:29 +01:00
Dirk Ziegelmeier
f4fbc90217
netifapi: Do not pass NULL pointers for IP addresses to subsequent functions
...
Same as in my last commits - this avoids errors in lwIP code where ip addresses are dereferenced (e.g. for IP type checking) without handling thinking about NULL pointers.
2016-03-05 14:35:29 +01:00
sg
e0ab8c581d
fixed bug #46093 : Move IP6_ROUTE() hook to after LL processing
2016-03-05 14:11:24 +01:00
Dirk Ziegelmeier
094cdf1c7b
netconn: Create API macros to get/set IPV6ONLY flag
2016-03-04 23:06:33 +01:00
Dirk Ziegelmeier
814577fcc6
snmp: Fix snmp_oid_to_ip for IPADDR_ANY_TYPE ips
2016-03-04 22:46:54 +01:00
Dirk Ziegelmeier
15925b66c6
Fix ip_addr_cmp to correctly compare IPADDR_ANY_TYPE ips
2016-03-04 22:46:18 +01:00
Dirk Ziegelmeier
925b280fd2
Apply patch from Elias Önal to fix a few datatypes in SNMP MIB2
2016-03-04 22:35:09 +01:00
sg
6b405eccd0
Tried to fix bug #47270 by accepting all ipv4 multicast packets (at IP level) when LWIP_IGMP is disabled
2016-03-04 21:57:47 +01:00
goldsimon
15326cdbad
Added macro to get the ip address type
2016-03-04 09:07:50 +01:00
Dirk Ziegelmeier
bd0b51c9ef
Fix my previous netconn_do_listen changes in lwip_netconn_do_listen
2016-03-03 23:16:01 +01:00
Dirk Ziegelmeier
9a4c66006e
Fix compile error in raw.c (possible unused arg)
2016-03-03 22:55:42 +01:00
Dirk Ziegelmeier
1c52780b62
snmp_netconn: Use new "socket-like" netconn API dual-stack implementation
2016-03-03 22:52:43 +01:00
Dirk Ziegelmeier
bee5515e9a
netconn API: Reimplement dual-stack API to be socket-like.
...
When IPv6 ANY address is used and the NETCONN_FLAG_IPV6_V6ONLY is NOT set, bind/listen on/to IP_ANY_TYPE
2016-03-03 22:52:04 +01:00
Dirk Ziegelmeier
0a7f404d09
api_lib.c: Don't propagate NULL pointers as ip address to subsequent functions
2016-03-03 22:49:55 +01:00
Dirk Ziegelmeier
1dea649cff
Fix comment in tcp.c
2016-03-03 22:48:10 +01:00
Dirk Ziegelmeier
7396d8818b
Implement dual-stack in RAW API in the same way as in UDP and TCP
2016-03-03 22:47:27 +01:00
Dirk Ziegelmeier
2d80af1dcb
Minor code cleanup in udp.c
2016-03-03 22:44:01 +01:00
Dirk Ziegelmeier
b5cd90a342
Add compatibility macro for tcp_new_ip6()
2016-03-03 21:04:00 +01:00
Dirk Ziegelmeier
5358380c5f
Apply patch from Derek Pravala: Fix segfault in ip6_route when there is no default netif
2016-03-03 16:12:20 +01:00
Dirk Ziegelmeier
eead3a7038
Simon says: dual-stack does not work on iperf because there IPs encoded in the payloads and IPv6 is not supported there in the current lwIP implementation -> revert
2016-03-03 13:06:55 +01:00
Dirk Ziegelmeier
ce370ec48f
Compile fix lwiperf.c after my last change
2016-03-03 12:23:34 +01:00
Dirk Ziegelmeier
24ebf6bd6f
Implement dual-stack in lwiperf, netbiosns and sntp
2016-03-03 12:15:57 +01:00
Dirk Ziegelmeier
b0d4386744
Adapt HTTP server to new dual-stack API
2016-03-02 23:47:09 +01:00
Dirk Ziegelmeier
0c673b6a44
Implement new style TCP dual-stack in netconn API
2016-03-02 23:46:22 +01:00
Dirk Ziegelmeier
e89b48d23f
raw.c: Avoid NULL pointer dereference
2016-03-02 23:44:51 +01:00
Dirk Ziegelmeier
f9ce31f98b
TCP: Implement dual stack support using new IP_ANY_TYPE introduced at UDP
2016-03-02 23:14:33 +01:00
Dirk Ziegelmeier
bd131e5e4b
ip_addr.h: Update ip_addr_copy macro to correctly copy new IP_ANY_TYPE address
2016-03-02 23:11:34 +01:00
Dirk Ziegelmeier
f3132c5290
udp: Fix possible NULL pointer dereference, update comments
2016-03-02 23:10:43 +01:00
Dirk Ziegelmeier
babb247e2a
SNMP MIB2: Fix temporary OID buffer size some tables have been too small
2016-03-02 23:09:51 +01:00
Dirk Ziegelmeier
cc4f94f415
lowpan6: Fix incorrect array bounds check (found by Coverity)
2016-03-02 19:45:15 +01:00
Dirk Ziegelmeier
9885d5d9f5
Apply patch from Simon to fix buffer overflow handling tcp_in.c which was discovered by Coverity
2016-02-29 23:34:52 +01:00
Dirk Ziegelmeier
8e5663a32f
Minor: Avoid ip_input() call indirection for when only IPv4 or IPv6 are enabled
2016-02-29 22:17:42 +01:00
Dirk Ziegelmeier
4bbfc3857a
Implement dual-stack in SNMP for netconn API
2016-02-29 19:31:19 +01:00
Dirk Ziegelmeier
5404ce3c0a
Implement support for UDP IP_ANY_TYPE in netconn API
2016-02-29 19:31:19 +01:00
Dirk Ziegelmeier
2289673a30
Implement support for IP_ANY_TYPE in SNMP
2016-02-29 19:31:19 +01:00
Dirk Ziegelmeier
6aed6e659f
Rework DHCP PCB handling: Old code registered one UDP PCB per netif where DHCP was active and there was a special case in udp_input() for this. New implementation uses one PCB for all netifs and removes special case in udp_input().
...
The old approach called udp_bind() on each of the PCBs, which puts them into udp_pcbs list. The PCBs were iterated on all non-DHCP udp_inputs() with no effect.
My cleanup removes the special handling in udp.c, and uses only one DHCP UDP PCB to catch all DHCP messages from all netifs. The dhcp_recv function then checks whether ip_current_input_netif() has DHCP enabled - if not, the message is ignored. The PCB is only created/registered when one or more PCBs have DHCP enabled.
2016-02-29 19:31:19 +01:00
Dirk Ziegelmeier
42c92f80f1
Add compatibility macro for udp_new_ip6()
2016-02-29 13:25:13 +01:00
goldsimon
fa16ee8dcb
cleaned up includes a bit after IPv6 changes
2016-02-29 09:27:59 +01:00
Dirk Ziegelmeier
70f3e5ed05
Cleanup: Create new file ip.c and move dual-stack code from ipv4 and ipv6 folder in there
2016-02-26 23:04:51 +01:00
Dirk Ziegelmeier
2dc8f59bf4
Fix compile when PPPOE is enabled
2016-02-26 22:50:44 +01:00
Dirk Ziegelmeier
d5778bad2f
No need for dual-stack code in ip4.c and icmp.c -> use ip4 only versions
2016-02-26 22:50:20 +01:00
goldsimon
81c8121551
minor: fixed compiler warning "unary minus operator is applied to an unsigned expression"
2016-02-26 15:23:04 +01:00
goldsimon
97b7555119
bring back ETHARP_HWADDR_LEN (if anyone uses it)
2016-02-26 14:21:03 +01:00
Dirk Ziegelmeier
a5214abd04
udp: udp_send and udp_send_chksum: Check for PCB NULL pointer and PCB must not be the new IP_ANY_TYPE, but a real IPv4 and IPv6 address
2016-02-26 09:20:50 +01:00
goldsimon
bf8bcfafe2
revert accidentally committed comment from a649a3eb50
2016-02-26 08:59:50 +01:00
Joel Cunningham
8cb64698aa
Allow backlog to be updated
...
This commit adds support to the sockets and netconn layer to update the
backlog by calling listen when the netconn is already in the listen state.
When backlog is not enabled, the call returns successfully
This commit also introduces a macro for setting the backlog value that
prevents a 0 sized (invalid) backlog
2016-02-25 15:19:52 -06:00
sg
163d7f9791
added ethernet.c to Filelists.mk
2016-02-25 22:11:16 +01:00
sg
a649a3eb50
dual-stack fix: moved common definitions/code for ethernet used by etharp and ethip6 to new files ethernet.h/.c
2016-02-25 22:10:28 +01:00
Joel Cunningham
2a8398dfb8
Fix bug in FIONREAD handling in LINUXMODE
...
Fix a bug in the socket API's ioctl for FIONREAD. If the socket's
lastdata was assigned the function returned without error but did not
update the argument pointer.
The cast type for argp was also changed to int to conform with the
other SO_RCVBUF handling.
2016-02-25 12:53:12 -06:00
Dirk Ziegelmeier
fd891081c4
minor: Cleanups in raw/tcp/udp code by using macros and reducing #ifdefs
2016-02-24 23:04:25 +01:00
Dirk Ziegelmeier
953b7bdd59
Implement UDP dual-stack PCB support
...
Create special IP address type "IPADDR_TYPE_ANY" for it.
SNMP uses new feature in non-netconn mode.
TODO: Same for TCP & RAW, adapt NETCONN to use this feature
2016-02-24 22:37:01 +01:00
sg
1dde3d6e56
Fixed bug #46524 : "Device as dhcp server does not work after upgrade to lwip-1.4.1"
2016-02-24 22:13:58 +01:00
sg
ec49b68b38
minor: udp_input/local_match: coding style, added comments
2016-02-24 22:04:59 +01:00
sg
68590c2b27
minor/coding style: lowpan6_opts.h: tabs->spaces, trim trailing spaces
2016-02-24 22:03:40 +01:00
Dirk Ziegelmeier
ac4b089b18
udp.c: Further udp_input simplifications
...
- Move local PCB matching code in a function that can be reused in SO_REUSE && SO_REUSE_RXTOALL case.
- Some checks have been written in the dual-stack version and then repeated with the ipv6-only version. Example:
IPv6 only: ip6_addr_ismulticast(ip6_current_dest_addr())
IPv4 AND IPv6: ip_addr_ismulticast(ip_current_dest_addr())
2016-02-24 19:57:20 +01:00
Dirk Ziegelmeier
005c196ed8
udp.c: Simplify and cleanup input PCB matching
2016-02-24 19:13:30 +01:00
Dirk Ziegelmeier
3b5803ec9a
sys.h: Avoid un #defined LWIP_COMPAT_MUTEX macro (usually #defined in arch/sys_arch.h)
2016-02-23 15:49:58 +01:00
Dirk Ziegelmeier
fd4a109ffa
lowpan6.c: Implement SNMP counters
2016-02-23 13:01:46 +01:00
Dirk Ziegelmeier
481d350bf3
lwip/stats.h: Add some comments to MIB2 variables to explain correct usage a bit
2016-02-23 12:08:31 +01:00
Dirk Ziegelmeier
d121ea84d0
Add note about 6LoWPAN in src/netif/FILES
2016-02-23 11:46:28 +01:00
goldsimon
a5ac41c203
lowpan6: fixed compiler warning when casting u16_t to u8_t
2016-02-23 11:28:54 +01:00
goldsimon
e4457335b8
minor: tried to fix coding style in lowpan6.c
2016-02-23 10:36:16 +01:00
Dirk Ziegelmeier
680f8f31ab
I don't know why I have a diff here (I guess line ending problems like in my last lowpan6.c commit)...
2016-02-23 10:20:05 +01:00
Dirk Ziegelmeier
6650eb4cd2
snmp_traps.c: Fix compile on Win32 - missing string.h include
...
Catch possible strlen returnvalue > 0xffff
2016-02-23 10:06:46 +01:00
Dirk Ziegelmeier
799fe7a5ba
Fix shadowing warning in lowpan6.c - found by Erik Ekman's Travis CI
...
https://travis-ci.org/yarrick/lwip-merged
2016-02-23 08:58:34 +01:00
Dirk Ziegelmeier
9a4d7b9956
Use netif_input_fn typedef instead of creating a new one in tcpip.h
2016-02-22 21:10:50 +01:00
Dirk Ziegelmeier
fe8d2ba72f
Eliminate tcpip_pppos_input function
2016-02-22 21:00:00 +01:00
Dirk Ziegelmeier
e90591bb78
Add note to CHANGELOG about 6LoWPAN
2016-02-22 20:46:15 +01:00
Dirk Ziegelmeier
e2a3565971
Initial import of Ivan Delamer's 6LoWPAN implementation with slight modifications to allow compiling in IPv6 only mode
2016-02-22 20:44:32 +01:00
Dirk Ziegelmeier
aeab047ede
slipif: Fix compile when only IPv6 is enabled
2016-02-22 20:43:32 +01:00
Dirk Ziegelmeier
777e667f08
Add generic tcpip_inpkt function that can be called to make last changes really usable
2016-02-22 20:18:10 +01:00
Dirk Ziegelmeier
fa6f068fd1
Eliminate TCPIP_MSG_INPKT_PPPOS message type.
...
Fix my last commit, I accidentally unchecked the wrong file in commit dialog
2016-02-22 17:47:01 +01:00
Dirk Ziegelmeier
439ae629e0
Change TCPIP INPKT API message to take a function pointer. Allows integration of other protocols without extending lwIP core (e.g. 6LoWPAN)
...
Remove unused sem member of struct tcpip_msg
2016-02-22 17:39:01 +01:00
Dirk Ziegelmeier
17fad79f71
Two compile fixes after eliminating isipv6 member in PCBs
2016-02-22 17:07:17 +01:00
Dirk Ziegelmeier
d8531a2407
Cleanup NETCONNTYPE_ISIPV6 macro
2016-02-22 13:55:27 +01:00
Dirk Ziegelmeier
c805843e64
Change signature of ip_output, ip_output_if, ip_output_if_src, ip_output_hinted, ip_route, ip_netif_get_local_ip, ip_route_get_local_ip and tcp_eff_send_mss not to take an isipv6 parameter. Use the IP version of the destination address instead.
2016-02-22 13:38:40 +01:00
Dirk Ziegelmeier
880f1008d6
Together with Simon: Eliminate last instances of isipv6 member in pcbs;
...
Don't allow NULL pointers (IPv4 ANY) in connect() and sendto() functions as destinations since this does not make sense.
2016-02-22 13:03:51 +01:00
Dirk Ziegelmeier
be9cd800b0
Review with Simon: Init TCP/UDP/RAW PCBs with correct IP types in _new functions to make my changes work correct
2016-02-22 11:16:13 +01:00
Dirk Ziegelmeier
0106cf7ae0
Review with Simon: Remove dead code (since 2003)
2016-02-22 10:18:19 +01:00
Dirk Ziegelmeier
50303eea23
Reduce PCB_ISIPV6 macro usage some more
2016-02-21 19:59:08 +01:00
Dirk Ziegelmeier
339e82d7aa
Eliminate IP_PCB_IPVER_EQ macro
2016-02-21 19:45:51 +01:00
Dirk Ziegelmeier
5a25652c21
Eliminate IP_PCB_IPVER_INPUT_MATCH macro
2016-02-21 19:21:36 +01:00
Dirk Ziegelmeier
8f675c37fc
Reduce usage of PCB IP version flag in UDP code. Maybe we can figure out a good way for dual-stack UDP when we manage to remove the flag (nearly) entirely from the code.
2016-02-20 20:54:58 +01:00
Dirk Ziegelmeier
5809b01388
Reduce usage of PCB IP version flag in raw and tcp code. Maybe we can figure out a good way for dual-stack UDP when we manage to remove the flag (nearly) entirely from the code.
2016-02-20 20:40:04 +01:00
Dirk Ziegelmeier
f104d68569
PPP: Init SNMP members of PPP netifs
2016-02-19 23:51:18 +01:00
Dirk Ziegelmeier
10edba936b
Fix tcp pcb access after it was freed in tcp.c - found by Coverity
2016-02-19 23:28:09 +01:00
Dirk Ziegelmeier
bbb5e99f25
Fix netconn access after it was freed in lwiperf - found by Coverity
2016-02-19 23:26:06 +01:00
Joel Cunningham
ea94549cb2
Optimize lwip_selscan()
...
This makes a couple of simple re-arrangements in lwip_selscan() that
should improve performance in the following ways:
1) The old code linearly walked all sockets to maxfd regardless of
whether they were set in the fd set. The process involved
acquiring sys arch protect, looking up the socket, and then
checking if the socket was present in any of the fd sets. On
systems with lots of sockets and a heavy SYS_ARCH_PROTECT
infrastructure (a mutex) this can result in a lot of extra work.
Now we skip this process for any fd that is not in the input sets
2) If the socket from tryget_socket() is NULL we no longer continue
and compare the input fd sets with a zeroed out set of events
3) We no longer need to zero out our event sets because they are
only accessed when tryget_socket() is successful
lwip_selscan() is called at most once per select call and sometimes up to three times
2016-02-18 13:17:45 -06:00
sg
9a97a80efc
Fixed bug #47154 lwip_netconn_do_writemore doesn't clear conn->write_offset on fatal/routing error.
2016-02-18 19:46:20 +01:00
goldsimon
e4cac595c2
Check TCP_SNDLOWAT for too high value (near u16_t overflow) - fixes bug #46948
2016-02-18 09:36:55 +01:00
Dirk Ziegelmeier
cf3d7def33
Let MIB compiler generate const structs, too (see last commit)
2016-02-17 08:14:16 +01:00
Dirk Ziegelmeier
24bc77a935
Found some struct instances that can be const
2016-02-16 22:31:59 +01:00
Joel Cunningham
9dd1c81d41
Update lwip_selscan documentation
...
lwip_selscan() documentation indicated exceptset is not used, which is no
longer accurate
2016-02-12 15:00:41 -06:00
Dirk Ziegelmeier
cddd3b552a
etharp.c: Make MAX_AGE of an ARP entry configurable
2016-02-11 09:38:17 +01:00
Dirk Ziegelmeier
5aa5563622
snmp_msg.c: Fix unchecked return value. Found by Coverity.
2016-02-10 21:57:57 +01:00
Dirk Ziegelmeier
09b850cc6f
snmp_threadsync.c: Fix ignored return value of mutex/semaphore creation. Found by Coverity.
2016-02-10 21:55:50 +01:00
Dirk Ziegelmeier
273d609bac
mem.c: Fix unintended sign extension (found by Coverity)
...
sign_extension: Suspicious implicit sign extension: count with type unsigned short (16 bits, unsigned) is promoted in count * size to type int (32 bits, signed), then sign-extended to type unsigned long (64 bits, unsigned). If count * size is greater than 0x7FFFFFFF, the upper bits of the result will all be 1.
2016-02-10 21:21:08 +01:00
Dirk Ziegelmeier
288b4564e4
DNS: Fix potential array out of bounds access. Variable nanswers may contain bogus values. (found by Coverity)
2016-02-10 20:41:31 +01:00
Dirk Ziegelmeier
78a36df901
Netconn: Fix potential NULL pointer dereference (found by Coverity)
2016-02-10 20:39:12 +01:00
Dirk Ziegelmeier
1c1587eef6
ICMP: Fix responses were always sent to default netif because of uninitialized source IP (found by Coverity)
2016-02-10 20:35:58 +01:00
Dirk Ziegelmeier
11b810721a
ICMP: Fix unused value in icmp_input (found by Coverity)
2016-02-10 20:34:44 +01:00
Dirk Ziegelmeier
e5eba61cf0
SNMP: Correctly name a global variable
2016-02-10 20:32:50 +01:00
Dirk Ziegelmeier
54a2c13b2e
SNMP: Fix compile in dual-stack configuration
2016-02-06 00:21:06 +01:00
Dirk Ziegelmeier
b2410e428a
SNMP: Remove comment about traps in README
2016-02-04 16:22:43 +01:00
Dirk Ziegelmeier
208f24a20c
SNMP: Add some comments in thread sync code
2016-02-04 16:20:46 +01:00
Dirk Ziegelmeier
8cd33a5e41
SNMP: Implement basic SNMPv1 traps; Remove IPv6 support in RAW API again until there is a clean solution for dual-stack UDP
2016-02-04 16:19:59 +01:00
Dirk Ziegelmeier
905a434179
snmp_pbuf_stream: Reduce code duplication. Most is already implemented in lwIP pbuf framework.
2016-02-03 08:39:41 +01:00
Dirk Ziegelmeier
222155d7e2
pbuf: Make pbuf_skip function public, so it can be used in SNMP code
2016-02-03 08:37:04 +01:00
Dirk Ziegelmeier
28549e35fe
SNMP: Update threadsync not to use mem_malloc - memory can be instantiated statically since it is only needed once per threadsync instance
2016-02-02 22:31:59 +01:00
Dirk Ziegelmeier
8f6cfa8769
Private mempools: Add missing include for LWIP_MEM_ALIGN_SIZE in memp_priv.h
2016-02-02 22:28:21 +01:00
Axel Lin
f411a34af5
stats: Add proper #if guard to prevent unused-variable warning for memp_names
...
The usages of memp_names are under either LWIP_DEBUG in stats_init,
or under LWIP_STATS_DISPLAY in stats_display_memp.
Fix below build warning:
lwip/src/core/stats.c:53:21: error: 'memp_names' defined but not used [-Werror=unused-variable]
static const char * memp_names[] = {
^
cc1: all warnings being treated as errors
Reported-by: David Fernandez
Fixes: 2f2a75a6d9fd ("stats: Move memp_names table out of stats_init/stats_display_memp functions")
Signed-off-by: Axel Lin <axel.lin@ingics.com >
2016-01-31 13:48:38 +01:00
Philipp Toelke
1de8d432d4
httpd: fix sending of data from send_headers
2016-01-29 09:26:29 +01:00
Axel Lin
515a4cad73
Clear addr_hint pointer after calling ip_output_if() in tcp_zero_window_probe()
...
This was missed in commit aa0e41c389
("task #12178 : hardware checksum capabilities can be configured per netif"),
fix it.
Signed-off-by: Axel Lin <axel.lin@ingics.com >
2016-01-29 09:21:58 +01:00
Sylvain Rochet
4beacc4ca0
PPP, VJ, fixed TCP retransmission
...
We used to modify in place the packet payload during compression but TCP
stack requires that we don't change the packet payload, therefore we now
copy the whole packet before compression.
Signed-off-by: Sylvain Rochet <gradator@gradator.net >
2016-01-24 20:07:54 +01:00
Sylvain Rochet
9c7231ee75
PPP, VJ, move pbuf length check so all TYPE_IP return value are within the same code block
...
Prepare for VJ packet copy, reorder a bit VJ compressor so all TYPE_IP
return value are within the same code block. We do that because we don't
need to copy the packet if we are not able to compress it.
Signed-off-by: Sylvain Rochet <gradator@gradator.net >
2016-01-24 19:36:19 +01:00
Sylvain Rochet
e31902dc4c
PPP, prepare for chained compressors (e.g. VJ+MPPE) requiring packet copy
...
lwIP TCP stack requires that we don't change the packet payload in netif
output functions in order to resend the pbuf if we don't receive a TCP
ACK in time, therefore we copy the whole packet before compression or
encryption.
It gets tricky because we should keep track of whether we previously
copied the buffer in PPP output netif function in order to free the
previous pbuf if necessary, BUT the first pbuf passed to the netif
output function must not be freed.
The worst case is VJ compression followed by MPPE encryption, in this
case we should free the packet allocated by VJ compressor after MPPE
encryption and we should free the packet allocated by MPPE encrypter
after calling the PPP low level output function.
Signed-off-by: Sylvain Rochet <gradator@gradator.net >
2016-01-24 17:48:57 +01:00
Sylvain Rochet
53853a25b0
PPP, report full packet size in VJ debug output
...
Signed-off-by: Sylvain Rochet <gradator@gradator.net >
2016-01-24 02:16:03 +01:00
Sylvain Rochet
858bce7b4e
PPP, VJ, code cleaning
...
Using lwIP types instead of u_ types.
Removed useless register modifier on variable.
Removed trailing spaces.
Signed-off-by: Sylvain Rochet <gradator@gradator.net >
2016-01-24 01:38:26 +01:00
Sylvain Rochet
77d355560f
PPP, VJ, fix header offset calculation on LP64/ILP64 systems
...
long type on LP64/ILP64 systems (such as x86_64 on Linux) is 8 byte
long, this leads to wrong offsets in packets header calculation.
Fixed it by using u32_t lwIP type instead of long type.
Signed-off-by: Sylvain Rochet <gradator@gradator.net >
2016-01-24 01:38:26 +01:00
Sylvain Rochet
733758a909
tcp: fixed TCPH_UNSET_FLAG macro
...
This macro is only used by VJ support in PPP and was always wrong since
its introduction in commit e4a6d199fe . It's almost only used to clear
the PSH TCP flag when necessary. This flag was probably less common
about a decade ago so that would be the reason why it goes unnoticed for
so long.
Fixes: e4a6d199fe "Merged from DEVEL into main tree."
Signed-off-by: Sylvain Rochet <gradator@gradator.net >
2016-01-24 01:38:26 +01:00
Dirk Ziegelmeier
90df2111b7
SNMP: Add missing closing braces in #ifdef __cplusplus case
2016-01-22 13:28:11 +01:00
Stephan Linz
31732631fc
PPP: CCP: add error debug messages for dropped packets due to missing transmit or receive CCP method
...
It might be difficult to investigate the reason of dropped packets when
there is no debug notification of what is happening, thus, add error
debug messages for dropped packets due to missing transmit or receive
CCP method.
Signed-off-by: Stephan Linz <linz@li-pro.net >
[gradator@gradator.net: improved messages]
Signed-off-by: Sylvain Rochet <gradator@gradator.net>
2016-01-20 21:55:37 +01:00
Sylvain Rochet
c4d78e6422
PPP, PPPoL2TP, fix double free of L2TP pcb in pppol2tp_create error path
...
ppp_free() calls the low level protocol destroy function, pppol2tp_destroy()
here, which freed the l2tp pcb, followed by pppol2tp_create which also freed
the pcb.
Fixing it by reordering the L2TP init so we don't have to call ppp_free()
anymore.
Signed-off-by: Sylvain Rochet <gradator@gradator.net >
2016-01-20 21:12:37 +01:00
Wayne Uroda
52463fa25b
PPP, PPPoS, fix dereference of uninitialised pppos->in_head pointer
...
When I create a new PPP connection, I am seeing a hardfault (segfault)
coming from pbuf_free.
I traced the problem to an invalid in_head field of the pppos_pcb structure.
The field is invalid because the memory is never cleared to zero after the
pppos_pcb structure is created in pppos_create().
I was able to fix the issue by adding a memset after the memp_malloc call.
Signed-off-by: Sylvain Rochet <gradator@gradator.net >
2016-01-20 20:50:08 +01:00
Joel Cunningham
96373f6959
Define LWIP_CHKSUM_COPY_ALGORITHM when port provides LWIP_CHKSUM_COPY macro
...
When the port has LWIP_CHECKSUM_ON_COPY enabled and provides
a definition of LWIP_CHKSUM_COPY, the existing logic left
LWIP_CHKSUM_COPY_ALGORITHM undefined
In this case we want it to be defined to 0 since none of the copy
checksum algorithms provided are being used
This commit also introduces indentation matching LWIP_CHKSUM to
improve the readability of the code
2016-01-20 11:34:25 -06:00
Joel Cunningham
0a67c06b51
Fix type on snmp_set_test_ok to be snmp_err_t
...
This function was returning values from snmp_err_t but wasn't
upgraded to using the typedef after commit babce70
This resulted in compilation failure on MSVC 2013
2016-01-20 11:18:35 -06:00
Dirk Ziegelmeier
babce70c95
SNMP: Convert SNMP error #defines to an enum and fix type mismatches discovered by conversion; Convert SNMP_NEXT_OID_STATUS to an enum
2016-01-20 10:53:59 +01:00
Dirk Ziegelmeier
4cf509989f
SNMP: Fix variable naming in snmp_pbuf_stream
2016-01-20 10:53:15 +01:00
Sylvain Rochet
6185bf6f61
PPP: CCP: don't drop output packets if CCP negotiated that we don't compress on our side
...
CCP might negotiate to not compress if peers cannot agree on a
compressor, therefore if the null compressor is chosen we must pass
packets as is instead of dropping them.
Reported-by: Stephan Linz <linz@li-pro.net >
Fixes: 987f6237c4 "PPP, MPPE, drop input/output packets if we couldn't find the chosen decompressor/compressor"
Signed-off-by: Sylvain Rochet <gradator@gradator.net >
2016-01-19 23:51:47 +01:00
Stephan Linz
2c31beb6e7
IPv4: fix some meaningless debug messages
...
Signed-off-by: Stephan Linz <linz@li-pro.net >
2016-01-18 21:34:13 +01:00
Stephan Linz
9f3270afaf
PPP: fix typo in debug message
...
Signed-off-by: Stephan Linz <linz@li-pro.net >
2016-01-18 21:33:17 +01:00
Axel Lin
fe2cfe2dba
raw: Fix build error
...
IP6_HLEN is only defined when LWIP_IPV6, IP_HLEN is only defined when LWIP_IPV4.
This fixes build error in !LWIP_IPV4 || !LWIP_IPV6 cases.
Fixes: f2c7e9c939 ("raw: Remove unnecessary #if guard around PCB_ISIPV6() calls")
Reported-by: Erik Ekman
Signed-off-by: Axel Lin <axel.lin@ingics.com >
2016-01-18 16:02:01 +01:00
Sylvain Rochet
1ee574944c
PPP, Documentation, fixed mistake about pppos_input_sys
...
Woops, pppos_input_sys is an internal function which must not be called
from lwIP user application. The correct function to use is
pppos_input_tcpip.
2016-01-18 12:45:40 +01:00
Stephan Linz
80375e68dd
ip_frag: fix compiler warnings, unused variable
...
In case of IP_REASS_FREE_OLDEST==0, the argument clen of
ip_reass_enqueue_new_datagram() will not used and leads
the compiler to a warning.
Signed-off-by: Stephan Linz <linz@li-pro.net >
2016-01-18 11:55:54 +01:00
Stephan Linz
289d1dd7f3
slipif: fix several compiler warnings
...
- include new SNMP header
- add missing pointer type casting
- add missing default cases
- use const for all ip address types
- distinguish between IPv4 and IPv6 address types
Signed-off-by: Stephan Linz <linz@li-pro.net >
2016-01-18 11:55:32 +01:00
Axel Lin
f2c7e9c939
raw: Remove unnecessary #if guard around PCB_ISIPV6() calls
...
PCB_ISIPV6() macro is well defined for all cases (LWIP_IPV4 && LWIP_IPV6,
LWIP_IPV4 only and LWIP_IPV6 only), thus remove the unnecessary #if guard
around PCB_ISIPV6() calls.
Signed-off-by: Axel Lin <axel.lin@ingics.com >
2016-01-18 11:55:06 +01:00
Dirk Ziegelmeier
dc36dbac27
SNMP MIB2: Add unsupported snmpSilentDrops and snmpProxyDrops objects
2016-01-15 11:46:35 +01:00
Dirk Ziegelmeier
d9534325cf
SNTP: Add function to get operating mode
2016-01-15 11:41:12 +01:00
Axel Lin
c221361874
stats: Move memp_names table out of stats_init/stats_display_memp functions
...
This makes the code simpler with better readability.
Also make memp_names static because it's only referenced by stats.c.
Signed-off-by: Axel Lin <axel.lin@ingics.com >
2016-01-15 11:38:03 +01:00
Axel Lin
70ebeda7ed
memp: Simplify implementation of memp_overflow_check_all
...
We don't really care the order of overflow/underflow checking because if
any checking fails we got assertion.
Signed-off-by: Axel Lin <axel.lin@ingics.com >
2016-01-15 11:38:02 +01:00
Joel Cunningham
11faa8149e
Fix blocking close with LWIP_SO_SNDTIMEO
...
This fixes a bug in close when LWIP_SO_SNDTIMEO is enabled, but
the option is not in use on the socket
A simple mis-typed comparison against zero would cause the close_timeout
to get set to zero if conn->send_timeout was 0
The intended check was to over-ride the default close timeout if a
send timeout had been specified via SO_SNDTIMEO
2016-01-13 22:20:52 +01:00
Dirk Ziegelmeier
70487a43d4
Apply patch #8854 : dns: Simplify #ifdef guard around dns_gethostbyname_addrtype from Axel Lin
...
+ Minor compile fix from me
Patch makes the code a tiny bit less lightweight (add a parameter in dns_gethostbyname which is then not used in dns_gethostbyname_addrtype) but it makes the code more readable.
2016-01-13 19:52:08 +01:00
Axel Lin
a93ae2558f
tcp_rexmit_rto: Remove superfluous #if TCP_OVERSIZE guard
...
TCP_OVERSIZE_DBGCHECK already implies TCP_OVERSIZE is set.
Signed-off-by: Axel Lin <axel.lin@ingics.com >
2016-01-13 19:07:08 +01:00
Dirk Ziegelmeier
c2ba9129ad
SNMP: Fix InetAddress octet string encoding (length was missing)
2016-01-13 13:04:37 +01:00
Axel Lin
c2a74b767b
udp_bind: Omit checking for the same port if no port specified
...
No port specified means to use a random port.
udp_new_port() returns a new (free) local UDP port number on success.
So in this case we don't need iterating all lists to test if the port
number is used, udp_new_port() alreay ensures the port is not used.
Move the code checking for double bind and rebind of the same pcb earlier,
as this checking is necessary in all cases.
Signed-off-by: Axel Lin <axel.lin@ingics.com >
2016-01-13 09:05:36 +01:00
Dirk Ziegelmeier
123c8dbd6a
Fix bug #46837 Don't send dhcp_release message in dhcp_release function
2016-01-13 08:54:54 +01:00
Dirk Ziegelmeier
40ff62fa60
SNMP MIB Compiler: Update project settings, fix wrong output path in SharpSnmpLib
2016-01-12 08:40:12 +01:00
Dirk Ziegelmeier
84397ef013
SNMP MIB Compiler: Treat read-create nodes as read-only
2016-01-11 20:28:01 +01:00
Dirk Ziegelmeier
a2b7cec17b
SNMP MIB Compiler: Add example command line to compile UDP-MIB
2016-01-11 20:15:17 +01:00
Dirk Ziegelmeier
e80e7a10d4
SNMP MIB Compiler: Resolve MIB files in a case-insensitive way
2016-01-11 20:14:54 +01:00
Dirk Ziegelmeier
8c4d1909f4
SNMP MIB Compiler: Deal with multiple OID assignments in a MIB file
2016-01-11 19:45:57 +01:00
Dirk Ziegelmeier
bb8ecd7e08
SNMP: Add some basic MIBs
2016-01-11 19:45:25 +01:00
Dirk Ziegelmeier
a7e1c730b2
Add .userprefs file to .gitignore
2016-01-11 19:23:09 +01:00
Dirk Ziegelmeier
6f1fc6c403
Add .gitignore (currently including SNMP MIB compiler binaries)
2016-01-11 19:21:06 +01:00
Axel Lin
9f3aab6a62
tcp_out: Use LWIP_DBG_LEVEL_SERIOUS instead of hard coded number
...
Trivial clean up to avoid using hard coded number.
Signed-off-by: Axel Lin <axel.lin@ingics.com >
2016-01-11 13:22:51 +01:00
Dirk Ziegelmeier
44256740bd
SNMP MIB Viewer: Adapt to changes in SNMP framework that were required to compile UDP-MIB and TCP-MIB
2016-01-11 12:25:47 +01:00
Axel Lin
156ad0dbf5
udp_bind: Fix the logic to check both pcbs have REUSEADDR set
...
The code for #if SO_REUSE case does not match the comment.
By default, we don't allow to bind to a port that any other udp
PCB is already bound to, unless *all* PCBs with that port have tha
REUSEADDR flag set.
Which means we want to omit checking for the same port if both pcbs
have REUSEADDR set. Fix the logic accordingly.
Fixes: d0348e0c60 ("task #6995 : Implement SO_REUSEADDR (correctly)")
Signed-off-by: Axel Lin <axel.lin@ingics.com >
2016-01-11 12:19:13 +01:00
Axel Lin
5056d375f2
tcp_bind/tcp_connect: Omit checking for the same port if no port specified
...
No port specified means to use a random port.
tcp_new_port() returns a new (free) local TCP port number on success.
So in this case we don't need iterating all lists to test if the port
number is used, tcp_new_port() alreay ensures the port is not used.
Signed-off-by: Axel Lin <axel.lin@ingics.com >
2016-01-11 12:16:27 +01:00
Dirk Ziegelmeier
b68e801975
MIB compiler: Eliminate the need for a cast
2016-01-11 10:32:33 +01:00
Dirk Ziegelmeier
987f0e3016
Update SNMP README - add correct SharpSnmpLib reference
2016-01-11 10:26:37 +01:00
Dirk Ziegelmeier
713deba83f
SNMP MIB compiler: Add ability to generate UDP-MIB and TCP-MIB
2016-01-11 10:24:31 +01:00
Dirk Ziegelmeier
b9d0d80946
SNMP: Add more MIB compiler info
2016-01-09 14:35:51 +01:00
Dirk Ziegelmeier
84cd489d24
SNMP: Add MIB compiler (code generator)
2016-01-09 12:39:48 +01:00
Axel Lin
708beb4874
udp_bind: Allocate a random port earlier to correctly detect port conflict
...
Current code does not correctly detect port conflict if no port specified
because it checks ipcb->local_port == port before udp_new_port().
Fix it by allocating a random port earlier.
Signed-off-by: Axel Lin <axel.lin@ingics.com >
2016-01-09 10:14:09 +01:00
Dirk Ziegelmeier
4e8574bd23
SNMP: Table API cleanup
2016-01-07 09:53:25 +01:00
Dirk Ziegelmeier
fbdfba2509
SNMP: Found the correct cause of a memory leak
2016-01-07 09:52:13 +01:00
Dirk Ziegelmeier
e033866651
Merge branch 'master' of ssh://git.sv.gnu.org:/srv/git/lwip
2016-01-05 10:00:21 +01:00
Dirk Ziegelmeier
76094b8c7e
SNMP: SMEMCPY should only be used when size is known at compile time
2016-01-05 09:59:42 +01:00
Dirk Ziegelmeier
e336f877c2
Merge branch 'master' of ssh://git.sv.gnu.org:/srv/git/lwip
2016-01-04 21:27:39 +01:00
Dirk Ziegelmeier
7f699b36ff
Update some MIB2 comments
2016-01-04 21:27:24 +01:00
Dirk Ziegelmeier
e041b9a51c
SNMP: Fix shadowing warning in another file. Pointed out by Erik Ekman.
2016-01-04 13:30:02 +01:00
Dirk Ziegelmeier
0a222a2ff7
SNMP: Fix shadowing warning pointed out by Erik Ekman
2016-01-04 12:31:09 +01:00
Axel Lin
031de097db
Trivial comment fix for lwip_netconn_do_disconnect()
...
Signed-off-by: Axel Lin <axel.lin@ingics.com >
2016-01-04 11:54:21 +01:00
Dirk Ziegelmeier
d4361fc7d7
snmp_traps.c: #if 0 ... #endif around C++ style comments does not work - remove the code completely for now
2016-01-04 11:41:17 +01:00
Dirk Ziegelmeier
44617bfa9b
Fix compile of SNMP on MSVC
2016-01-04 11:26:36 +01:00
Dirk Ziegelmeier
6352106aaa
Fix C++ style comment in snmp_asn1.h
2016-01-04 11:05:44 +01:00
Dirk Ziegelmeier
7412a0e74e
SNMP: Move common MIB code into snmp_core.c helper functions
2016-01-02 21:29:01 +01:00
Dirk Ziegelmeier
19d17adcfb
SNMP MIB2: Implement tcpConnectionTable
2016-01-02 20:55:14 +01:00
Dirk Ziegelmeier
e1e7a704e1
SNMP MIB2: Implement tcpListenerTable
2016-01-02 20:06:53 +01:00
Dirk Ziegelmeier
19dd6c391f
SNMP MIB2: Update UDP endpoint table variable names
2016-01-01 23:09:54 +01:00
Dirk Ziegelmeier
c5cab4e719
SNMP RAW API: Listen on IPV6 UDP port, too
2016-01-01 22:59:00 +01:00
Dirk Ziegelmeier
b48f6d1405
Add comment about udpEnpointTable non-accessible columns
2016-01-01 22:00:39 +01:00
Dirk Ziegelmeier
c466f8824f
SNMP: Finish implementing UDP-MIB. Add unsupported udpHCInDatagrams and udpHCOutDatagrams items.
2016-01-01 21:58:51 +01:00
Dirk Ziegelmeier
2b16cd93bf
SNMP: Another release_instance call bugfix in SNMP Get/GetNext requests
2016-01-01 20:58:02 +01:00
Dirk Ziegelmeier
0c39165701
SNMP: Two bugfixes in SNMP GET requests
2016-01-01 20:44:16 +01:00
Dirk Ziegelmeier
9d1234d83a
Add some comments and OID checks to udpEndpointTable
2015-12-31 16:19:26 +01:00
Dirk Ziegelmeier
dfaa979b99
Start working on udpEndpointTable
2015-12-31 16:13:45 +01:00
Dirk Ziegelmeier
611966de63
SNMP: Cleanup snmp IP helper functions, add IPv6 support
2015-12-29 22:06:23 +01:00
Dirk Ziegelmeier
4341df4094
SNMP: Fix compile when IPV4 is not enabled
2015-12-28 22:28:01 +01:00
Dirk Ziegelmeier
83f8ec1397
Some SNMP MIB2 code layout cleanups
2015-12-28 21:37:17 +01:00
Dirk Ziegelmeier
fdd98879bf
C-Style comments only, please
2015-12-26 12:17:07 +01:00
Dirk Ziegelmeier
406f707d9a
Add SNMP agent note in CHANGELOG
2015-12-26 12:04:45 +01:00
Dirk Ziegelmeier
5e34b8736a
Minor SNMP compile and comment fix
2015-12-26 12:02:16 +01:00
Dirk Ziegelmeier
7b946fa9b1
SNMP agent rewrite
...
- SNMPv2c support
- Greatly reduced RAM usage, no memory pools any more
- API cleanup
- MIB2 is separated from SNMP stack
- Support for multiple MIBs (snmp_set_mibs call) - e.g. for private MIB
- Improved MIB2 implementation (tcpConnTable etc.)
- Redesigned simple and generic API for MIB implementation
- Comfortable node types for scalar arrays and tables
- Counter64, bit and truthvalue datatype support
- Callbacks for SNMP writes
- Runs on two APIs: RAW and netconn
- Async API is gone - the stack now supports netconn API instead,
so blocking operations can be done in MIB calls.
SNMP runs in a worker thread when netconn API is used.
- Simplified thread sync support for MIBs - useful when MIBs
need to access variables shared with other threads without locking
(used in MIB2 to access lwIP stats from lwIP thread)
Currently in work:
- Traps rewrite
- MIB compiler
2015-12-26 11:43:29 +01:00
Dirk Ziegelmeier
0178d1d2ee
Add missing comment for MIB2 callbacks in opt.h
2015-12-09 21:06:14 +01:00
Dirk Ziegelmeier
0c06f09d6d
makefsdata.c: Adapt to new header include location
2015-12-09 12:48:02 +01:00
Joel Cunningham
a82c6122d5
Correct comment word usage in ip4_frag.c
...
This corrects word usage in ip4_frag.c:
* 'On' was used when it should have been 'one'
* 'Whole' was used when it should have 'hole'
2015-12-08 10:13:56 -06:00
Axel Lin
2e56f2d780
igmp: Optimize the implementation of igmp_start_timer
...
When LWIP_RAND is defined, calling LWIP_RAND() is not necessary if max_time <= 2
because group->timer will be set to 1 anyway.
Signed-off-by: Axel Lin <axel.lin@ingics.com >
2015-12-06 21:47:09 +01:00
Axel Lin
2562d637cd
tcp_out: Use LWIP_DBG_LEVEL_SERIOUS instead of magic number
...
Trivial clean up to avoid using magic number.
Signed-off-by: Axel Lin <axel.lin@ingics.com >
2015-12-06 21:38:12 +01:00
Dirk Ziegelmeier
f69b1841e0
Fix compile when netconn api is disabled but socket api is enabled.
...
Problem is that declaring functions as static in a public header will produce warnings in every file it is included because the static functions are not implemented.
Solution: When socket api is enabled, netconn is simply available, too
(Socket api uses netconn api internally)
2015-12-05 21:58:38 +01:00
Axel Lin
a3bccae173
Catch tcpip_callback call failure
...
tcpip_callback_with_block() can fail with ERR_MEM or ERR_VAL, and in the
error paths the code does not post the msg to the mailbox thus the
sys_sem_wait() call might wait forever. Fix it by testing return value of
tcpip_callback() and return error immediately.
Signed-off-by: Axel Lin <axel.lin@ingics.com >
2015-12-05 21:41:27 +01:00
Axel Lin
a21144b834
memp: Fixup LWIP_HOOK_MEMP_AVAILABLE() hook
...
I got below build warning if LWIP_HOOK_MEMP_AVAILABLE is defined.
src/core/memp.c: In function 'memp_free_pool':
src/core/memp.c:352:16: warning: variable 'old_first' set but not used [-Wunused-but-set-variable]
struct memp *old_first;
^
src/core/memp.c: In function 'memp_free':
src/core/memp.c:413:6: warning: 'old_first' may be used uninitialized in this function [-Wmaybe-uninitialized]
if (old_first == NULL) {
The LWIP_HOOK_MEMP_AVAILABLE() hook does not work, fix it.
Fixes: c838e1ed5b ("Implement possibility to declare private memory pools")
Signed-off-by: Axel Lin <axel.lin@ingics.com >
2015-12-05 21:32:14 +01:00
Axel Lin
7f92660598
icmp: Fix memory leak in icmp_input() error paths
...
Ensure the newly allocated packet buffer is freed in error paths.
Signed-off-by: Axel Lin <axel.lin@ingics.com >
2015-12-05 21:25:15 +01:00
Axel Lin
3b60c855e1
netbuf: Move #include "lwip/opt.h" out of #if LWIP_NETCONN || LWIP_SOCKET guard
...
LWIP_NETCONN and LWIP_SOCKET are defined in opt.h,
so move #include "lwip/opt.h" out of #if LWIP_NETCONN || LWIP_SOCKET guard.
Signed-off-by: Axel Lin <axel.lin@ingics.com >
2015-12-05 21:22:34 +01:00
Axel Lin
a709041b8b
Remove unnecessary p->len checking for pbuf_alloc calls with PBUF_RAM type
...
pbuf_alloc() for PBUF_RAM type always return big enough memory on success.
So checking p->len is not necessary. Testing if p is NULL or not is enough.
Signed-off-by: Axel Lin <axel.lin@ingics.com >
2015-12-05 21:21:59 +01:00
Dirk Ziegelmeier
8bb27ba8c4
Forgot to remove two SNMP options from opt.h that are now in lwip/apps/snmp_opts.h
2015-12-03 13:51:59 +01:00
Axel Lin
bd4c4b5959
Use SYS_ARCH_SET macro at appropriate places
...
Use SYS_ARCH_SET to simplify the code a bit.
Signed-off-by: Axel Lin <axel.lin@ingics.com >
2015-12-02 22:51:08 +01:00
Axel Lin
fb6d0f9006
ipaddr_aton: Avoid duplicate code to handle IPv4 address string conversion
...
Signed-off-by: Axel Lin <axel.lin@ingics.com >
2015-12-02 22:51:00 +01:00
Axel Lin
6e863ecb50
dns: Remove always true test in dns_alloc_random_port
...
The only way to exit the do-while loop is err != ERR_USE.
Thus get rid of the always true test.
Signed-off-by: Axel Lin <axel.lin@ingics.com >
2015-12-02 22:37:26 +01:00
Axel Lin
764bf251cd
igmp: Drop unneeded initialization for *group in igmp_lookup_group()
...
It's assigned to the return value of igmp_lookfor_group() immediately.
Signed-off-by: Axel Lin <axel.lin@ingics.com >
2015-12-02 22:32:50 +01:00
Axel Lin
91586bc6f6
Drop #if TCP_DEBUG guard around tcp_debug_print_state calls
...
The #if TCP_DEBUG guard can be removed because tcp_debug_print_state()
print nothing if !TCP_DEBUG.
Signed-off-by: Axel Lin <axel.lin@ingics.com >
2015-12-02 22:32:42 +01:00
Axel Lin
f971fb921e
Simplify testing minimum priority in tcp_kill_prio()
...
Simplify the code a bit by setting mprio = LWIP_MIN(TCP_PRIO_MAX, prio)
before the for loop.
Signed-off-by: Axel Lin <axel.lin@ingics.com >
2015-11-20 21:41:14 +01:00
Axel Lin
c730e45f0c
Trivial comment fix about calling tcp_slowtmr
...
Trivial typo fix.
Signed-off-by: Axel Lin <axel.lin@ingics.com >
2015-11-20 21:36:38 +01:00
Axel Lin
5c27429958
memp: Fix if MEMP_OVERFLOW_CHECK guard in memp_free_pool
...
Current code already checks memp_overflow_check_all() in memp_free() if
MEMP_OVERFLOW_CHECK >= 2. So in memp_free_pool(), it should use
MEMP_OVERFLOW_CHECK == 1 instead.
Fixes: c838e1ed5b ("Implement possibility to declare private memory pools")
Signed-off-by: Axel Lin <axel.lin@ingics.com >
2015-11-19 22:06:42 +01:00
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
Axel Lin
9c6708513a
Drop unnecessary NULL test for h->next->next in memp_sanity
...
The h will point to NULL if h->next->next is NULL anyway.
So remove the unnecessary NULL test for h->next->next in each iteration.
Signed-off-by: Axel Lin <axel.lin@ingics.com >
2015-11-19 07:23:55 +01:00
Axel Lin
21b9b5e741
Slightly improve raw_remove()/udp_remove() implementation
...
There should be no duplicate pcb in raw_pcbs/udp_pcbs list.
So the implementation of raw_remove()/udp_remove() can break from the for
loop once the target pcb is found and removed from the list.
Signed-off-by: Axel Lin <axel.lin@ingics.com >
2015-11-19 07:21:00 +01:00
Dirk Ziegelmeier
3f49b85680
Update header include guard naming of all apps headers
...
Unbreak compilation, lwip/apps/snmp.h guard clashed with lwip/snmp.h
2015-11-18 20:21:56 +01:00
Dirk Ziegelmeier
65bb7a623c
snmp.h: Add missing #if around function prototypes
2015-11-18 08:18:04 +01:00
Dirk Ziegelmeier
4293c1e138
snmp.h: Fix header include guard
2015-11-18 08:08:37 +01:00
Dirk Ziegelmeier
b8e94ec066
lwiperf: TX buffer can be static
2015-11-18 07:52:04 +01:00
Dirk Ziegelmeier
e15872982e
Add iperf to apps;
...
Fix compile of lwiperf.c
2015-11-18 07:46:39 +01:00
Dirk Ziegelmeier
e4f7ddacb3
Add Filelists.mk file containing all LWIP files. May be useful for client projects.
2015-11-16 21:54:01 +01:00
Dirk Ziegelmeier
c69dede728
Move httpd from contrib to main git repository
2015-11-16 12:27:24 +01:00
Dirk Ziegelmeier
39370db55d
Implement API function to iterate over stable ARP table entries
2015-11-16 09:53:23 +01:00
Dirk Ziegelmeier
73bb986737
Also fix compile of ethernetif.c after SNMP refactoring
2015-11-16 09:49:32 +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
Axel Lin
668d461104
dns: Fix dns_alloc_pcb for reuse an existing one case
...
The logic to use an already existing pcb is wrong because the idx never
advanced in the for loop, so it keep checking the same dns_pcbs[idx] for
each loop iteration. Fix it.
Signed-off-by: Axel Lin <axel.lin@ingics.com >
2015-11-16 09:09:31 +01:00
Dirk Ziegelmeier
29553ba7a1
Add note about moved SNMP stack to CHANGELOG
2015-11-14 22:08:31 +01:00
Dirk Ziegelmeier
cacbd596c9
Move some prototypes from snmp_msg.h to snmp.h because they are used by user code
2015-11-14 19:50:57 +01:00
Dirk Ziegelmeier
6203737093
Rename snmp_mib2.h to snmp.h so source compatibility for user netif implementations is preserved
2015-11-12 21:25:42 +01:00
Dirk Ziegelmeier
5f642eb3e3
Completely decouple SNMP stack from lwIP core by using private memory pools;
...
Move SNMP stack to apps;
API breaking change: Users need to call snmp_init() now!
2015-11-12 21:21:14 +01:00
goldsimon
92a241a29e
Fixed bug #46365 : tcp_accept_null() should call tcp_abort()
2015-11-12 10:40:49 +01:00
Dirk Ziegelmeier
c838e1ed5b
Implement possibility to declare private memory pools. This is useful to decouple some apps from the core (SNMP stack) or make contrib app useage simpler (httpserver_raw) .
2015-11-12 08:45:04 +01:00
Dirk Ziegelmeier
d38db89626
Export tcp_pcb_lists from tcp.c - can be used in SNMP code to implement MIB2 tcp connection tables
2015-11-12 08:09:44 +01:00
Dirk Ziegelmeier
3f0b1e2cdc
Remove global variable used in macros, it can be declared locally.
2015-11-12 08:07:22 +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
Joel Cunningham
1ef913cd36
Update snd_queuelen comment documentation
...
This commit updates the snd_queuelen comment documentation to reflect
that snd_queuelen tracks the number of pbufs currently in the send
buffer (unsent + unacked queues) rather than the number of pbufs
available in the buffer (which was what previous comment implied)
2015-10-26 09:33:39 -05:00
Joel Cunningham
affc6d61ca
Update socket options comments
...
This commit updates socket option comments to reflect which ones are
currently supported:
* SO_REUSEPORT is no longer implemented
* SO_SNDTIMEO is implemented
2015-10-16 13:18:39 -05: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
02bddd251a
re-added tcpip.h (removed because the better part of the file moved to "priv/tcpip_priv.h", which was more worth conserving the git history - how do you duplicate a file keeping its history in both copies??)
2015-10-09 22:00:32 +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
b32751a693
moved dhcp.c to src/core/ipv4/ since it is IPv4 only
2015-10-09 21:06:08 +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
sg
365f3fb651
Make LWIP_RAW==0 the default, raw IP sockets/pcbs should not be too common to justify the increased codesize for default setups
2015-10-09 20:47:32 +02:00
sg
a7ee681515
netbios -> netbiosns, added netbiosns_opts.h, added netbiosns_set_name() and netbiosns_stop()
2015-10-08 22:13:00 +02:00
sg
b02bcde8e0
added netbios name server from contrib (-> netbiosns)
2015-10-08 22:05:55 +02:00
sg
bef5ccda0b
removed spaces at line ending, fixed include guard
2015-10-08 21:46:43 +02:00
sg
a2cd2ae5a8
lwiperf: fixed const-cast warning
2015-10-08 21:22:35 +02:00
sg
698e20a990
Added lwiperf, a simple ipv4/tcp iperf peer
2015-10-08 21:14:14 +02:00
sg
b6ad76fe1a
fixed header include guard, fixed FILES
2015-10-08 21:13:42 +02:00
sg
22957a8082
added sntp_opts.h (all options for the sntp app), added FILES to describe the include folder
2015-10-07 22:24:32 +02:00
sg
8dfd5e82cb
first 'app': added SNTP client from contrib (unmodified from 196cbae376dfd484b4833503dd43057b4c3462fa, 28.08.2015)
2015-10-07 22:16:48 +02:00
goldsimon
65efeec4e9
fixed bug #46145 tcp_send_empty_ack() uses wrong netif with LWIP_HOOK_IP4_ROUTE_SRC (patch by Milan Cermak)
2015-10-07 14:56:25 +02:00
goldsimon
15bb334e81
SNMP: use PBUF_RAM for sending, PBUF_POOL is mostly used for RX only (if this isn't followed, tcp can get stuck when ACKs don't come through - unless some PBUF_POOL pbufs are reserved for such RX)
2015-10-07 10:41:03 +02:00
goldsimon
77f906376e
minor: fixed coding style (lwip style)
2015-10-07 10:36:50 +02:00
goldsimon
9b22f167f1
minor: mib2: removed some blocks by defining common variables above the switch
2015-10-07 10:13:20 +02:00
goldsimon
b401f42520
minor: fixed coding style (lwip style)
2015-10-07 10:03:12 +02:00
goldsimon
2949449e25
minor: SNMP: fixed coding style (lwip style)
2015-10-07 10:01:23 +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
0737cfb84e
Fixed bug #46128 (patch by Kerem Hadimli)
2015-10-06 12:42:25 +02:00
Erik Ekman
58895c3cf6
PPP: Fix shadowing of global declaration 'sha1'
...
lwip/src/netif/ppp/mppe.c: In function `mppe_rekey':
lwip/src/netif/ppp/mppe.c:74:15: error: declaration of`sha1' shadows a global declaration [-Werror=shadow]
lwip/src/include/netif/ppp/polarssl/sha1.h:88:6: error: shadowed declaration is here [-Werror=shadow]
2015-10-06 11:13:30 +02:00
Erik Ekman
7fb832aa4e
PPP: Fix shadowing of global declaration
...
Older compilers don't like variables with the same name as
global functions. md5.h contains a function md5(), rename
md5 variable in magic.c to md5_ctx.
2015-10-06 09:56:00 +02:00
Erik Ekman
673c6505ae
PPP: Fix shadowing of global declaration
...
Older compilers don't like variables with the same name as
global functions. md5.h contains a function md5(), rename
md5 variable in magic.c to md5_ctx.
lwip/src/netif/ppp/magic.c: In function `magic_churnrand':
lwip/src/netif/ppp/magic.c:105:15: error: declaration of `md5' shadows a global declaration [-Werror=shadow]
lwip/src/include/netif/ppp/polarssl/md5.h:88:6: error: shadowed declaration is here [-Werror=shadow]
lwip/src/netif/ppp/magic.c: In function `magic_random_bytes':
lwip/src/netif/ppp/magic.c:165:15: error: declaration of `md5' shadows a global declaration [-Werror=shadow]
lwip/src/include/netif/ppp/polarssl/md5.h:88:6: error: shadowed declaration is here [-Werror=shadow]
2015-10-05 18:24:30 +02:00
Erik Ekman
1fef434f01
PPP: Fix shadowing of global declaration
...
Older compilers (GCC 4.6) don't like variables with the same name as
global functions:
lwip/src/netif/ppp/lcp.c: In function 'lcp_received_echo_reply':
lwip/src/netif/ppp/lcp.c:2685:11: error: declaration of 'magic' shadows a global declaration [-Werror=shadow]
lwip/src/include/netif/ppp/magic.h:101:7: error: shadowed declaration is here [-Werror=shadow]
magic.h contains a function named magic(), so rename the variable.
2015-10-04 11:11:57 +02:00
Sylvain Rochet
495fc61a34
Documentation: SNMP: update to recent changes
...
Remove snmp_init(), it is called by lwip_init().
Remove snmp_inc_sysuptime() and snmp_add_sysuptime(), they do not exist
anymore, MIB2 is now using sys_now().
2015-10-04 11:02:17 +02:00
Erik Ekman
f80d0dab08
Remove old comments about DHCP setting netif up
2015-10-03 21:31:48 +02:00
sg
fb1ac8d766
snmp mib2: more const
2015-10-03 20:34:56 +02:00
Dirk Ziegelmeier
bc47bd28ab
snmp mib2: more nodes can be const
2015-10-03 20:34:09 +02:00
Dirk Ziegelmeier
5cf4771397
snmp: eliminiate mib_ram_array_node (it is not necessary: to the agent, the nodes may be const since the actual mib implementation knows the structures behind the nodes which do not have to be const)
2015-10-03 20:27:49 +02:00
sg
8891b277c6
snmp: hopefully fixed all alignment warnings introduced today. unfortunately, gcc does not warn about them when compiling for x86
2015-10-02 21:59:40 +02:00
goldsimon
e4abd4234d
removed comma before }
2015-10-02 13:26:11 +02:00
goldsimon
fe33fd6d86
snmp: cleaned up mib_* structs: "base" class 'struct mib_node' only needs the type, get/set functions are not used on array/external nodes (only on scalar/listroot nodes)
2015-10-02 12:33:45 +02:00
goldsimon
bf75ace695
snmp: combine oid and node pointers in array entries
2015-10-02 10:53:17 +02:00
goldsimon
5b1b430403
sockets ERR_TO_ERRNO_TABLE_SIZE: use LWIP_ARRAYSIZE()
2015-10-02 10:07:45 +02:00
goldsimon
424bd7e38c
def.h: added LWIP_ARRAYSIZE() macro
2015-10-02 10:05:32 +02:00
goldsimon
180ed573a5
snmp_trap_dst_ip_set: ip_addr_t pointer can be const
2015-10-02 09:58:31 +02:00
goldsimon
a9b6b5b704
adapt init.c to moved declaration of snmp_init
2015-10-02 09:57:15 +02:00
goldsimon
064d171332
snmp: moved agent initialization from snmp_msg.h to snmp.h
2015-10-02 09:56:37 +02:00
goldsimon
30445712a5
snmp: make mib_scalar_node a "derived" struct like all other nodes
2015-10-02 09:56:00 +02:00
goldsimon
91b6d45178
struct netif->hostname can be a const pointer
2015-10-02 09:42:49 +02:00
sg
3312983b27
Make LWIP_DNS_SECURE and its possible values known in opt.h, remove default initialization of DNS server
2015-10-01 21:38:39 +02:00
sg
fecd1bde83
ip4_route: fixed checking twice for a valid default_netif, fixed checking loopback traffic before checking for a valid default netif
2015-10-01 21:17:59 +02:00
goldsimon
0176e03e36
mib2: one more '};' -> '}'
2015-10-01 10:21:52 +02:00
goldsimon
8c35429ba3
add last change to CHANGELOG
2015-10-01 10:09:34 +02:00
Dirk Ziegelmeier
9957cd4a2a
fixed bug #46089 : snmp: race condition on length change between get_object_def() and get_value()
2015-10-01 10:08:23 +02:00
Dirk Ziegelmeier
ae7eeda88a
dns_found_callback should take const IP addr
2015-09-30 22:19:47 +02:00
Dirk Zigelmeier
3f4d75c8d6
netif_get_ip6_addr_match/netif_add_ip6_address must take a const ip6addr to be usable
2015-09-30 20:55:08 +02:00
goldsimon
1bcd361456
adapt CHANGELOG to last change
2015-09-30 17:54:43 +02:00
Dirk Ziegelmeier
7962b21c00
snmp: fixed ugly inheritance implementation by aggregating the "base class" (struct mib_node) in all derived node classes to get more type-safe code
2015-09-30 17:54:25 +02:00
goldsimon
59002d5081
mib2: only export 'internet', all other variables can be static
2015-09-30 17:42:19 +02:00
goldsimon
ce883d2041
minor: mib2.c: sys_tem_* -> system_* for everything but 'sys_tem' (without suffix)
2015-09-30 17:39:32 +02:00
goldsimon
96847c1199
snmp: added helper functions to encode/decode BITS pseudo type, added define for Counter64 type, minor layout changes
2015-09-30 17:24:53 +02:00
goldsimon
df1f12778f
snmp: moved noleafs_get/set functions from mib2.c to mib_structs.c, where they belong
2015-09-30 17:19:08 +02:00
goldsimon
dff234112b
minor: removed superfluous comma after '}' in mib2.c; removed superfluous comment on get-functions that follow a function typedef
2015-09-30 17:13:05 +02:00
goldsimon
e18e08ff08
minor: removed superfluous comma after '}' in msg_out.c
2015-09-30 17:09:04 +02:00
goldsimon
f3ed562983
minor: removed superfluous comma after '}' in dns.c
2015-09-30 17:01:57 +02:00
goldsimon
969fb4c981
minor: removed some trailing spaces in tcp.c
2015-09-30 17:00:57 +02:00
Erik Ekman
82fcc307ef
mld6: Simplify join/leavegroup()
...
Use netif_get_ip6_addr_match() helper to shorten the code.
2015-09-30 16:35:15 +02:00
goldsimon
1fdab5ac0e
Added/changed header of dhcp.c/.h
2015-09-30 16:33:48 +02:00
goldsimon
389831218e
Finished task #13731 : fix usage of "snmp_inc_*"
2015-09-30 15:54:43 +02:00
goldsimon
7b5ef3ae58
implement/remove missing IP counters in stats_mib2 (see task #13731 )
2015-09-30 15:05:52 +02:00
goldsimon
9d28549f32
minor: fixed coding style in mld6.c
2015-09-30 14:48:25 +02:00
Erik Ekman
6cdea62638
Add functions to join/leave v6 multicast group by netif
...
Existing functions are based on IP address, but the address is used
only to look up which netif to act on. The netif-based core code is
extracted to new exported functions.
If you have a netif handle, this makes it easier to join/leave
groups, without the need to convert to IP address first only for the
mld6 code to convert back to netif.
2015-09-30 14:44:45 +02:00
goldsimon
3dd0977635
minor: fixed coding style in igmp.c
2015-09-30 14:37:37 +02:00
Erik Ekman
ba71ac78d9
Add functions to join/leave IGMP group by netif
...
Existing functions are based on IP address, but the address is used
only to look up which netif to act on. The netif-based core code is
extracted to new exported functions.
If you have a netif handle, this makes it easier to join/leave
groups, without the need to convert to IP address first only for the
IGMP code to convert back to netif.
2015-09-30 14:29:37 +02:00
goldsimon
373714c02f
dns: improved handling 2nd server if first failed
2015-09-30 14:22:39 +02:00
goldsimon
927b72abd2
fixed bug #46072 : ip4addr_aton() does not check the number range of all address parts
2015-09-30 14:15:36 +02:00
goldsimon
f89e859415
minor: fixed coding style in ip4addr_aton()
2015-09-30 14:13:05 +02:00
goldsimon
dae73e21b8
minor: fixed coding style in ip4addr_aton()
2015-09-30 14:11:50 +02:00
goldsimon
f950bf4362
ipaddr_aton(): favour ':' over '.' to decide for IPv6 first (since IPv6 mapped IPv4 addresses might contain both ':' and '.')
2015-09-30 14:06:44 +02:00
goldsimon
0621e8d1b1
ip6addr_aton(): fail on three successive colons in an IPv6 address string
2015-09-30 14:05:13 +02:00
goldsimon
5a185a0fbd
minor: fixed coding style in ip6addr_aton()
2015-09-30 13:55:09 +02:00
goldsimon
45fd622491
Fixed bug #46071 Logic error in line 1473 in dns.c
2015-09-30 13:36:13 +02:00
goldsimon
5e7a74e2e7
fixed bug #46064 : ip_set_v6() must set pcb ip address types as well
2015-09-28 09:36:36 +02:00
goldsimon
94625a8fa8
MIB2_STATS: moved netif related mib2 counters into a struct (defined in stats.h), added ifInErrors/ifInUnkownProtos (now handled in etharp.c) and ifOutErrors
2015-09-28 08:50:21 +02:00
goldsimon
dbe703cfb0
netdb: fixed warning about pointless comparison
2015-09-28 08:10:53 +02:00
goldsimon
bc30899168
fixed compiler warnings where passing variable instance to ip_addr_isany
2015-09-28 07:56:52 +02:00
Sylvain Rochet
ce98bc9437
test: etharp: Fixed const warning
2015-09-27 22:59:15 +02:00
Sylvain Rochet
d39f929675
PPP: magic: don't truncate sys_jiffies() return value
...
It used to be this way because the original implementation was close to
the hardware and used a free running 16 bits timer so it was necessary.
Currently what it is only doing is removing potential entropy we might
get from upper bits, that's a bad idea.
2015-09-27 17:15:31 +02:00
Sylvain Rochet
b589864144
sys.h: fixed comment, sys_msleep() is in ms, not in jiffies
2015-09-27 00:05:58 +02:00
Sylvain Rochet
9e0202b38f
PPP, PPP_MAXIDLEFLAG is now in ms instead of jiffies
...
Jiffies isn't really a humanly readable value and it means the default
PPP_MAXIDLEFLAG period depends on the platform "jiffies" frequency,
which isn't nice.
Change PPP_MAXIDLEFLAG to use ms instead of jiffies, the current
PPP_MAXIDLEFLAG default (100 ms), looks like a sane value and is
left unchanged.
2015-09-26 23:01:15 +02:00
sg
ba41685353
PPP: include "ppp_settings.h" if PPP_INCLUDE_SETTINGS_HEADER is defined to be able to silence some warnings in PPP code only (at least msvc needs this since PPP produces more warnings than the rest)
2015-09-24 22:04:48 +02:00
sg
bb91bd2279
fixed coding style: use more ()
2015-09-24 21:04:20 +02:00
Sylvain Rochet
8b2c73de4e
ip4: routing: check peer for point to point interfaces
...
gw netif field for point to point interfaces is the peer IP address.
Check if the destination is equals to the gw field of point to point
interfaces (broadcast flag is not set) when routing an IP packet.
2015-09-24 21:01:52 +02:00
goldsimon
715d8d3881
simplify FDSETSAFESET()/FDSETSAFEGET(): p is not required
2015-09-24 15:34:54 +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
b0917d987a
Cleaned up using struct netif.ip_addr by creating API functions for it
2015-09-24 14:57:16 +02:00
goldsimon
99d2e5233d
struct udp_pcb.multicast_ip must be an ip_addr_t, too, to completely avoid temporary storage
2015-09-24 14:55:55 +02:00
goldsimon
e11e12f01d
Fixed ETHARP_TRUST_IP_MAC after changing struct netif.ip_addr/netmask to ip_addr_t
2015-09-24 14:46:29 +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
262a641396
eliminate temporary storage when using netif addresses for ip_addr_t* now that they have the correct type (ATTENTION: ip6_select_source_address() and ip4_netif_get_local_ip() now return ip_addr_t*!)
2015-09-24 14:34:24 +02:00
goldsimon
4d2f4ce78c
udp: don't use ip4_2_ip() where not required
2015-09-24 10:39:13 +02:00
goldsimon
51ce505d7d
Simplify ip_2_ip6/4(_c) macros (and removed LWIP_ALLOW_STATIC_FN_IN_HEADER) -> now the *_c versions should not be required any more
2015-09-24 10:13:45 +02:00
goldsimon
f85737bf29
Fixed const warning in lwip_writev
2015-09-24 09:30:00 +02:00
goldsimon
ed4130bd2f
Fixed const errors after changing netif_ip4_addr/netif_ip6_addr to return cont pointers
2015-09-24 08:06:50 +02:00
goldsimon
0fbdd5e56e
fixed compiling LWIP_HAVE_LOOPIF after changing struct netif.ip6_addr to ip_addr_t
2015-09-24 07:58:29 +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
sg
db76671d4d
task #13729 : Convert netif addresses (IPv4 & IPv6) to ip_addr_t (so they can be used without conversion/temporary storage)
2015-09-23 22:09:37 +02:00
sg
05e6f06b62
Fixed IP_ADDR6 macro for IPv6 only
2015-09-23 22:07:34 +02:00
sg
f36adac8ab
fixed compiling udp.c for IPv6-only
2015-09-23 22:07:14 +02:00
sg
121268d320
Added ip_addr_set_zero_ip4() to explicitly set the type to IPv4 for dual-stack
2015-09-23 21:56:34 +02:00
goldsimon
e6b6543c33
igmp: use netif_ip4_addr() instead of directly accessing struct netif member
2015-09-23 16:26:56 +02:00
Dirk Ziegelmeier
e00e4a6c13
make netif_ip4_* get accessors return const pointers
2015-09-23 13:19:56 +02:00
Sylvain Rochet
e588dfdbce
documentation: savannah: updated for Git
2015-09-22 21:52:44 +02:00
Sylvain Rochet
2f40d19193
trivial CVS to Git renaming
2015-09-22 21:09:57 +02:00
Sylvain Rochet
7a485b1a71
README: replaced CVS references to Git
2015-09-22 20:39:32 +02:00
goldsimon
abc74464a0
Revert "make netif_ip4_addr/netmask/gw macros return constant IP address pointers"
...
This reverts commit b9b31a5e72 .
2015-09-22 11:42:41 +02:00
Sylvain Rochet
9882dd5eff
documentation: rawapi: more syntax fixes
...
ethernet -> Ethernet
ip -> IP
LwIP -> lwIP
lwip -> lwIP
it's use. -> its use.
2015-09-22 00:27:56 +02:00
Sylvain Rochet
bb92a059b6
documentation: rawapi: syntax fixes
...
udp -> UDP
tcp -> TCP
2015-09-22 00:20:49 +02:00
Sylvain Rochet
47a579f54f
documentation: rawapi: improved documentation on multithreading state
...
Based from the current lwIP wiki and my own, improved documentation about
the current lwIP multithreading state.
2015-09-21 23:54:16 +02:00
Sylvain Rochet
6746f1d13c
documentation: rawapi: update to current lwIP design
...
*_init() -> lwip_init()
*tmr() -> sys_check_timeouts()
netif_set_link_up() / netif_up() clarification
updated netif_add() prototype
source code style fix in examples
2015-09-21 23:19:18 +02:00
Sylvain Rochet
74939c20c4
doc: contrib: CVS -> Git, punctuation fixes
2015-09-21 22:40:56 +02:00
Dirk Ziegelmeier
b9b31a5e72
make netif_ip4_addr/netmask/gw macros return constant IP address pointers
2015-09-21 20:32:14 +02:00
Sylvain Rochet
8eab90418a
PPP, auth, code cleaning: removed useless variables on stack
2015-09-18 22:51:32 +02:00
Sylvain Rochet
83cddd8941
PPP: more const and mixed u_char/char types fixes
2015-09-18 20:11:09 +02:00
Erik Ekman
e8c0ba2a47
Fix tests after ip4_current_header() made const
2015-09-18 09:52:08 +02:00
sg
cb6adc643b
PPP: more const fixes
2015-09-17 22:20:12 +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
39e32ea7c1
fixed const warning for !IPV6_FRAG_COPYHEADER
2015-09-17 21:59:54 +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
sg
6f0dceee09
fixed some printf formatters (mainly for window scaling code)
2015-09-17 21:33:25 +02:00
sg
9614c60cf6
fixed constness for DNS_LOCAL_HOSTLIST_IS_DYNAMIC
2015-09-17 21:32:11 +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
Robert Szewczyk
52a4ca99a8
pbuf_take: make it comply with API specifications
...
LWIP_ERROR macro exited the function early with the return code
indicating a SUCCESS. Fix the error codes. Return the specified
error code for cases when the pbuf is too short.
2015-09-17 17:05:01 +02:00
Joel Cunningham
72b3f3f612
Hook up TCP cachehit stat
...
This commit hooks up the TCP cachehit stat to the PCB locality feature
so that when a PCB is moved to the head of the list and a segment comes
in, we consider this a cache hit
This also matches the usage of the cachehit stat in UDP
2015-09-17 17:02:39 +02:00
Dirk Ziegelmeier
f62022cdf3
Compiler warning fixes (mostly constness in dual-stack configurations)
2015-09-17 13:59:52 +02:00
goldsimon
726af89168
minor compiler warning fixes and coding style
2015-09-17 11:00:21 +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
sg
68a1ec2eb1
Fixed passing ip_input() to netif_add() for single-IP-version NO_SYS configurations
2015-09-16 22:09:54 +02:00
chrysn
b85b554db1
PPP, FSM, don't call memcpy with NULL even when size = 0
2015-09-16 16:03:15 +02: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
4704c9a0ad
tcp: fixed CHECKSUM_GEN_TCP feature (misplaced #define)
2015-09-14 14:48:35 +02:00
Sylvain Rochet
c15b357889
PPP, merged ppp_link_set_callbacks() into ppp_new()
2015-09-13 18:28:06 +02:00
Sylvain Rochet
46204a9f86
PPP, reorder initialisation of low level protocols to call ppp_link_set_callbacks() just after PPP control block allocation
2015-09-13 18:21:14 +02:00
Sylvain Rochet
5b07569eb9
PPP, remove now unused ioctl callback from link_callbacks structure
2015-09-13 17:59:14 +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
Sylvain Rochet
81d3337681
Documentation, add pppapi.h to thread-safe header whitelist
2015-09-12 14:57:05 +02:00
Sylvain Rochet
41ee45d9f7
PPP: fix constness in PPP related files when PRINTPKT_SUPPORT is enabled
2015-09-09 20:28:01 +02:00
Dirk Ziegelmeier
79e7201854
PPP: fix constness in PPP related files (GCC -Wcast-qual)
...
Signed-off-by: Dirk Ziegelmeier <dirk@ziegelmeier.net >
2015-09-09 14:05:35 +02:00
goldsimon
ddf899ad1e
update CHANGELOG
2015-09-08 10:28:57 +02:00
goldsimon
7702ed66a0
fixed compiler warning (stray 'a ' in code) - why is this a warning only???
2015-09-08 09:52:22 +02:00
goldsimon
b8d7a2b8e6
fixed comment, fixed unused parameter in mppe_compress()
2015-09-08 09:50:30 +02:00
goldsimon
8a0fb03e21
Separate mib2 counter/table callbacks from snmp agent. This both cleans up the code and should allow integration of a 3rd party agent/mib2.
2015-09-08 09:47:30 +02:00
sg
1e4f312352
fixed compiling DNS code again
2015-09-08 06:03:27 +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
42170e4e57
fixed unused variable warning
2015-09-06 14:28:41 +02:00
Sylvain Rochet
318ba1decd
dns: fixed trivial compiler warning
...
lwip/src/core/dns.c:1471:8: warning: extra tokens at end of #endif directive [-Wendif-labels]
#endif LWIP_IPV4 && LWIP_IPV6
2015-09-06 11:27:33 +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
goldsimon
dd3725a452
task #12243 : DNS/IPv6: added support for AAAA records
2015-09-04 12:16:14 +02:00
goldsimon
c8cd67c989
fixed pointer type of value passed for snmpenableauthentraps (broken in 2010)
2015-09-03 14:02:30 +02:00
Stian Sebastian Skjelstad
aea87a9a2f
Forget addresses set up by SLAAC when prefix expires.
2015-09-02 13:12:52 -06:00
sg
aa0e41c389
task #12178 : hardware checksum capabilities can be configured per netif (use NETIF_SET_CHECKSUM_CTRL() in your netif's init function)
2015-09-01 22:04:15 +02:00
Sylvain Rochet
c4a1cad81b
PPP, magic, build-out useless code when LWIP_RAND is defined
2015-09-01 10:29:53 +02:00
Sylvain Rochet
0f3fbb267b
PPP, magic, call magic_randomize() for all packets
...
magic_randomize() wasn't actually called for IP4/IP6 packets, fixed
2015-08-31 10:20:12 +02:00
Sylvain Rochet
a17b3fc838
PPP, magic, improved magic_randomize() when using PPP_MD5_RANDM
...
Added the random seed already used without PPP_MD5_RANDM
as an entropy source when PPP_MD5_RANDM feature is enabled.
(And a little bit of code cleaning for both)
2015-08-31 10:20:12 +02:00
goldsimon
dd8feb49aa
PBUF_REF with "custom" pbufs is now supported for RX pbufs (see pcapif in contrib for an example, LWIP_SUPPORT_CUSTOM_PBUF is required)
2015-08-31 08:29:23 +02:00
goldsimon
b572028e95
ethernet_input: pass IPv4 packets to ip4_input, not to ip_input
2015-08-31 08:26:44 +02:00
sg
a01a1b4556
support IPv4 source based routing: define LWIP_HOOK_IP4_ROUTE_SRC to point to a routing function
2015-08-30 21:54:39 +02:00
Sylvain Rochet
3121b34d17
converted CHANGELOG from ISO-8859-1 to UTF8
2015-08-30 21:36:57 +02:00
Sylvain Rochet
36305e5bd8
PPP, magic, use LWIP_RAND() if available
...
If LWIP_RAND() is available, it is used instead of libc srand()/rand()
if PPP_MD5_RANDM is disabled and it is added as a source of randomness
if PPP_MD5_RANDM is enabled.
2015-08-30 21:09:39 +02:00
Sylvain Rochet
541e3b6eb4
PPP, magic, improved magic_randomize() for PPP_MD5_RANDM is not enabled
...
A disabled PPP_MD5_RANDM should not be used when challenge are used, but
anyway, improved magic_randomize() so magic_randomseed is not equals to
sys_jiffies() which is pretty useless because that's fully predicable.
2015-08-30 21:09:39 +02:00
Sylvain Rochet
a24f4421d6
PPP, magic, using magic_random_bytes() for CHAP/MSCHAP/EAP instead of for-loop byte where possible
2015-08-30 21:09:39 +02:00
Sylvain Rochet
e8399416ae
PPP, magic, renamed random_bytes() to magic_random_bytes() for API coherency
2015-08-30 21:09:39 +02:00
Sylvain Rochet
d0fa8acf86
PPP, magic, enables building without PPP_MD5_RANDM support
...
The only API difference with and without the PPP_MD5_RANDM support is the
availability of the random_bytes() function. Added a random_bytes()
function on top of magic() when PPP_MD5_RANDM support is not enabled,
thus allowing builds for both cases.
PPP_MD5_RANDM is still enabled by default (it was mandatory) if a protocol
using encryption is enabled, such as CHAP, EAP, or L2TP auth support.
2015-08-30 21:09:39 +02:00
Sylvain Rochet
ced7bef274
PPP, magic, MD5 random pool size cannot be anything else than MD5 hash size, code cleaning to make it clear
2015-08-30 21:09:39 +02:00
Sylvain Rochet
311644f39b
PPP, PPPoS, remove magic_randomize() from PPPoS, it is already called in ppp_input()
...
There is no point of calling magic_randomize() for each pppos_input()
call, making magic_randomize() potentially called for each serial input
byte which is quite a bad idea since magic_randomize() is quite
intensive in processing time (MD5 computation) compared to HDLC frame
parsing. There is no entropy added when being called for each input byte
rather than for each valid input packet because byte input is a
monotonic event at the packet level. Well, if packet arrival time is a
valid entropy source even so, which I doubt a lot, but we don't really
have anything else and we really need random for PPP authentication
layers.
2015-08-30 21:09:38 +02:00
Sylvain Rochet
91e40e668c
PPP, minor coding style fix
2015-08-30 21:09:38 +02:00
Sylvain Rochet
987f6237c4
PPP, MPPE, drop input/output packets if we couldn't find the chosen decompressor/compressor
...
Drop input/output packets if we couldn't find a decompressor/compressor,
it can't really happen because we only negotiate what we are able to
compress/decompress, but for the sake of code consistency it makes much
more sense to do so.
2015-08-30 21:09:38 +02:00
sg
b9a8310f4b
fixed bug #44023 : TCP ssthresh value is unclear: ssthresh is set to the full send window for active open, too, and is updated once after SYN to ensure the correct send window is used
2015-08-30 20:47:17 +02:00
Sylvain Rochet
ddba4b90c3
fixed typo: IP6_FRAG_COPYHEADER -> IPV6_FRAG_COPYHEADER
2015-08-28 14:28:04 +02:00
goldsimon
98f98048bc
TCP window scaling: don't parse window scaling option on retransmission
2015-08-28 11:23:24 +02:00
goldsimon
367ac04ed8
Fixed UDP multicast receive filtering (multicast should only be received when bound to ANY or the destination multicast address)
2015-08-28 10:24:02 +02:00
goldsimon
43b18b20cc
fixed bug #45818 : API functions should check if type of ip_addr_t parameter matches the pcb type
2015-08-28 10:15:57 +02:00
goldsimon
06d8dba4a0
fixed bug #45559 : Window scaling casts u32_t to u16_t without checks
2015-08-28 09:23:10 +02:00
Sylvain Rochet
b79c3aadd2
PPP, MPPE, improve dropping of unencrypted received packet
...
Improve dropping of unencrypted received packet by taking into account
all other data protocols (such as VJ packets) in a generic way.
2015-08-28 00:19:32 +02:00
Sylvain Rochet
46985bf750
PPP, explain better why we don't need protp->datainput callback
2015-08-27 22:42:42 +02:00
Sylvain Rochet
36b3878a45
PPP, PPPoS, fixed copy/paste typo in pppos_send_config() out accm debug message
2015-08-27 22:24:27 +02:00
sg
bc8120c864
Add another sanity check for bug #41009
2015-08-27 21:43:42 +02:00
sg
8b6d9d8216
Fixed UPGRADING regarding 1.4.0
2015-08-27 21:38:30 +02:00
sg
413bf85dde
Remove empty init functions where not required for backwards compatibility
2015-08-27 21:35:18 +02:00
Sylvain Rochet
97ef85c9aa
PPP, MPPE, fixed TCP over MPPE
...
We used to modify in place the packet payload during encryption, it works
well for UDP and ICMP but TCP stack requires that we don't change the
packet payload, therefore we now copy the whole packet before encryption.
2015-08-27 01:58:35 +02:00
sg
f649172580
fixed bug bug #41009 : IPv6 reassembly broken on 64-bit platforms: define IPV6_FRAG_COPYHEADER==1 on these platforms to copy the IPv6 header instead of referencing it, which gives more room for struct ip6_reass_helper
2015-08-26 22:16:23 +02:00
sg
aad76acb68
IPV6_REASS: fix ip6_reass_remove_oldest_datagram() when the first fragment to enqueue has more pbufs than IP_REASS_MAX_PBUFS
2015-08-26 21:20:13 +02:00
sg
5eb1c411a5
LWIP_LOOPIF_MCAST -> LWIP_LOOPIF_MULTICAST
2015-08-26 20:55:51 +02:00
sg
0d6001a196
fix comment indentation
2015-08-26 20:29:38 +02:00
Joel Cunningham
0ab21da820
Add multicast support to loopif
...
This commit adds support to send and receive multicast on the loopback
netif by enabling IGMP via NETIF_FLAG_IGMP
This commit also introduces an LwIP configuration option,
LWIP_LOOPIF_MCAST, to control the behavior and it defaults to off
2015-08-26 20:28:03 +02:00
sg
204bd29e52
fixed bug #45827 : recvfrom: TCP window is updated with MSG_PEEK
2015-08-25 22:25:51 +02:00
goldsimon
fd8b37dc14
fixed bug #45029 (Several macros use ip6_2_ip() without supplying a storage address): removed netconn_*_ip6() macros
2015-08-25 07:33:24 +02:00
sg
94550682d7
more cleanup prework to fix bug #45029
2015-08-24 22:46:34 +02:00
sg
7754f96549
Change IP6_ADDR/IP_ADDR6 to initialize a full IPv6 address (e.g. use with PP_HTONL) - renamed old IP6_ADDR() to IP6_ADDR_PART()
2015-08-24 20:30:48 +02:00
goldsimon
ee2d01ed88
fix compiler warnings when passing u16_t to pbuf_header()
2015-08-24 08:49:51 +02:00
goldsimon
e97f9fca22
netdb: fix debug output when IPv6 is enabled
2015-08-24 08:02:23 +02:00
sg
177c06b1f1
- prework for fixing bug #45029 : access IPv4 configuration of struct netif via new API (netif_ip4_addr()/netif_ip4_netmask()/netif_ip4_gw()) instead of accessing the struct member directly. This way, we can change the struct member types from ip4_addr_t to ip_addr_t;
...
- fixed some bugs in calls to ip4_addr*() where the cast to u8_t* did not reveal the wrong address type
2015-08-20 22:39:48 +02:00
goldsimon
cc348dcca2
LWIP_IGMP and LWIP_MULTICAST_TX_OPTIONS need LWIP_IPV4
2015-08-20 16:36:54 +02:00
goldsimon
8622af77c1
nd6: adapt to constness of IP6_ADDR_ANY6 for IPv6-only configuration
2015-08-20 16:35:49 +02:00
goldsimon
3b21f469ca
fix bug #45120 in a cleaner way
2015-08-20 13:05:59 +02:00
goldsimon
82033d5029
Clarify comment for MEMP_NUM_SNMP_VARBIND/MEMP_NUM_SNMP_VALUE
2015-08-20 11:43:36 +02:00
goldsimon
da5ccbf7d1
SNMP: tiny preparation for SNMP to support more versions than just v1: store request version in struct snmp_msg_pstat so that the response can be sent with the same version (v2c might already work but getbulk is missing)
2015-08-20 09:38:17 +02:00
goldsimon
a22a92b481
Fixed compiler warning when window scaling is enabled (tcp_sndbuf() should still return u16_t since that value can directly be passed to tcp_write())
2015-08-20 09:18:20 +02:00
goldsimon
5bd262f9e9
fixed passing u16_t 'snmp_varbind->value_len' to functions taking an u8_t only
2015-08-20 08:23:34 +02:00
goldsimon
2b93ef1d75
fixed bug #43790 : Sending octet string of Length >255 from SNMP agent (patch by Manoj Kumar)
2015-08-20 08:12:50 +02:00
sg
05abfc8ded
Fixed icmp.c after 1.4.0-based patch #45120
2015-08-19 22:14:37 +02:00
sg
de8e810792
fixed bug #45120 : Broadcast & multiple interfaces handling
2015-08-19 20:55:03 +02:00
goldsimon
cb28380f47
Add doxygen config + main-file used by Frédéric to create http://www.nongnu.org/lwip/ for 1.3.0 (see https://lists.gnu.org/archive/html/lwip-users/2013-01/msg00062.html ) - just so that it doesn't get lost
2015-08-19 15:43:46 +02:00
goldsimon
d104335501
dns.c: fixed compiler warning
2015-08-19 13:28:03 +02:00
goldsimon
7263cc675b
fixed bug #45004 : dns response without answer might be discarded
2015-08-19 10:33:42 +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
goldsimon
7df2dd67bd
another fix for LWIP_MULTICAST_TX_OPTIONS: without LWIP_IGMP, udp_pcb->mcast_ttl was not initialized
2015-08-19 09:19:08 +02:00
goldsimon
5be95aa377
accidentally committed debug comment //
2015-08-19 08:36:54 +02:00
sg
c2f978bd1e
patch by Chrysn: patch #8704 fix sys_timeouts_sleeptime function
2015-08-18 21:38:08 +02:00
sg
21815a1427
dns: fixed assertion when dns server address is set to ANY (patch #8692 )
2015-08-18 21:30:46 +02:00
chrysn
877fcb35f4
fix return type of netif_add_ip6_address mismatch
...
the netif_add_ip6_address function was declared err_t in
src/include/lwip/netif.h, but defined as s8_t (the default value of
err_t) in its implementation in src/core/netif.c.
this causes "conflicting types for 'netif_add_ip6_address'" errors if
err_t is defined differently in cc.h (as for example recommended in
[1]).
as it only returns error constants, it is changed to use err_t
throughout.
[1] http://lwip.wikia.com/wiki/Porting_For_Bare_Metal
2015-08-18 20:55:30 +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
2a6f31a84e
fix that LWIP_MULTICAST_TX_OPTIONS must be used in ip4_route instead of LWIP_IGMP
2015-08-18 16:35:06 +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
Sylvain Rochet
43c38a5aeb
PPP, Documentation, add that we support MPPE
2015-08-07 16:53:27 +02:00
sg
6e5ff1dbe8
Enable LWIP_HAVE_LOOPIF by default when LWIP_NETIF_LOOPBACK==1 to not make loopback traffic depend on the only netif's link state
2015-08-05 22:56:10 +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
sg
9352988c44
Tried to improve pbuf_type, LWIP_SUPPORT_CUSTOM_PBUF and PBUF_FLAG_IS_CUSTOM documentation
2015-08-05 22:26:57 +02:00
sg
e5e0a21fc6
LWIP_COMPAT_SOCKETS==2: special setting to help code parsers/code completion to show argument names/types for posix socket functions
2015-08-05 21:41:50 +02:00
Edgar Bonet
fb456e00ac
Fix documentation of TCP_WRITE_FLAG_MORE.
...
The description of the flag was erroneous in src/core/tcp_out.c, and
self-contradictory in doc/rawapi.txt.
2015-08-05 21:20:34 +02:00
sg
851e03966d
Fixed more compiler warnings for unit tests
2015-08-05 21:15:41 +02:00
Erik Ekman
38e3299675
test_etharp: Fix warning about braces
...
../../lwip-trunk/test/unit/etharp/test_etharp.c:16:8: warning: missing
braces around initializer [-Wmissing-braces]
struct eth_addr test_ethaddr = {1,1,1,1,1,1};
^
2015-08-05 21:04:33 +02:00
Erik Ekman
dbdeca3032
test_tcp_oos: Remove last_dropped variable, never read
2015-08-05 21:01:17 +02:00
sg
a78e4c6cf3
track bugfixed in CHANGELOG
2015-08-05 20:57:54 +02:00
sg
76e785dd5e
Fix that pbuf_realloc() called mem_trim() for "custom" PBUF_RAM
2015-08-05 20:40:35 +02:00
sg
767d0d9046
Fixed unit tests (compiler errors/warnings, coding style)
2015-08-03 20:41:49 +02:00
Erik Ekman
145efb1a33
Fix edge case in pbuf_take_at()
...
Writes to offsets pointing to the start of a pbuf in the chain
did nothing and just returned ERR_OK.
Added unit tests to verify the fix, and also
that pbuf_get_at()/pbuf_put_at() handles this case.
2015-08-03 20:34:08 +02:00
goldsimon
22d2af2a29
we are moving towards 1.5.0 -> set LWIP_VERSION accordingly
2015-08-03 13:58:48 +02:00
goldsimon
13801ebd74
netif_find(): name parameter can be const
2015-08-03 13:47:25 +02:00
goldsimon
614fa7b853
... and one more change to those nasty ~ operator warnings :-(
2015-08-03 11:12:53 +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
11f350e63f
Fixed ~ warnings in a different way
2015-08-03 09:10:49 +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
goldsimon
d106053e4c
Removed accidentally committed // comment
2015-08-03 08:27:33 +02:00
goldsimon
5315751dc9
init.c: fixed window scaling range check
2015-08-03 08:24:36 +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
Joel Cunningham
5b0d9338fd
netif, loopif: set link up on loopback interface
...
When LWIP_HAVE_LOOPIF is enabled, a separate loopback interface is added
as a netif. A netif need to have its link state set to up to be able to be
selected as a route in ip4_route or ip6_route.
The regression appears to be when bug #43904 (ip_route() and ip6_route()
must detect linkup status) was fixed.
Furthermore, there is no point of having the loopif down by default.
2015-07-27 00:22:30 +02:00
sg
409d7a99f9
Minor coding style fix
2015-07-14 22:17:49 +02:00
Joel Cunningham
f77e581468
Fix netbuf_destport() when LWIP_CHECKSUM_ON_COPY is not enabled
...
This commit fixes a bug in netbuf_destport() where LWIP_NETBUF_RECVINFO is
enabled, but not LWIP_CHECKSUM_ON_COPY is enabled
The flags field is only available when LWIP_CHECKSUM_ON_COPY is enabled. In
this mode, the toport_chksum is dual functioning as storage for port and
checksum
2015-07-14 22:17:06 +02:00
goldsimon
d3217718a9
Reverted fix for bug #38203 since it might be wrong
2015-06-23 09:20:06 +02:00
Stian Skjelstad
7e76480db4
udp: multicast, fix udp_set_multicast_ttl() parameter and structure member conflict
...
Macro-parameter name can not be the same as the structure member to
dereference.
2015-06-16 12:00:00 +02:00
tabascoeye
7856141fc4
icmp: fix checksum on replies of echo request with ID 0, sequence 0 and either no data or any amount of 0x00 Bytes as data ( closes : #45322 )
...
When a client sends an ICMP echo request with ID 0, sequence 0 and
either no data or any amount of 0x00 bytes as data, the checksum in the
reply is wrong (off-by-one).
Expected checksum is 0xffff in that case, observed is 0x0000.
2015-06-15 15:53:14 +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
goldsimon
392ef77bc5
Fixed bug #45161 tcp.c / tcp_abandon / pcb->local_port set to zero but needed later for tcp_rst (introduced some months ago when fixing bug #42299 )
2015-05-21 15:45:09 +02:00
goldsimon
de83c3e9e0
fixed bugs #45140 and #45141 (dhcp was not stopped correctly after fixing bug #38204 )
2015-05-19 10:56:08 +02:00
goldsimon
050d233e10
changed dhcp state name defines to include "STATE_" to prevent confusion with message types (e.g. INFORMING vs. INFORM)
2015-05-19 10:32:14 +02:00
Sylvain Rochet
8c1f834a4a
fixed bug #39683 Assertion "seg->tcphdr not aligned" failed with MEM_ALIGNMENT 1 or 2
...
We used a static 4 instead of MEM_ALIGNMENT earlier, however it broke
things for MEM_ALIGNMENT 1 or 2, fixed using a LWIP_MIN(MEM_ALIGNMENT,
4) statement.
2015-05-11 11:21:08 +02:00
Ivan Delamer
cbeb5ab960
Remove 6LowPAN flag that will not be used.
2015-05-05 14:43:58 -06:00
Ivan Delamer
33a51a1bdc
Improved IPv6 address formatting in ip6addr_ntoa_r().
2015-05-05 14:01:38 -06:00
Ivan Delamer
73660f779b
changes to ip6addr_aton() to avoid crash with some ill-formatted
...
strings.
2015-05-05 13:26:17 -06:00
Ivan Delamer
2c79332de7
Only send RS messages if we have a LL address in some state other than
...
invalid.
2015-05-05 13:05:41 -06:00
Ivan Delamer
2aec025e16
Bug fix: properly use unspecified source address for router solicitation
...
if needed.
2015-05-05 13:00:17 -06:00
Ivan Delamer
24f486261a
Small bug fix in ipaddr_ntoa_r when IPv4 and IPv6 are enabled.
2015-05-05 11:57:23 -06:00
Edgar Bonet
f0c4944e2c
sockets: do not assume defined(FD_SET) implies defined(FD_SET_VAL).
2015-05-05 14:08:42 +02:00
Edgar Bonet
cf15872b8d
SNMP, Missing const qualifier on internet_nodes[] in mib2.c.
2015-05-05 13:02:30 +02:00
Sylvain Rochet
78e1b9b7c1
PPP, don't store the name by which the peer authenticated itself to us if multilink support is disabled
...
pcb->peer_authname is only used by multilink support (which we don't
support), don't store the useless peer authname.
2015-05-01 22:51:09 +02:00
Sylvain Rochet
967a8d0678
PPP, opt.h: fixed coding style
2015-05-01 01:01:42 +02:00
Sylvain Rochet
fa44cef27b
PPP, L2TP, added configurable L2TP MRU using opt.h
2015-05-01 00:49:19 +02:00
Sylvain Rochet
29ba3df717
PPP, re-enabled MRU defines in opt.h
2015-05-01 00:08:34 +02:00
Sylvain Rochet
aacc222b7d
PPP, display MTU set through netif_set_mtu() if debug is enabled
2015-04-30 23:41:47 +02:00
Sylvain Rochet
341f0bf9e3
PPP, assert if ppp_fatal() is called
2015-04-30 13:48:08 +02:00
Sylvain Rochet
091c6a3bda
PPP, cleanup unused/redefined/useless limits in ppp_impl.h
2015-04-30 01:07:11 +02:00
Sylvain Rochet
fd53cad208
PPP, sifnpmode() is only useful if on demand is supported, build out if not
...
We don't support PPP on demand, don't build sifnpmode() which is only
useful for on demand if on demand is not supported.
2015-04-30 00:06:24 +02:00
Sylvain Rochet
1b6d6d0dc0
PPP, removed unnecessary memset()
...
Everything is cleared in ppp_clear(), we don't need to clear all
structures twice.
2015-04-29 23:55:23 +02:00
Sylvain Rochet
40c671b1a5
PPP, PPPoS, also clear last_xmit when resetting PPPoS control block
2015-04-29 23:41:23 +02:00
Sylvain Rochet
0a8b1c199d
PPP, added missing cast on pbuf_header()
2015-04-26 23:42:18 +02:00
Sylvain Rochet
3a3c823ddb
PPP, MPPE, try to use pbuf_header() in mppe_compress()
...
If there is enough space in front of the buffer, use it instead of
allocating a new pbuf.
2015-04-26 23:27:31 +02:00
Sylvain Rochet
900f3c9a09
PPP, MPPE, don't issue CCP reset request in stateless mode
...
This is useless, flushed bit is always true in stateless mode, we
don't need to issue a CCP reset request in this case.
2015-04-26 22:13:11 +02:00
Sylvain Rochet
8fe2f747f4
PPP, MPPE, issue CCP reset request if synchronization is lost
...
If MPPE synchronization is lost, it is advised to send a CCP reset
request in order to recover to a clean state.
2015-04-26 22:04:21 +02:00
Sylvain Rochet
adaeff5540
PPP, MPPE, discard late packet in stateless mode
...
When PPP is used over a link which does not guarantee packet ordering,
we might get late MPPE packets. This is a problem because MPPE must be
kept synchronized and the current implementation does not drop them and
rekey 4095 times instead of 0, which is wrong.
In order to prevent rekeying about a whole count space times (~ 4095
times), drop packets which are not within the forward 4096/2 window and
increase sanity error counter.
2015-04-26 20:59:09 +02:00
Sylvain Rochet
d0f91c00cb
PPP, MPPE, sanity error path rework
...
We are going to need sanity error path a little further, rework to be
able to use the sanity error path anywhere in decompressor.
2015-04-26 20:57:01 +02:00
sg
e20a071977
added functions dhcp/autoip_supplied_address() to check for the source of address assignemnt (replacement for NETIF_FLAG_DHCP)
2015-04-24 21:23:15 +02:00
Sylvain Rochet
737a6921c3
PPP, place print packet debug codenames in ROM
2015-04-24 00:13:25 +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
Sylvain Rochet
acbdf63a48
debug.h: fixed LWIP_PLATFORM_ERROR macro if LWIP_DEBUG and LWIP_NOASSERT are defined
2015-04-23 23:07:06 +02:00
goldsimon
e59beeb625
fixed "missing braces around initializer" for IN6ADDR_*_INIT macros
2015-04-23 10:08:30 +02:00
goldsimon
f01dc8cc34
more "const" fixes
2015-04-23 09:59:15 +02:00
goldsimon
89f0e45b50
fixed ip_addr_islinklocal macro definition
2015-04-23 09:35:20 +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
1cdafabc7c
added missing braces around macro parameters
2015-04-23 09:04:45 +02:00
goldsimon
f9965b4967
some more compiler warning fixes
2015-04-23 08:44:44 +02:00
goldsimon
0de0942f9c
fixed pppol2tp (IP_IS_V6_L -> IP_IS_V6_VAL)
2015-04-23 07:46:06 +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
009755ba01
fixed broken ip6_addr_debug_print_parts() (broken yesterday)
2015-04-23 07:25:48 +02:00
goldsimon
53a96f69ef
ppp_free: fixed type of local 'err'
2015-04-23 07:25:10 +02:00
goldsimon
e60bc69515
added more missing casts
2015-04-23 07:24:45 +02:00
goldsimon
fbadb8354f
fixed const'ness of syscontact/sysname/syslocation
2015-04-22 16:06:39 +02:00
goldsimon
02dee05c16
Fixed const'ness in snmp (design of sys contact/name/location and snmpenableauthentraps is broken!)
2015-04-22 15:39:56 +02:00
goldsimon
b16316ae37
fixed more (tiny) warnings...
2015-04-22 14:56:58 +02:00
goldsimon
f5077dc982
fixed some more missing casts...
2015-04-22 14:18:54 +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
f468c492b9
fixed missing casts found with msvc /Wall
2015-04-22 13:38:10 +02:00
goldsimon
5410838793
igmp.c: fixed -Waddress, removed dead code
2015-04-22 12:50:26 +02:00
goldsimon
91c2618f21
fixed typo in sockets.h
2015-04-22 12:50:13 +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
a81c7bf04b
fixed compiling icmp.c (variable has to be declared at the beginning of a scope)
2015-04-22 11:29:35 +02:00
goldsimon
a6c3bb4c6d
revert accidentally committed snmp header files
2015-04-22 10:54:07 +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
goldsimon
fe195a86cd
dhcp: move declaration of "extern void dhcp_set_ntp_servers()" from dhcp.c to dhcp.h to make the function prototype known to implementers
2015-04-22 09:17:06 +02:00
goldsimon
11845cedd6
Added version-independent ip_addr_islinklocal()
2015-04-22 09:16:05 +02:00
Sylvain Rochet
5e43e2d333
PPP, L2TP, minor fixes
...
Check tot_len for ZLB instead of len, it might happens we are just
between 2 pbuf, although almost impossible.
Check buffer is at least 2 byte long before checking address & flags
header.
2015-04-22 00:50:08 +02:00
Sylvain Rochet
15cc47334e
PPP, don't assert if we receive a too short packet in ppp_input(), just drop
...
We might actually receive too short packets through PPPoE or PPPoL2TP,
don't assert on unusal packets, just drop them.
2015-04-22 00:31:14 +02:00
Sylvain Rochet
5989c1883e
PPP, removed useless padding in bitfields
...
Most of them were wrong actually. We have to use unsigned int because
C90 only allows int types for bitfields, so we are stuck to 32-bit
bitfields in most cases.
2015-04-21 22:43:53 +02:00
Sylvain Rochet
632de523de
Fixed PBUF_LINK_ENCAPSULATION_HLEN support
...
PBUF_LINK_ENCAPSULATION_HLEN support was introduced by 6ef7563f and
missed the fact that header size calculation/reservation using
computation like PBUF_LINK_HLEN + PBUF_IP_HLEN + ... are used all over
the source code. Hopefully fixed all of them.
2015-04-20 23:43:33 +02:00
Sylvain Rochet
2db7513590
PPP, VJ, improved opt.h comment about VJ
2015-04-20 21:14:05 +02:00
Sylvain Rochet
ced24f9215
PPP, MPPE, drop unencrypted input packet if MPPE is required
2015-04-20 21:13:34 +02:00
Sylvain Rochet
b302cad46d
PPP, VJ, CCP: rework to fix protocol order
...
We need to do VJ compression before CCP/MPPE compression and VJ
decompression after CCP/MPPE decompression. This leads to a massive
rewrite of how we currently handled VJ only in the PPPoS lower protocol
handler.
Moved VJ structures from pppos to ppp_pcb because we need them back in
PPP core. This is a bit unfortunate because that's not necessary for
PPPoE or PPPoL2TP, but, hey!. Fixed CCP+MPPE+VJ order.
2015-04-20 00:10:35 +02:00
Sylvain Rochet
33838b8c1c
PPP, MPPE, compile-out unused mppe_incomp() function
2015-04-19 22:06:59 +02:00
Sylvain Rochet
42fb74ce22
PPP, CCP, MPPE, handle CCP Reset-Request and Reset-Ack for MPPE
2015-04-19 22:01:58 +02:00
Sylvain Rochet
74670ec07f
PPP, MPPE, MPPE also requires MSCHAP support (therefore CHAP support as well)
2015-04-19 17:06:23 +02:00
Sylvain Rochet
3450a78992
PPP, change ppp_write() return type from int to err_t
...
ppp_write() callback returns err_t, makes ppp_write() consistent with
the callback it is calling.
2015-04-19 16:34:34 +02:00
Sylvain Rochet
f4ef6180b8
PPP, MPPE: allow users to enable CCP and MPPE support in opt.h
...
We are new ready to process CCP and MPPE packets, allow lwIP users to benefit
from those features.
2015-04-19 16:28:48 +02:00
Sylvain Rochet
f0c25aaa60
PPP, MSCHAP, fixed compiler warnings if MPPE support is disabled
2015-04-19 16:28:11 +02:00
Sylvain Rochet
0f63c1ef8f
PPP, CORE, reworked ppp_netif_output* functions to process CCP on all protocols
...
Both IPv4 and IPv6 should be proccessed by CCP, reworked ppp_netif_output*
in a generic way for CCP.
2015-04-19 16:22:20 +02:00
Sylvain Rochet
b27966860e
PPP, CCP, MPPE: added packet plumbing in ppp.c to process MPPE packets
2015-04-19 15:52:46 +02:00
Sylvain Rochet
51566d43bd
PPP, normalized debug messages
2015-04-19 14:24:30 +02:00
Sylvain Rochet
71d085bd13
PPP, CCP, added data packet configuration in ppp_pcb
2015-04-19 14:17:34 +02:00
Sylvain Rochet
ffb10e7aac
PPP, CCP, added receive and transmit chosen protocols in ccp_flags_set() (renamed ccp_set())
...
We need to know which methods were chosen when CCP is up, this used to be done
using ccp_test() which we are in the process of removing.
Using non-existing method 0 instead of -1 in CCP for unset method, allowing
type change from s16_t to u8_t for method.
2015-04-19 13:51:35 +02:00
sg
a5503df32b
Fixed typo in dchp_inform (state is named DHCP_INFORMING, not DHCP_INFORM)
2015-04-19 12:30:20 +02:00
Sylvain Rochet
c8db96705f
PPP, MPPE, close current session using lcp_close() if something went wrong
2015-04-19 02:27:40 +02:00
Sylvain Rochet
f94efab6c3
PPP, CCP, added MPPE user configuration flags
2015-04-19 02:17:43 +02:00
Sylvain Rochet
4c0af0f79e
PPP, MPPE, reworked MPPE debug, using ppp_pcb metadata
2015-04-19 01:49:04 +02:00
Sylvain Rochet
fc7e327d19
PPP, MSCHAP, CCP, MPPE: reworked key passing from CCP to MPPE
...
Removed mutiple copies of keys by pre-setting MPPE keys during MSCHAP
negotiation.
Improved MPPE init so we don't need to pass a buffer formatted in a
special way to MPPE, this is necessary for pppd to talk to the kernel,
we don't need that here.
2015-04-19 01:20:43 +02:00
Sylvain Rochet
045f44c7f9
PPP, MSCHAP, merged mppe_set_keys() to Set_Start_Key(), merged mppe_set_keys2() to SetMasterKeys()
2015-04-19 00:26:25 +02:00
Sylvain Rochet
867d13b007
PPP, CCP, MPPE: calling mppe_init() in ccp.c instead of using ccp_test()
...
We don't need this ccp_test() stuff which is used to test if kernel have
the ability to process MPPE packets. Reworked MPPE so we don't need it.
2015-04-18 23:51:10 +02:00
Sylvain Rochet
40991b93a2
PPP, CCP, reworked ppp_pcb ccp_localstate and all_rejected fields
2015-04-18 19:47:21 +02:00
Sylvain Rochet
949d76b328
PPP, MSCHAP: ensure magic tables are not copied and initialized on stack
2015-04-18 19:14:39 +02:00
Sylvain Rochet
210a2ccfdf
PPP, MSCHAP, MPPE: shared identical mppe_sha1_pad* between MSCHAP and MPPE
2015-04-18 18:51:45 +02:00
Sylvain Rochet
3862aad2f7
PPP, MSCHAP, reworked local functions and constants
...
MSCHAP was written the old-way, with all functions declared non static in
header, independent of their local or global scope status. Same for local
constants. Reworked in a more mordern way.
2015-04-18 17:56:35 +02:00
Sylvain Rochet
2a005c2f11
PPP, MPPE, moved MPPE global variables from MSCHAP to ppp_pcb
2015-04-18 17:41:44 +02:00
Sylvain Rochet
ab46ac9bd8
PPP, CHAP, reworked to pass ppp_pcb pointer to CHAP childs (MD5, MSCHAP, MSCHAPv2)
...
We are going to need ppp_pcb* in MSCHAP and MSCHAPv2 for MPPE for
int mppe_keys_set, u_char mppe_send_key and u_char mppe_recv_key
which are currently global variable which must be moved to ppp_pcb.
2015-04-18 17:29:55 +02:00
Sylvain Rochet
c51ed84fd8
PPP, MPPE, added ppp_mppe_state comp and decomp to ppp.h
2015-04-18 16:13:44 +02:00
Sylvain Rochet
74054ea907
PPP, MPPE, struct ppp_mppe_state to typedef
...
We usually handle "typedefed" struct in lwIP, and I agree this is a cleaner
approach. Replaced struct ppp_mppe_state to ppp_mppe_state.
2015-04-18 14:54:25 +02:00
Sylvain Rochet
f79bc03360
PPP, MPPE, optimized struct ppp_mppe_state size
2015-04-18 13:41:38 +02:00
Sylvain Rochet
b553df860c
PPP, CCP, deflate, BSD compress, predictor 1 & 2 are now optional at compile time
2015-04-18 02:02:00 +02:00
Sylvain Rochet
f753a728dd
PPP, CCP, compile-out a bit more MPPE code if MPPE is disabled
2015-04-18 01:10:25 +02:00
Sylvain Rochet
3f2e8ebcdf
PPP, MPPE, merged mppe_comp_init() and mppe_decomp_init() into mppe_init()
...
Removing a bit of redundancy and previous artefact of a generic kernel
interface. Exporting mppe_init() instead of mppe_comp_init() plus
mppe_decomp_init().
2015-04-18 00:48:26 +02:00
Sylvain Rochet
a1fe83c070
PPP, MPPE, remove dead code
2015-04-18 00:43:24 +02:00
Sylvain Rochet
879c94b01e
PPP, MPPE, removed mppe_alloc() and mppe_free()
...
We are going to use statically allocated struct ppp_mppe_state through PPP PCB,
removed now useless mppe_alloc() and mppe_free().
Merged mppe_alloc() key copy to mppe_init().
2015-04-18 00:33:57 +02:00
Sylvain Rochet
da40445d75
PPP, MPPE, changed API to use struct ppp_mppe_state* instead of void*
...
Now that struct ppp_mppe_state is exported, change MPPE API to use
struct ppp_mppe_state* instead of void*, we don't need that to be generic.
2015-04-18 00:26:15 +02:00
Sylvain Rochet
6235e1ae57
PPP, MPPE, moved struct ppp_mppe_state from mppe.c to mppe.h
...
In order to be able to use struct ppp_mppe_state statically allocated,
export struct ppp_mppe_state.
2015-04-18 00:15:52 +02:00
Sylvain Rochet
3618432107
PPP, MPPE, reworked mppe_rekey()
...
Moved sha1_context from struct ppp_mppe_state to stack, we don't need it past
mppe_rekey(). Moved shared MEMCPY() outside initial_key if block.
2015-04-18 00:02:49 +02:00
Sylvain Rochet
f1cba8a0ea
PPP, MPPE, merged get_new_key_from_sha() to mppe_rekey()
...
get_new_key_from_sha() is only used in mppe_rekey(), merged
2015-04-17 23:53:22 +02:00
Sylvain Rochet
489760d2e3
PPP, CCP, re-added missing ccp_test()
...
ccp_test() is not only used to test kernel support, but also to set MPPE keys,
we will change that further, but for now, re-add the necessary ccp_test()
2015-04-17 23:21:13 +02:00
Sylvain Rochet
caf9fc5687
PPP, MPPE, adapt compressor to use pbuf
...
mppe_compress() now takes a pointer to a pbuf pointer and re-use the
passed buffer for MPPE "compression".
2015-04-16 22:23:57 +02:00
Sylvain Rochet
dc93c2afec
PPP, MPPE, removed address, control and protocol from compressor input
...
Our PPP stack deals with packet without address and control byte nor 2-byte
protocol field, improved mppe_compress() so we don't have to worry about
them.
2015-04-14 22:56:46 +02:00
Sylvain Rochet
9164c4f309
PPP, MPPE, removed address, control and protocol from compressor output
...
Our PPP stack deals with packet without address and control byte nor 2-byte
protocol field, improved mppe_compress() so we don't have to worry about
them.
2015-04-14 22:56:41 +02:00
Sylvain Rochet
e241f880e8
PPP, code cleaning, fixed ppp_input() indentation
2015-04-13 23:19:43 +02:00
Sylvain Rochet
662f1355de
PPP, fixed LWIP_IPV4=1 and PPP_IPV4_SUPPORT=0 support
...
If LWIP_IPV4 is true but PPP_IPV4_SUPPORT is false, we need
a dummy ppp_netif_output_ip4() callback because we don't have
a netif_null_output_ip4() by default like we have for IPv6 with
netif_null_output_ip6().
2015-04-13 23:07:42 +02:00
Sylvain Rochet
c865211c2f
PPP, get_mask() is only used for IPCP, moved to PPP_IPV4_SUPPORT functions group
2015-04-13 22:58:45 +02:00
sg
6324068d34
Worked on IPv6-only stack: netdb should work
2015-04-13 21:29:04 +02:00
sg
e77e18f8c4
Worked on IPv6-only stack:
...
- prepared DNS;
- fixed compiling ppp.c
2015-04-13 21:24:40 +02:00
sg
69c337b31d
Fixed ntoa/aton/ntop/pton definitions after making IPv4 optional
2015-04-13 20:52:42 +02:00
Sylvain Rochet
bc99f75b53
PPP, PPPoL2TP, removed unnecessary single pbuf
...
Removed ppp_singlebuf() in pppol2tp_input(), chained pbuf are perfectly
acceptable for IP data and we are currently supporting them perfectly
for PPPoS. The PPP stack itself (LCP, IPCP et al.) does not support
chained pbuf and is already calling ppp_singlebuf() just before passing
packet to the protocol handler.
Added ppp_singlebuf() in pppol2tp_dispatch_control_packet() because we
do not support chained pbuf in L2TP control packet.
2015-04-12 22:00:43 +02:00
Sylvain Rochet
421582d747
PPP, MPPE, using err_t return for mppe_decompress
2015-04-12 21:09:15 +02:00
Sylvain Rochet
ab1606a0f6
PPP, MPPE, adapt decompressor to use pbuf
...
mppe_decompress() now takes a pointer to a pbuf pointer and re-use the
passed buffer for MPPE "decompression". Removed sub protocol handling
which can be shared among all decompressors in ppp.c
2015-04-12 21:04:22 +02:00
Sylvain Rochet
bcfaeca373
PPP, PPPoE, removed unnecessary single pbuf
...
Removed ppp_singlebuf() in pppoe_data_input(), chained pbuf are
perfectly acceptable for IP data and we are currently supporting them
perfectly for PPPoS. The PPP stack itself (LCP, IPCP et al.) does not
support chained pbuf and is already calling ppp_singlebuf() just before
passing packet to the protocol handler.
2015-04-12 20:08:01 +02:00
Sylvain Rochet
5f0e261f2d
PPP, MPPE, handle packets in decompressor without address and control nor protocol
...
Our PPP stack deals with packet without address and control byte nor 2-byte
protocol field, improved mppe_decompress() so we don't have to worry about
them.
2015-04-12 18:41:21 +02:00
Sylvain Rochet
0e1aec4348
PPP, using ip4_input() instead of ip_input()
...
In PPP, we previously know if we are dealing with a IPv4 or a IPv6 packet,
we don't need to use the ip_input() dispatch function, removing a useless
if and reducing call stack by one.
2015-04-12 13:53:53 +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
89d666155d
PPP, MPPE, fixed mppe_rekey()
...
Oops, it was introduced when porting to PolarSSL ARC4.
2015-04-12 01:27:05 +02:00
Sylvain Rochet
4d6d65ee33
PPP, MPPE, fixed SHA1 padding
...
SHA1 padding is 40 byte, not 256 byte. Rekeying is done for each
packet in stateless mode, ensure speedness using static table for padding.
2015-04-11 23:57:47 +02:00
Sylvain Rochet
dcdb360a19
ip6_addr.c: fixed IPv6 ip6_addr_any value
...
0000:0000:0000:0000:0000:0000:0000:0000 instead of
0000:000a:0000:000b:0000:000c:0000:000d
2015-04-11 20:24:56 +02:00
Sylvain Rochet
8a73990f51
PPP, PPPoL2TP, improved pppol2tp_create() error path
2015-04-11 14:06:06 +02:00
Sylvain Rochet
efe229a54b
PPP, PPPoL2TP, merged pppol2tp_input_ip() to pppol2tp_input()
...
We don't need anymore an input function for ip4 and an input function
for ip6, work to achieve that was partially done by ce7e31cd .
pppol2tp_input() is now only called by pppol2tp_input_ip(), finishing
dual stack support by merging pppol2tp_input_ip() into pppol2tp_input().
2015-04-11 13:56:41 +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
goldsimon
cf180b651b
fixed unit tests after changing ip_addr_t
2015-04-10 08:51:06 +02:00
goldsimon
2e649e1843
Added IP_ADDR4()/IP_ADDR6() initializer macros that initialize ip_addr_t like their counterparts IP4_ADDR()/IP6_ADDR()
2015-04-10 08:49:32 +02:00
goldsimon
1985579148
fixed compiler warning (signed/unsigned comparison) introduced when fixing bug #44766
2015-04-10 07:46:31 +02:00
goldsimon
d31dbc6798
Fixed constant initializer problem in ip_addr_t by having ip6 first
2015-04-10 07:41:40 +02:00
Sylvain Rochet
ffd45a2261
PPP, added new build dependencies in init.c
2015-04-10 01:00:08 +02:00
Sylvain Rochet
135631d29d
fixed some obvious compiler warnings
...
lwip/src/include/lwip/autoip.h:52:1: error: C++ style comments are not allowed in ISO C90 [-Werror]
//#include "lwip/udp.h"
lwip/src/core/ipv4/autoip.c:70:1: error: C++ style comments are not allowed in ISO C90 [-Werror]
//#include "lwip/udp.h"
lwip/src/include/lwip/api.h:239:25: error: declaration of ‘lev’ shadows a previous local [-Werror=shadow]
SYS_ARCH_DECL_PROTECT(lev); \
2015-04-09 23:27:36 +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
4ff1eb1890
fixed bug #44766 (LWIP_WND_SCALE: tcphdr->wnd was not scaled in two places)
2015-04-08 07:29:11 +02:00
goldsimon
7c47c917b5
dhcp: start discovery with short timeouts on network change, even if already discovering
2015-04-02 11:02:16 +02:00
Sylvain Rochet
7285459375
PPP, MPPE, exported MPPE functions
2015-03-29 12:19:33 +02:00
Sylvain Rochet
52b7ebd4e7
PPP, MPPE, fixed compiler warnings
2015-03-29 12:19:33 +02:00
Sylvain Rochet
ea6f624b58
PPP, MPPE. fixed port mistake on SHA1 computation
2015-03-29 12:19:33 +02:00
Sylvain Rochet
3cf3b78192
PPP, MPPE, commented-in Linux interface calls structure
2015-03-29 12:19:33 +02:00
Sylvain Rochet
cdc2d034de
PPP, MPPE, temporarily replaced kzalloc() with malloc()
2015-03-29 12:19:32 +02:00
Sylvain Rochet
cd8a17d644
PPP, MPPE, removed useless Linux stuff
2015-03-29 12:19:32 +02:00
Sylvain Rochet
57e3e7f150
PPP, MPPE, improved SHA1 padding
...
Don't allocate 512 bytes of RAM for padding. Reduce overall padding
size to 64, therefore using stack instead of RAM or ROM.
2015-03-29 12:19:32 +02:00
Sylvain Rochet
c759639603
PPP, MPPE, removed "compression" stats
...
We don't need "compression" stats on a encryption protocols, as commented
"Since every frame grows by MPPE_OVHD + 2 bytes, this is always going
to look bad ... and the longer the link is up the worse it will get."
2015-03-29 12:19:32 +02:00
Sylvain Rochet
a6c101aeb8
PPP, MPPE, removed now useless setup_sg() function
2015-03-29 12:19:32 +02:00
Sylvain Rochet
7ea8a754c1
PPP, MPPE, using our ARC4 instead of Linux crypto ARC4
2015-03-29 12:19:32 +02:00
Sylvain Rochet
d5667343cb
PPP, updated polarssl readme
2015-03-29 12:19:32 +02:00
Sylvain Rochet
0bfe435c4f
PPP, MPPE, updated polarssl ARC4 for lwIP
2015-03-29 12:19:32 +02:00
Sylvain Rochet
cd39843c75
PPP, MPPE, import unmodified ARC4 from polarssl
2015-03-29 12:19:32 +02:00
Sylvain Rochet
f9ae65acd8
PPP, MPPE, added build macro if MPPE is not enabled
2015-03-29 12:19:32 +02:00
Sylvain Rochet
cfd930cae7
PPP, MPPE, using our SHA1 instead of Linux crypto sha1
2015-03-29 12:19:32 +02:00
Sylvain Rochet
0b7e3610ac
PPP, MPPE, using lwIP ERR_BUF instead of Linux DECOMP_ERROR error type
2015-03-29 12:19:32 +02:00
Sylvain Rochet
10946e7669
PPP, MPPE, removed a bit more Linux stuff
2015-03-29 12:19:32 +02:00
Sylvain Rochet
2dcd8c2729
PPP, MPPE, removed include we don't have
2015-03-29 12:19:32 +02:00
Sylvain Rochet
dcde1c2a8f
PPP, CCP, added missing defines from linux/ppp-comp.h to ccp.h
2015-03-29 12:19:32 +02:00
Sylvain Rochet
0810384555
PPP, MPPE, replaced printk() to PPPDEBUG()
2015-03-29 12:19:32 +02:00
Sylvain Rochet
434fb1e0da
PPP, MPPE, fixed path to mppe.h
2015-03-29 12:19:32 +02:00
Sylvain Rochet
435a0b98ac
PPP, MPPE, cleaning license notice
...
We only need to keep the BSD license part in lwIP, cleaning the part which
is only relevant for the Linux kernel.
2015-03-29 12:19:32 +02:00
Sylvain Rochet
05eda236cc
PPP, MPPE, import unmodified Linux MPPE encoder/decoder
...
This file, which is an unmodified copy of Linux MPPE encoder/decoder, is
licensed under a dual License BSD/GPL model. It was previously in the
pppd source tree and it was removed because this is merged into the Linux
kernel.
2015-03-29 12:19:32 +02:00
goldsimon
c998faeeab
fixed bug #44649 lwip_socket_drop_registered_memberships
2015-03-27 13:18:34 +01:00
Sylvain Rochet
f967933e8b
PPP, PPPoS, protect open flag in connect() and listen()
...
Protect open flag in connect() and listen(), this is a bitfield, it might
not be set atomically on some targets.
2015-03-26 23:30:18 +01:00
Sylvain Rochet
8862a1ac8f
PPP, MPPE, ccp_options->mppe is a bitfield of MPPE_OPT_* and not a boolean, fixed
...
This is actually wrong as well in PPPd, oops.
2015-03-25 00:09:37 +01:00
Sylvain Rochet
ad56a115be
PPP, CCP, moved ccp_test() from ccp_addci() to ccp_resetci()
...
We don't need to test our available compression protocols that much, we know
what we are going to be able to use in embedded. Even PPPd don't need that.
Checking only in ccp_resetci() is enough, this way we know our cilen size
before ccp_addci() is called. PPPd is designed that *_addci() can use less
bytes than it previously asked in *_cilen(), we prefer to avoid that here.
We actually don't need at all ccp_test() calls, we know what we are
able to support at compile time, we don't need to ask the kernel like
PPPd does. This is just the first step in ccp_test() removal.
2015-03-24 23:37:56 +01:00
Sylvain Rochet
c8ed013600
PPP, FSM, added assert to easily track cilen size mismatch
...
See c49fc8d for such a problem which ends up with heap corruption.
2015-03-24 23:10:58 +01:00
Sylvain Rochet
c49fc8db72
PPP, CCP: Fix ccp_cilen returning size if both deflate_correct and deflate_draft are enabled
...
This fixes a bug returning 4 byte less than necessary for the addci buffer
if both deflate_correct and deflate_draft are enabled.
2015-03-24 21:38:33 +01:00
sg
93fa268db1
used ip6_addr_t instead of struct ip6_addr, fix const'ness in ip6_route parameters
2015-03-24 21:30:22 +01:00
sg
521c92764d
loopif is not required for loopback traffic any more but passed through any netif (ENABLE_LOOPBACK has to be enabled) (task #13515 )
2015-03-24 21:22:19 +01:00
sg
71d121fab2
Added input & route hooks for IPv6 to stay in line with IPv4
2015-03-24 20:33:47 +01:00
sg
86970a01d7
etharp: reduce ARP aging timeout from 20 minutes to 5 minutes, since this is a time obviously used in some switches as MAC learning table timeout. Having our ARP timeout higher than this can lead to sending unicast packets to multiple network segments.
2015-03-24 20:04:18 +01:00
Sylvain Rochet
210496f0ca
PPP, IPV6, correct fix for IPV6CP_COMP disabling
2015-03-23 23:48:00 +01:00
sg
2eb0386c2a
fixed bug #36017 ARP might not support duplicate addresses on multiple netifs (tried to correctly handle duplicate AutoIP addresses on multiple netifs, but only if explicitly enabled via ETHARP_TABLE_MATCH_NETIF==1)
2015-03-23 22:04:57 +01:00
sg
440c99100b
fixed bug #34617 : Stable etharp entries that are about to expire are now refreshed using unicast to prevent unnecessary broadcast.
...
Only if no answer is received after 15 seconds, broadcast is used.
2015-03-23 21:38:19 +01:00
sg
33d5e646e5
fixed bug #41318 (Bad memory ref in tcp_input() after tcp_close())
2015-03-21 21:19:10 +01:00
sg
c00a62d37f
fixed bug #38468 (tcp_sent() not called on half-open connection for data ACKed with the same ack as FIN)
2015-03-21 20:56:42 +01:00
Sylvain Rochet
17486408b4
PPP, IPV6, fixed build if VJ support is disabled
2015-03-21 20:41:03 +01:00
Sylvain Rochet
c17594c1d0
PPP, CORE, don't build get_loop_output() if demand support (not supported) is not enabled
2015-03-21 20:12:14 +01:00
sg
4463239d6e
fixed bug #38204 (DHCP lease time not handled correctly)
2015-03-21 10:09:31 +01:00
sg
45d82c8d99
dhcp.c: removed dead code (#if 0)
2015-03-20 21:03:19 +01:00
sg
3e302e8683
fixed bug #38714 (Missing option and client address in DHCPRELEASE message)
2015-03-20 21:02:41 +01:00
sg
d6620f0f3a
fixed bug #38203 (DHCP options are not recorded in all DHCP ack messages)
2015-03-20 20:29:04 +01:00
Sylvain Rochet
f7a5b71dba
nd6: fixed compiler warnings
...
nd6.c: In function ‘nd6_send_rs’:
nd6.c:997:52: warning: suggest parentheses around ‘+’ inside ‘<<’ [-Wparentheses]
p = pbuf_alloc(PBUF_IP, sizeof(struct rs_header) + lladdr_opt_len << 3, PBUF_RAM);
^
nd6.c:998:58: warning: suggest parentheses around ‘+’ inside ‘<<’ [-Wparentheses]
if ((p == NULL) || (p->len < (sizeof(struct rs_header) + lladdr_opt_len << 3))) {
2015-03-20 20:11:59 +01:00
Ivan Delamer
a4d14fc987
fix bug #44586 : nd6_send_rs() pbuf size error
2015-03-20 09:04:22 -06:00
Sylvain Rochet
c8587e1242
tcp_in: typo fix. Fixes bug #4458944589 .
2015-03-20 13:22:47 +01:00
Sylvain Rochet
4e62a88870
PPP, PPPoL2TP, fixed build with IPv6 enabled
2015-03-20 09:48:40 +01:00
Clint Sbisa
32f6e7e231
tcp: Fix ooseq processing when seqno is near 2^32
...
An edge case in out-of-sequence TCP packet processing did not use the
appropriate macro to check if the sender overran the recieve window.
Consequently, this case sometimes evaluated to true when it shouldn't, which
resulted in various bad behavior, including trying to resize a TCP buffer to 4
gigabytes.
2015-03-20 08:32:14 +01:00
goldsimon
94f7bcef67
Fixed tcp unit tests after changing routing to check for link up
2015-03-20 08:31:39 +01:00
Sylvain Rochet
36e90a1bd5
PPP, CCP, add dummy ccp_ functions in ppp.c so it builds if CCP_SUPPORT is set
2015-03-20 00:37:34 +01:00
Sylvain Rochet
9fbe900949
PPP, MPPE, replaced #ifdef MPPE to #if MPPE_SUPPORT
2015-03-20 00:20:12 +01:00
Sylvain Rochet
73f1511ac2
PPP, CORE, removed auth fields from struct ppp_pcb if auth is disabled
2015-03-20 00:00:46 +01:00
Sylvain Rochet
5937932370
PPP, CCP, various fix if MPPE is enabled
2015-03-19 21:45:19 +01:00
Sylvain Rochet
794c93b540
PPP, CCP, various compiler warnings fix
2015-03-19 21:45:19 +01:00
Sylvain Rochet
b92ac33022
PPP, CCP, updated to our utils.c function name
2015-03-19 21:45:19 +01:00
Sylvain Rochet
90bbcbf994
PPP, CCP, updated ccp_printpkt() prototype to match other *_printpkt()
2015-03-19 21:45:19 +01:00
Sylvain Rochet
151995f88c
PPP, CCP, updated ANY_COMPRESS() to use ccp_options*
2015-03-19 21:45:19 +01:00
Sylvain Rochet
611b3c4c2c
PPP, CCP, commented-in unused global variables used for options
2015-03-19 21:45:19 +01:00
Sylvain Rochet
2a6104ab17
PPP, CCP, added ccp.h in ppp.h
2015-03-19 21:45:19 +01:00
Sylvain Rochet
1dcd4cc220
PPP, CCP, reworked to our ppp_pcb* pointer and ppp_pcb->ccp* data field
2015-03-19 21:45:19 +01:00
Sylvain Rochet
7174578ac3
PPP, CCP, moved CCP global variables to ppp_pcb (ppp.h)
2015-03-19 21:45:19 +01:00
Sylvain Rochet
10d09049bb
PPP, CCP, replaced bool to unsigned int in struct ccp_options
2015-03-19 21:45:19 +01:00
Sylvain Rochet
98c6a4e86e
PPP, CCP, updated FSM state with our FSM state define PPP_FSM_x
2015-03-19 21:45:19 +01:00
Sylvain Rochet
3bd52891c5
PPP, CCP, commented-in unused PPP config file parsing
2015-03-19 21:45:19 +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
Sylvain Rochet
4ed34d2c6f
PPP, PPPoL2TP, fixed build without IPv6 enabled
2015-03-19 20:43:04 +01:00
Sylvain Rochet
c893b44da2
PPP, PPPoS, struct pbuf *n and u8_t *cur are now unused, removed
2015-03-19 20:29:26 +01:00
Ivan Delamer
d06a736f41
fix bug #44578 : Build fails for IPv6-only configuration
2015-03-19 10:08:49 -06:00
goldsimon
b135a0aa49
pppos_input_tcpip: fix pbuf leak if tcpip_input returns error, use pbuf_take instead of duplicate copy code
2015-03-19 07:14:33 +01:00
Ivan Delamer
c73daef2a1
fixed bug #43843 : ip6_addr_ismulticast_ doesn't allow for transient
...
multicast address
2015-03-18 14:04:39 -06:00
Ivan Delamer
bc08c1d2b7
fixed bug #43095 . Check actual link-layer address option length, versus
...
maximum length defined in struct. Bug would express itself if we have a
netif with 8-byte addresses and other netifs with 6-byte-or-less
addresses.
2015-03-18 13:21:39 -06:00
Ivan Delamer
8451feaa7a
fixed bug #42885 nd6_reachability_hint() accepts an address of an
...
unknown neighbour
2015-03-18 12:22:49 -06:00
Ivan Delamer
e30823769c
renamed ND6_RA_FLAG_OTHER_STATEFUL_CONFIG to ND6_RA_FLAG_OTHER_CONFIG
...
as explained in bug #39963 and RFCs.
2015-03-18 12:01:15 -06:00
Ivan Delamer
12e3b52f4d
fixed bug #39226 : Validity of netif IPv6 address is not always checked
2015-03-18 11:56:48 -06:00
Ivan Delamer
5812b22662
Pending fix for bug #37993 : IPv6 Does Not Subscribe to Link-Local
...
All-Nodes Multicast Group By Default
2015-03-18 11:20:16 -06:00
Ivan Delamer
f139b14a3c
added macros for handling IPv6 multicast filter callback.
2015-03-18 11:08:40 -06:00
Ivan Delamer
291f1382c5
fix ip6 part of bug #43904 : ip_route() and ip6_route() must detect
...
linkup status.
2015-03-18 10:56:02 -06:00
Ivan Delamer
e0fe83740a
fixed bug #44565 : PPPOS support in tcpip thread breaks SLIP
2015-03-18 10:16:14 -06:00
Sylvain Rochet
9012ec5310
PPP, PPPoS, changed pppos_output_append() description to match code change
2015-03-16 21:54:50 +01:00
Sylvain Rochet
c37ecb1552
PPP, cleared warnings if PPP_DEBUG is off
2015-03-15 17:57:16 +01:00
Sylvain Rochet
59d8e76081
PPP, code cleaning, u_char to u8_t
...
Replaced u_char to u8_t in our PPP files.
2015-03-14 14:05:33 +01:00
Sylvain Rochet
5097ac05bf
PPP, fixed warnings if LWIP_SNMP is disabled
2015-03-14 14:01:29 +01:00
Sylvain Rochet
a9c154691b
PPP, PPPoS, code cleaning
2015-03-14 14:01:11 +01:00
Sylvain Rochet
d628a9bc78
PPP, PPPoS, moved common FCS output code in pppos_output_last()
2015-03-14 14:01:11 +01:00
Sylvain Rochet
2fb1859732
PPP, PPPoS, moved checksum computation to pppos_output_append()
...
Output code is slightly smaller this way.
2015-03-14 14:01:07 +01:00
Sylvain Rochet
5f5d16c698
PPP, PPPoS, code cleaning
...
Reduced types that were too large, replace u_char to u8_t, u_short to u16_t.
2015-03-14 13:17:17 +01:00
Sylvain Rochet
f666e772a2
PPP, PPPoL2TP, warning fix if PPP IPv6 is enabled
...
lwip/src/netif/ppp/pppol2tp.c: In function ‘pppol2tp_udp_send’:
lwip/src/netif/ppp/pppol2tp.c:1229:3: warning: ‘err’ may be used uninitialized in this function [-Wmaybe-uninitialized]
return err;
^
2015-03-14 12:48:38 +01:00
Sylvain Rochet
8974b12af5
PPP, PPPoE, removed redundant size check
2015-03-14 01:12:43 +01:00
Sylvain Rochet
f96d5c9633
PPP, PPPoS, code cleaning
...
Renamed pppos_drop() → pppos_input_drop()
Renamed pppos_free_current_input_packet() → pppos_input_free_current_packet()
Moved pppos_output_last() after pppos_output_append()
Moved pppos_input_free_current_packet() before pppos_input_drop()
2015-03-14 01:08:56 +01:00
Sylvain Rochet
50336aaedd
PPP, ppp->last_xmit is only used in PPPoS, moved to PPPoS
...
Only PPPoS need to keep track of last transmitted packet for HDLC flag,
removed from PPPoE and PPPoL2TP and moved to PPPoS.
2015-03-14 01:03:58 +01:00
Sylvain Rochet
6a04357547
PPP, PPPoS, reworked output path, reduced serial tx pbuf buffers to 1
...
We actually allocated a pbuf chain only to iterate later the linked list
calling sio_write() for each pbuf, improved by calling sio_write() when
buffer is full and by recycling the pbuf, therefore only using one pbuf
for PPPoS output path.
Reworked pppos_write() and pppos_netif_output() to share more common
code into pppos_output_append() and pppos_output_last().
2015-03-14 00:37:58 +01:00
Sylvain Rochet
0da64f430e
PPP, Documentation, improved PPP_INPROC_MULTITHREADED part
2015-03-12 00:16:03 +01:00
Sylvain Rochet
e27ab3a24f
PPP, PPPoS, disable TCPIP API if PPP_INPROC_MULTITHREADED is true
...
If PPP_INPROC_MULTITHREADED is true, then user does not what to use
the TCPIP API. Disabling the TCPIP API helps the user to understand
that PPP_INPROC_MULTITHREADED must not be used if he wish to use
the TCPIP API.
2015-03-11 23:52:20 +01:00
Sylvain Rochet
121de4ef47
PPP, PPPoS, now using MEMCPY here, add #include <string.h>
2015-03-11 09:29:44 +01:00
Sylvain Rochet
77f7d99048
PPP, PPPoS, add pppos_input_tcpip() input helper function for !NO_SYS users
2015-03-11 09:28:35 +01:00
Sylvain Rochet
4b035b9902
PPP, PPPoS, PPP_INPROC_MULTITHREADED defaults to 0, explain thread safety issue with it
2015-03-11 01:20:53 +01: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
636ff411f1
PPP, PPPoS, improve the freeing of remaining RX pbuf if PPP_INPROC_MULTITHREADED is not enabled
...
If PPP_INPROC_MULTITHREADED is not enabled, we can free unfinished
RX pbuf from the pppos_disconnect() function because pppos_input()
is running in the same context. Thanks to the pppos->open flags we
now only need to free remaining pbuf in the disconnect function
if PPP_INPROC_MULTITHREADED is not enabled.
2015-03-10 23:58:16 +01:00
Sylvain Rochet
02598d1e91
PPP, PPPoS, moved pcomp and accomp only used by PPPoS to PPPoS
2015-03-10 23:51:32 +01:00
Sylvain Rochet
31aea3c996
PPP, PPPoS, moved vj_enabled flag from PPP CORE to PPPoS
...
Now that we have flags in PPPoS, moved vj_enabled only used for PPPoS to
PPPoS.
2015-03-10 23:42:14 +01:00
Sylvain Rochet
a60f2588d6
PPP, PPPoE and PPPoL2TP, removed ppp->pcomp usage
...
We refuse protocol compression in both PPPoE and PPPoL2TP, therefore
ppp->pcomp can't be true, removed.
2015-03-10 23:34:11 +01:00
Sylvain Rochet
d518f5f307
PPP, PPPoS, improve thread safety of pppos_input()
...
Don't process input data if PPPoS is closed, it helps using
pppos_input() from a different context to prevent pppos_input() to
modify PPPoS RX machine state on a closed PPPoS session. It also
prevents allocating pbuf (which are going to be tossed out by PPP core)
and parsing serial input on a closed session.
It only mitigates the fact that this function is actually NOT thread
safe in absolutely all cases, it does not fix it but it helps for a low
cost.
For example user application should never call pppos_input() while
pppos_connect() or pppos_listen() is currently running because both of
them are freeing any input pbuf left over from the last session before
resetting the PPPoS state, they really have to to prevent pbuf leaks.
We cannot fix that easily because we don't have spinlock with an
irqsave/irqrestore helper for IRQ contexts. Mutex cannot be used in
interrupt contexts (or again, with an IRQ mutex helper).
We are going to improve the documentation on this point.
2015-03-10 23:20:23 +01:00
Sylvain Rochet
d5cbacba50
PPP, PPPoS, don't protect pppos->in_accm if PPP_INPROC_MULTITHREADED is not enabled
...
If pppos_input() is used without PPP_INPROC_MULTITHREADED, then pppos_input()
is running in the lwIP context, we don't need to protect anything.
2015-03-10 22:35:04 +01:00
Sylvain Rochet
ab0f3da650
Revert "PPP, PPPoS, fixed thread safety of pppos_input()"
...
This reverts commit ea58a8103c .
2015-03-10 21:49:50 +01:00
Sylvain Rochet
52de24b95b
Revert "PPP, PPPoS, added necessary comment about mutex"
...
This reverts commit b23a6172ed .
2015-03-10 21:49:50 +01:00
Sylvain Rochet
70b60bbe16
PPP, display correct pbuf size in ppp_input() debug messages
2015-03-10 21:49:50 +01:00
sg
aff890bce8
Fixed compiler error if LWIP_IPV6==0 but LWIP_IPV6_FRAG==1
2015-03-10 21:42:29 +01:00
sg
905f1609b3
fixed the IPv4 part of bug #43904 (ip_route() must detect linkup status)
2015-03-09 21:35:57 +01:00
goldsimon
c978b25f7f
Enable LWIP_PPP_API by default if (PPP_SUPPORT && (NO_SYS == 0))
2015-03-09 09:13:28 +01:00
Sylvain Rochet
2b526756f0
PPP, updated netif/FILES about PPP
2015-03-09 00:49:08 +01:00
Sylvain Rochet
8a436d5103
PPP, IPV6CP, code cleaning on VJ support
2015-03-08 23:36:28 +01:00
Sylvain Rochet
1dd050aaca
PPP, IPV6CP, build out IPv6 VJ support using the existing IPV6CP_COMP define
2015-03-08 23:17:11 +01:00
Sylvain Rochet
99bcce7892
PPP, IPCP, removed proxy ARP support
2015-03-08 23:00:27 +01:00
Sylvain Rochet
0e2ea94f5e
PPP, IPCP, removed WINS support
2015-03-08 22:53:12 +01:00
Sylvain Rochet
9cd7abdd6e
PPP, IPCP, fully removed DNS support from IPCP if LWIP_DNS is disabled
2015-03-08 22:40:56 +01:00
Sylvain Rochet
dbacfe0a1d
PPP, IPCP, fully removed VJ support from IPCP if VJ_SUPPORT is disabled
2015-03-08 22:40:53 +01:00
Sylvain Rochet
d50494f274
PPP, Documentation, added DNS change
2015-03-08 14:15:20 +01:00
Sylvain Rochet
4b5e867a69
PPP: Documentation: replaced deprecated ip_ntoa() to ipaddr_ntoa()
2015-03-08 13:57:26 +01:00
Sylvain Rochet
969306f0f1
API: netdb: replaced deprecated ip_ntoa() to ipaddr_ntoa()
2015-03-08 13:57:13 +01:00
Sylvain Rochet
af722a2978
PPP, IPv6, reduce size of llv6_ntoa() function
...
Reduced static buffer to the strict necessary (26 bytes), removed
call to eui64_ntoa(), merged eui64_ntoa() into llv6_ntoa().
272 bytes (code + static buffers) to 140 bytes on x86_64.
Improved eui64_ntoa() as well, we don't need it anymore but I'd
like to keep all eui64_* helpers functions.
2015-03-08 13:33:55 +01:00
Sylvain Rochet
7fce9346dc
PPP, improved IPv6 address setting
...
Set IPv6 link local invalid before clearing it. Don't wait sif6up() to set
the link local valid, netif_ip6_addr_set_state() is only an accessor function
so it does not start any discovery whatsoever.
2015-03-08 12:47:09 +01:00
Sylvain Rochet
b23a6172ed
PPP, PPPoS, added necessary comment about mutex
2015-03-08 12:05:13 +01:00
Sylvain Rochet
ea58a8103c
PPP, PPPoS, fixed thread safety of pppos_input()
...
PPPoS was actually not thread safe, pppos_input() can be called from
lwIP user port at any time, whatever the PPP state is. It might even be
called during pppos_connect() and pppos_listen(), this is quite unlikely
the port do that but nothing prevent the user to since we document
pppos_input() as being thread safe.
Added a mutex if PPP_INPROC_MULTITHREADED is set and ensure pppos_input()
is safe in regard to other pppos_* functions.
2015-03-08 02:48:52 +01:00
Sylvain Rochet
7857c22277
PPP, Documentation, updated
2015-03-08 01:09:44 +01:00
Sylvain Rochet
b3c7e948be
PPP, removed now useless struct ppp_addrs from ppp_pcb
...
Saved a few bytes of useless copy.
2015-03-08 00:44:47 +01:00
Sylvain Rochet
c966a538fb
PPP, improved IPv6 address setting
...
Now setting IPv6 addresses in sif6addr() instead of sif6up(),
removed the useless copy of addresses.
2015-03-08 00:40:34 +01:00
Sylvain Rochet
3027a7d7e2
PPP, using DNS API for DNS servers
...
Now setting DNS addresses in sdns() using dns_setserver() instead
of keeping a local copy. This is probably the wanted PPP behavior,
we will see if users want this conditional.
2015-03-08 00:11:52 +01:00
Sylvain Rochet
dd22176935
PPP, improved IPv4 address setting
...
Now setting IPv4 addresses in sifaddr() instead of sifup(),
removed the useless copy of addresses.
2015-03-07 23:53:21 +01:00
Sylvain Rochet
dbf9d0f094
DNS, warning fix, dns_init() -> dns_init(void)
...
lwip/src/core/dns.c: In function ‘dns_init’:
lwip/src/core/dns.c:336:1: warning: old-style function definition [-Wold-style-definition]
dns_init()
2015-03-07 23:28:18 +01:00
Sylvain Rochet
b3218d45f3
PPP, make DNS a little more optional if LWIP_DNS is unset
2015-03-07 23:28:14 +01:00
Sylvain Rochet
3ca5184998
PPP, CORE, separated administrative status from link status of PPP netif
...
This was confusing, recent lwIP changes fixed the meaning as well as
how it is used everywhere, making the administrative status a user-only
controlled flag. Now that it's clear, updated PPP to follow lwIP
core change.
Using netif_set_link_{up,down} instead of netif_set_{up,down} when PPP
reaches/leaves running state. PPP interface is now set to administratively
UP when created with link state down.
2015-03-07 22:24:27 +01:00
sg
007ab69777
Fixed default LWIP_SUPPORT_CUSTOM_PBUF setting for IPv6/frag
2015-03-06 22:09:33 +01:00
sg
12d374d4b7
Added function documentation, fixed coding style
2015-03-06 21:38:57 +01:00
sg
0ddd7de1ba
patch #8359 (Provide utility function to add an IPv6 address to an interface)
2015-03-06 21:30:59 +01:00
sg
f385193a89
Patch #8207 (Don't Use ND6 Prefix Flags Field When LWIP_IPV6_AUTOCONFIG Is Deasserted)
2015-03-06 21:03:21 +01:00
Philip Gladstone
ff078920bc
Patch #8360 (Speed up the acquisition of SLAAC addresses) - adapted to bug #43784
2015-03-06 20:58:30 +01:00
sg
b62f443be5
Fixed comment for NETIF_FLAG_UP after fixing bug #37068
2015-03-06 20:49:47 +01:00
sg
553c4203ab
tcp/udp_netif_ipv4_addr_changed(): don't change specific-address of local tcp_listen/udp_pcb to ANY on address change
2015-03-06 20:25:51 +01:00
goldsimon
df16a7c4f3
Fixed compiler warnings in unit tests
2015-03-06 07:39:06 +01:00
goldsimon
896535fe87
Fixed dhcp unit tests after changing netif up/down handling
2015-03-06 07:38:51 +01:00
Sylvain Rochet
89434f6a2f
PPP, CORE, call netif_set_up() after if4_up and if6_up flags are set, to prevent dropping packets
...
lwIP core might send packet when calling netif_set_up(), don't drop packets
anymore in ppp_netif_output_ip4() and ppp_netif_output_ip6() because flags
are cleared.
2015-03-05 22:00:11 +01:00
sg
4e520cdd30
fixed bug #37068 (netif up/down handling is unclear): correclty separated administrative status of a netif (up/down) from 'valid address' status ATTENTION: netif_set_up() now always has to be called, even when dhcp/autoip is used!
2015-03-05 20:57:43 +01:00
sg
72dcdb7655
fixed bug #43784 (a host should send at least one Router Solicitation)
2015-03-04 21:21:49 +01:00
sg
db5510b866
init.c: raise an error if LWIP_PPP_API==1 but PPP_SUPPORT==0
2015-03-04 21:10:29 +01:00
sg
61e0efa0c7
fixed bug #41094 (Byte-order bug in IPv6 fragmentation header test)
2015-03-04 21:02:52 +01:00
sg
12514c09b2
Fixed bug #39956 (netif_create_ip6_linklocal_address out of bounds access of netif::hwaddr)
2015-03-04 20:58:37 +01:00
sg
90a0590de1
patch by Zach Smith: fixed bug #38153 (nd6_input() byte order issues)
2015-03-04 20:49:02 +01:00
Sylvain Rochet
b09c891290
PPP, PPPoE, removed devname variable from pppoe_disc_input()
...
Only used for debug, reworked in a more clever way. It was actually broken
by design: setting an interface integer into a string without formatting
was quite a dumb idea.
2015-03-02 00:45:19 +01:00
Sylvain Rochet
d28bb04a9c
PPP, PPPoE, improve reliability if we receive a PADT
...
Don't disconnect when we receive a PADT, we let the LCP Echo/Reply find
the fact that PPP session is down. Asking the PPP stack to end the
session require strict checking about the PPP phase to prevent endless
disconnection loops.
Luckily it previously does nothing because PADT frames are rarely sent
with a hunique tag and we only set the sc pointer if we receive a
hunique tag.
2015-03-02 00:16:25 +01:00
Sylvain Rochet
9de1c71ff7
PPP, PPPoE, removed global static buffer only used for debug
...
pppoe_error_tmp[] was only used in one function and only for debug purposes,
moved to stack.
2015-03-02 00:05:55 +01:00
Sylvain Rochet
3ce6dd166c
PPP, L2TP, added link-level IPv6 support
2015-03-01 22:04:24 +01:00
Sylvain Rochet
684bef066f
PPP, L2TP, merged common output code
...
New function: pppol2tp_udp_send(), common output code.
2015-03-01 21:22:21 +01:00
Sylvain Rochet
52f2221be9
PPP, L2TP, check source ip address and port
...
Improve L2TP defensiveness by checking source ip address and port
of input packets.
2015-03-01 21:15:15 +01:00
Sylvain Rochet
1bee131d52
PPP, L2TP, using LNS chosen destination port
...
L2TP LNS might chose its own local port, we actually stored
the port the LNS wanted to use but we never used it.
2015-03-01 21:14:52 +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
f7d5e81130
PPP, SERVER, MSCHAP: move output message from chap_server.message struct to stack
...
chap_server.message is only used in one function, moved to stack.
2015-03-01 00:34:00 +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
Sylvain Rochet
89771de6d0
PPP, remove VJ callback from link_callbacks if VJ support is not enabled
2015-02-28 21:39:32 +01:00
Sylvain Rochet
71b213df63
PPP, EAP: using MAXNAMELEN define instead of hardcoded 256 size for rhostname
2015-02-28 20:37:41 +01:00
Sylvain Rochet
7f3913ff58
PPP, EAP: removed malloc() and free()
...
Replaced pcb->eap.es_{client,server}.ea_peer pointer to a char table,
replaced strdup() with MEMCPY, etc.
2015-02-28 20:29:40 +01:00
Sylvain Rochet
d884034c9f
PPP, replaced drand48() with magic_pow()
2015-02-28 19:50:25 +01:00
Sylvain Rochet
bec199c4a2
PPP, MAGIC: new function: magic_pow
...
magic_pow() returns a new random number between 0 and (2^pow)-1 included.
2015-02-28 19:36:03 +01:00
Sylvain Rochet
3686110ed2
PPP, SERVER: statically define our name for authentication purposes
...
We don't need that in RAM nor a pointer to a string, a static
define is fine for embedded devices, saved ~257 bytes of RAM.
2015-02-28 18:28:07 +01:00
Sylvain Rochet
708e421ec3
PPP, CORE: code cleaning
2015-02-28 18:08:37 +01:00
Sylvain Rochet
5ae7ee5276
PPP, SERVER: added CHAP authentication support
2015-02-28 17:40:07 +01:00
Sylvain Rochet
65493b421a
PPP, SERVER, CHAP: fixed wrong pointer used on chap_timeout()
2015-02-28 15:36:35 +01:00
Sylvain Rochet
301511a840
PPP, SERVER: added PAP authentication support
...
New ppp auth function: auth_check_passwd() which check the user name and
passwd against configuration.
PAP: check remote user and password
2015-02-28 14:40:09 +01:00
Sylvain Rochet
e86a0a4325
PPP, CORE, SERVER, set auth configuration before auth
...
Set LCP wanted options accordingly to the user auth configuration
if peer is required to authenticate itself.
2015-02-28 13:08:20 +01:00
Sylvain Rochet
8d05279599
PPP, CORE, moved auth configuration from auth_reset() to lcp_resetci()
...
Prepare for PPP_SERVER support, we need to move auth configuration before
lcp_allowoptions is copied into lcp_gotoptions. Restore unused
auth_reset() function using pppd original source code.
2015-02-28 12:59:29 +01:00
Sylvain Rochet
587e0e3e0c
PPP, CORE, beautified ppp_set_auth()
...
Beautified, added PPPAUTHTYPE_MSCHAP_V2 choice support.
2015-02-27 23:55:18 +01:00
Sylvain Rochet
2315f32ca0
PPP, CORE, cleaned struct ppp_settings coding style
2015-02-27 23:12:03 +01:00
Sylvain Rochet
5a71509353
PPP, CORE, IPCP: removed useless ask_for_local boolean
...
We don't need ask_for_local boolean, this is only useful for setup which
can determine the local IP address from the system hostname, which is
probably meaningless for embedded devices (and probably any devices).
It was actually only set by ip_check_options() which is commented out in
lwIP because we don't parse a config file nor check PPP configuration
(user is responsible about writing a configuration which is logical ;-).
Furthermore ask_for_local boolean never set actually had the wrong
default for PPP server setups.
2015-02-27 22:39:42 +01:00
Sylvain Rochet
a310bc19a7
netif: fixed compiler warning
...
lwip/src/core/netif.c: In function ‘netif_set_ipaddr’:
lwip/src/core/netif.c:403:5: warning: implicit declaration of function ‘udp_netif_ipv4_addr_changed’ [-Wimplicit-function-declaration]
udp_netif_ipv4_addr_changed(&netif->ip_addr, ipaddr);
^
2015-02-26 22:45:37 +01:00
sg
0647533f8c
fixed bug #44378 (TCP connections are not aborted on netif remove)
2015-02-26 22:25:39 +01:00
sg
99dd78964a
fixed bug #40753 (re-bind UDP pcbs on change of IP address)
2015-02-26 22:17:30 +01:00
sg
0d1606ff23
Fixed last commit: can only check for bound sockets, not for unbound. There's some work to do for IPv6 in TCP...
2015-02-26 21:31:48 +01:00
sg
a6a92d42f9
Fixed bug #41700 (Call to tcp_listen_dual() should not accept IPv4 listen PCB args)
2015-02-26 21:23:40 +01:00
Sylvain Rochet
2aabe16163
PPP, PPPoS, removed ppp_accm_mask[], saved a few bytes of ROM
...
This was a pretty naive way of doing a bitshift, code is smaller if we let
the compiler decide.
2015-02-25 23:04:55 +01:00
sg
5984c996a8
fixed bug #40177 (System hangs when dealing with corrupted packets), implemented task #12357 (Ensure that malicious packets don't assert-fail): improved some pbuf_header calls to not assert-fail.
2015-02-25 22:58:27 +01:00
sg
c8d126f6ef
work on task #12357 (Ensure that malicious packets don't assert-fail): don't let too short IP packets assert-fail; fix that IPv6 input did not obey VLAN header offset
2015-02-25 22:23:12 +01:00
Joel Cunningham
9004554da3
fixed bug #43028 (IP_MULTICAST_TTL affects unicast datagrams)
2015-02-25 21:59:21 +01:00
Greg Renda
4eb9efdd33
fixed bug #38210 (ip reassembly while remove oldest datagram)
2015-02-25 21:43:39 +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
612e33c499
fixed bug #38061 (wrong multicast routing in IPv4) by adding an optional default netif for multicast routing
2015-02-25 20:58:11 +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
4bcddd72e6
PPP, CORE, cleaned ppp_close() function
...
Calling new_phase() instead of assigning pcb->phase directly.
Removed redundant call to link status callback.
2015-02-24 22:13:04 +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
Sylvain Rochet
b4990b5bb4
Fixed warnings on whole project introduced by const pointers on ip_addr_t
2015-02-22 22:50:06 +01:00
Sylvain Rochet
65095253a9
PPP, fixed warnings introduced by const pointers on ip_addr_t
2015-02-22 22:38:02 +01:00
sg
c87efb77bc
patch by Jens Nielsen: fixed bug #38803 (Source address in broadcast ping reply)
2015-02-22 22:02:17 +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
chrysn
9f065c0ea5
(api break) qualify ip_addr_t as const where feasible
...
this changes the callback signatures of the ip_output and the
{udp,raw}_recv functions.
changes were made by going through all header files, searching for
occurrences of ip_addr_t, qualifying them as const and if required
modifying the corresponding c files, looking for other uses of ip_addr_t
that would be required.
the following header files were not treated as i'm not using them and
wouldn't see them compiled: api.h api_msg.h dhcp.h dns.h igmp.h
netifapi.h pppapi.h snmp.h snmp_msg.h snmp_structs.h ppp.h pppol2tp.h
test/*
no modifications were done on ip6_addr_t.
2015-02-22 21:46:02 +01:00
Sylvain Rochet
df3f05e824
PPP, apply warnings found by MSVC fixes on other files needing the same fix
2015-02-22 21:39:04 +01:00
sg
9a10afbbc6
PPP: fixed 2 warnings found by MSVC
2015-02-22 21:30:17 +01:00
Sylvain Rochet
8d916b8573
PPP, PPPoS, removed unused next field in pppos_pcb
...
Linked list was removed, we don't need the next pointer anymore.
2015-02-22 16:57:57 +01:00
Sylvain Rochet
653657ae43
PPP, code cleaning
2015-02-22 16:45:38 +01:00
Sylvain Rochet
b0b7240022
PPP, PPPoS, moved advise about modem from pppos_create() to ppp_open()
...
pppos_create() can be called whether the modem is ready to process the
PPP session since pppos_create() does not start the PPP session anymore,
moved the advise from pppos_create() to ppp_open().
2015-02-22 16:20:03 +01:00
Sylvain Rochet
1e82003bf9
CORE, INIT, fail if none of PPP_IPV[46]_SUPPORT are enabled if PPP_SUPPORT is enabled
...
PPP_SUPPORT needs PPP_IPV4_SUPPORT and/or PPP_IPV6_SUPPORT turned on.
2015-02-22 14:30:24 +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
b040ace4c2
PPP, CORE, carrier lost signal, fixed FSM mismatch
...
ppp_sighup() hard change the PPP FSM phase, it ends up with a FSM
mismatch if PPP is currently connecting or disconnecting.
Only do "sighup" on the stable running phase, fallback to the close
method. Handle special DEAD and HOLDOFF states as well.
2015-02-22 13:54:52 +01:00
Sylvain Rochet
ab572ce5b9
PPP, CORE, fixed PPP phase state machine when ppp_close() is called during HOLDOFF phase
...
Aborting HOLDOFF leaves us at PPP_PHASE_DEAD, fixed.
2015-02-22 13:48:53 +01:00
Sylvain Rochet
ded77f59cd
PPP, FSM, fixed "timeout sending Config-Requests" output
...
\n is not needed, fixed.
2015-02-22 12:12:38 +01:00
Sylvain Rochet
a1c5415f8f
PPP, CORE, disable VJ is PPP IPV4 is compiled out
...
VJ compression is only supported for PPP IPv4, compile out VJ support
if PPP IPv4 is not compiled.
2015-02-22 02:34:45 +01:00
Sylvain Rochet
00e8988b52
PPP, IPv4 support is now optional
...
New compile time option: PPP_IPV4_SUPPORT
PPP IPv4 support can now be compiled out.
2015-02-22 02:28:04 +01:00
Sylvain Rochet
5680808fb6
PPP, CORE, ppp_ioctl PPPCTLG_UPSTATUS command now returns true if only IPv6 is up
...
PPPCTLG_UPSTATUS ioctl didn't return true if IPv6 was up and IPv4 down, fixed.
2015-02-22 01:34:47 +01:00
Sylvain Rochet
814bcc04ad
PPP, CORE, using ip*_set_* functions instead of IP4_ADDR and SMEMCPY
...
Now using lwIP helper functions on ip_addr_t and ip6_addr_t.
2015-02-22 01:33:02 +01:00
Sylvain Rochet
a8cbff08ef
PPP, IPV6, enable PPP IPv6 by default if LWIP_IPV6 is set
2015-02-22 00:25:23 +01:00
Sylvain Rochet
ee8a05c3c7
PPP, CORE, removed if_up and if6_up checks in sifdown() and sif6down()
...
It can't hurt us, checking is useless.
2015-02-21 23:53:40 +01:00
Sylvain Rochet
46d7f6f95d
PPP, IPv6, fixed unicode in file headers
2015-02-21 23:49:57 +01:00
Sylvain Rochet
30c89310a6
PPP, CORE, IPv6, if_up flag used instead of if6_up for outgoing IPv6 packets, fixed
...
We can have an IPv6 only PPP interface, checking if6_up instead of if_up fixes
IPv6 only setup.
ppp_netif_output() which were only used for common code between
ppp_netif_output_ip4() and ppp_netif_output_ip6() is not necessary
anymore, removed, reducing call stack by one.
2015-02-21 23:34:45 +01:00
Sylvain Rochet
d6e1b86147
PPP, CORE, improved, re-ordered and re-numbered IOCTL commands
2015-02-21 21:52:39 +01:00
Sylvain Rochet
a8e973f5d7
PPP, CORE, remove the user ability to set the PPP error code (PPPCTLS_ERRCODE)
...
This is now totally useless, it was used for the PPP core code but it is not
used anymore, remove then the user ability to set the PPP error code through
PPPCTLS_ERRCODE.
2015-02-21 21:48:53 +01:00
Sylvain Rochet
c4d1354c54
PPP, CORE, don't use ppp_ioctl() from PPP core, assign pcb->err_code instead
...
Removed useless calls to ppp_ioctl(pcb, PPPCTLS_ERRCODE, …), we now assign
pcb->err_code directly instead. ppp_ioctl() is not linked anymore if user
application don't use it.
2015-02-21 21:42:59 +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
bfe0c3a8e0
opt.h: fixed warnings if PPP auth support is not enabled
...
lwip/src/netif/ppp/polarssl/md4.c:43:20: warning: "LWIP_INCLUDED_POLARSSL_MD4" is not defined [-Wundef]
lwip/src/netif/ppp/polarssl/sha1.c:42:20: warning: "LWIP_INCLUDED_POLARSSL_SHA1" is not defined [-Wundef]
lwip/src/netif/ppp/polarssl/des.c:43:20: warning: "LWIP_INCLUDED_POLARSSL_DES" is not defined [-Wundef]
2015-02-21 19:43:04 +01:00
Sylvain Rochet
a387270b76
PPP, PPPoS, fixed PPP_INPROC_MULTITHREADED support
...
Oops.
2015-02-21 19:38:47 +01:00
Sylvain Rochet
59b659b027
PPP, CORE, compile out auth support if none of auth protocols are enabled
...
Added macro PPP_AUTH_SUPPORT, if none of auth protocols are enabled
(PAP, CHAP, EAP) we reduce PPP memory usage by compiling out all
struct fields and source code used for authentication.
2015-02-21 19:32:38 +01:00
Sylvain Rochet
973472c51e
opt: clarified VJ support
...
VJ is only supported for PPPoS, RFCs does not say VJ is forbidden on
PPPoE or PPPoL2TP (looks like it is strongly discouraged though, due
to checksum issues when using VJ).
2015-02-21 18:43:31 +01:00
Sylvain Rochet
9052511c86
PPP, Documentation, fixed PPP_INPROC_MULTITHREADED default status
2015-02-21 18:41:39 +01:00
Sylvain Rochet
f57d4818a4
PPP, using PPP netif->num number instead of ppp->num
...
Saved 2 bytes of RAM if debug is enabled, we are now using the
netif->num number instead of using our own ppp->num
2015-02-21 01:21:24 +01:00
Sylvain Rochet
c5973dd411
PPP, Documentation, minor fixes
2015-02-21 00:05:38 +01:00
Sylvain Rochet
e5f38bf391
PPP, added PPP documentation
2015-02-21 00:01:43 +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
Sylvain Rochet
c8f026c382
PPP, PPPoS, removed PPPERR_ on err_t return type
2015-02-20 20:54:05 +01:00
Sylvain Rochet
2c70c12814
PPP, PPPoL2TP, removed PPPERR_ usage
...
Low level protocol callbacks are using err_t returns type,
don't use PPPERR_ on them.
2015-02-20 20:52:10 +01:00
Sylvain Rochet
b31f6eb45f
PPP, PPPoE, removed PPPERR_ usage
...
Low level protocol callbacks are using err_t returns type,
don't use PPPERR_ on them.
2015-02-20 20:51:37 +01:00
Sylvain Rochet
d387c1c83a
PPP, PPPoS, added missing static modifier on pppos_netif_input()
2015-02-20 19:35:12 +01:00
Sylvain Rochet
7a1a2b9aa6
PPP, PPPoS, code cleaning
2015-02-20 01:00:48 +01:00
Sylvain Rochet
444da3ecec
PPP, CORE, we don't need PPP_LINK_ENABLED_NUMBER anymore
2015-02-20 00:44:58 +01:00
Sylvain Rochet
1918914598
PPP, PPPoS, removed linked list
...
We don't need anymore the PPPoS linked list since we have callbacks
for everything.
2015-02-20 00:40:45 +01:00
Sylvain Rochet
29f3f2e1d8
PPP, PPPoS, moved VJ protocol handler to PPPoS
...
New callback, netif input, allow low level drivers to extend
ppp_input call, moved PPPoS VJ support to pppos.c.
2015-02-20 00:40:45 +01:00
Sylvain Rochet
759d11ce1a
PPP, CORE, beautified ppp_ioctl()
2015-02-20 00:40:45 +01:00
Sylvain Rochet
729e24da78
PPP, PPPoS, added sub-ioctl commands
...
Allow low level drivers to extend ioctl call, moved PPPoS ioctl
commands to pppos.c.
2015-02-20 00:40:45 +01:00
Sylvain Rochet
ec362536f5
PPP, uniformised callbacks naming
2015-02-20 00:40:45 +01:00
Sylvain Rochet
b92fe3eecb
PPP, CORE, new callbacks, send_config, recv_config, vj_config
...
Removed some calls from PPP core to PPPoS low level protocols,
the const struct allows us to have more and more callbacks
without using more RAM.
2015-02-20 00:40:44 +01:00
Sylvain Rochet
985de035bc
PPP, CORE, now using const callbacks struct from lower level protocols
...
Saving some RAM by using callbacks struct in rodata for required
callbacks called by PPP core to PPP low level protocols.
2015-02-20 00:40:44 +01:00
Sylvain Rochet
2e40ceaaa4
CORE, enabling only PPPoL2TP is also a valid choice
2015-02-20 00:40:44 +01:00
Ivan Delamer
02a797f9f9
Modified netif flag values.
2015-02-19 16:25:30 -07:00
Ivan Delamer
b938154f6b
Removed unused netif flag for DHCP
2015-02-19 16:22:19 -07:00
Ivan Delamer
e312ebcb57
Removed unused netif flag for point to point connections
2015-02-19 16:19:29 -07:00
Sylvain Rochet
02cf50063e
PPP, PPPoX, added warnings about functions in headers which should not be called from lwIP user application
2015-02-18 23:14:30 +01:00
Sylvain Rochet
f511bec26c
PPP, PPPoS, only check PPPoS PCB pointer if PPPoS is not the only enabled lower protocol
...
We only need to keep track of existing PPPoS interfaces if PPPoS
is not the only enabled protocol.
PPP CORE does not have callbacks pointers for all PPPoS callbacks
which should actually be required for PPPoS (VJ config, asyncmap, ...),
there is too much callbacks to create and PPPoS must be kept light,
especially for users who are only using PPPoS.
But there is a drawback, PPP CORE does not know which
lower protocols it is talking to thanks to the abstraction,
therefore if PPPoS is enabled as well as PPPoE or PPPoL2TP there
might be situation where PPP CORE calls pppos_ config functions
on interfaces which are NOT PPPoS one. This is very unlikely to
happen because protocols not supported by PPPoE or PPPoL2TP are
disabled at LCP/IPCP negotiation but we are better safe than sorry.
So we check if passed PPP pointer to PPPoS configuration functions
is a PPPoS interface by checking against a linked list of existing
PPPoS interfaces.
2015-02-18 23:14:30 +01:00
Sylvain Rochet
9f93c16bbf
PPP, CORE, beautified auth protocols debug
2015-02-18 23:14:29 +01:00
Sylvain Rochet
892e75ca92
PPP, CORE, removed useless include of chap-new.h
2015-02-18 23:14:29 +01:00
Sylvain Rochet
5e73068e09
PPP, CORE, Removed (*datainput) from struct protent if not used
...
Data input is only used by CCP and ECP, which are not supported at this time,
remove this entry from struct protent to save some flash.
2015-02-18 23:14:29 +01:00
Sylvain Rochet
b71d9ce3f6
PPP, CORE, Removed useless enabled_flag from struct protent
...
Our struct protent are const everywhere to save RAM, enable/disable
flag on a const struct is useless, saving some flash, removed.
2015-02-18 23:14:29 +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
101f57d5e0
tcp_alloc() prefers killing CLOSING/LAST_ACK over active connections (see bug #39565 ) (tcp_kill_prio(): back to old implementation)
2015-02-18 21:30:45 +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
goldsimon
9048a7f021
fixed compiler warning in dhcp.c
2015-02-18 09:02:37 +01:00
Sylvain Rochet
1c91bb5a20
PPP, PPPoS, fixed warnings with PPPDEBUG disabled
2015-02-18 00:59:27 +01:00
Sylvain Rochet
b957a81ea5
PPP, modified CHANGELOG about the previous large PPP rework
...
Done!, this is way better than before, I had this rework in mind
for a couple of years and I finally found the time to do it :-)
2015-02-17 23:25:10 +01:00
Sylvain Rochet
19fdeae4ba
PPP, chained returns up to ppp_free()
...
ppp_free() now returns lower level protocol return value if something failed.
2015-02-17 23:22:15 +01:00
Sylvain Rochet
50ecd2c12c
PPP, CORE, removed useless st variable in ppp_close()
...
Code cleaning.
2015-02-17 23:22:15 +01:00
Sylvain Rochet
07f9212799
PPP, chained returns up to ppp_open()
...
ppp_open() now returns lower level protocol return value if something failed.
2015-02-17 23:22:15 +01:00
Sylvain Rochet
8a8cba75a2
PPP, lower protocols, chained returns from local functions to callback caller
...
PPPoS,PPPoE,PPPoL2TP functions using non-void returns are now propagated
to callback caller (PPP core).
2015-02-17 23:22:15 +01:00
Sylvain Rochet
1ae3808e13
PPP, CORE, prepared for lower protocols callbacks returning state
...
Until now, callbacks used void return, preparing callbacks to return
PPPERR_ status.
2015-02-17 23:22:14 +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
5b29f1cdec
PPP, CORE, Fixed warning with PPP_PROTOCOLNAME enabled
...
lwip/src/netif/ppp/ppp.c: In function ‘ppp_input’:
lwip/src/netif/ppp/ppp.c:769:5: warning: ISO C90 forbids mixed declarations and code [-Wpedantic]
const char *pname = protocol_name(protocol);
^
2015-02-17 23:22:14 +01:00
Sylvain Rochet
bce29ac353
PPP, CORE, code cleaning
...
Reordered functions in the order they are declared in headers.
Removed useless ppp_link_down() function.
Merged ppp_stop() and ppp_close().
Merged ppp_hup() and ppp_sighup().
2015-02-17 23:22:14 +01:00
Sylvain Rochet
f7584fa883
PPP, CORE, fixed callbacks return value
...
Fixed return value in case of abnormal termination.
Set pcb->err_code in case of failed setup link.
2015-02-17 23:22:14 +01:00
Sylvain Rochet
18074ff98f
PPP, PPPoE, improved removal from linked list
...
Replaced naive link list removal code to a more clever one.
2015-02-17 23:22:14 +01:00
Sylvain Rochet
4ad60b477c
PPP, PPPoS, structure size optimisation
...
Reordered PPPoS structure so there is no alignment hole for 32 and 64 bits
systems. Reduced types which were too large.
2015-02-17 23:22:14 +01:00
Sylvain Rochet
69469496e2
PPP, PPPoS, moved out_accm from PPP core to PPPoS
...
Last PPPoS variable in PPP core moved to PPPoS.
2015-02-17 23:22:14 +01:00
Sylvain Rochet
baaa2592a6
PPP, PPPoS, removed xmit_accm, almost duplicate of out_accm
...
xmit_accm was meant to be a user configurable asyncmap, it was actually
broken since the introduction of ppp_new by the way we now reset the PPP
initial state, looks like no one until now is needing it anymore. If
necessary we will reintroduce this feature later properly instead of a
dirty and ugly hack into the PPP code.
2015-02-17 23:22:14 +01:00
Sylvain Rochet
ecb8aa6fc1
PPP, PPPoS, merged ppp(os)_pcb_rx to pppos_pcb
...
Merged ppp(os)_pcb_rx to pppos_pcb, saved 8 bytes of pointers
and unecessary init steps.
2015-02-17 23:22:14 +01:00
Sylvain Rochet
34210901bf
PPP, PPPoS, moved ppp.rx to pppos.rx
...
PPP rx control block moved to PPPoS
2015-02-17 23:22:14 +01:00
Sylvain Rochet
7132893863
PPP, PPPoS, re-enabled PPPCTLG_FD
...
Found a fine way to get PPP fd without making this call crash for for PPPoE
or PPPoL2TP.
2015-02-17 23:22:14 +01:00
Sylvain Rochet
cfe04d4453
PPP, PPPoS, using PPPoS PCB pointer on VJ and pppos_ configuration functions
...
Slightly more consistent this way, and prevent using link_ctx_cb pointer
from PPPoS protocol file.
2015-02-17 23:22:14 +01:00
Sylvain Rochet
f98f2890f3
PPP, PPPoS, check if PPPoS configuration functions are used on PPPoS
...
We don't have callbacks which can be set or cleared for PPPoS
configuration, there is too much callbacks to create and PPPoS must be
kept light, therefore PPPoS functions can be called when PPP core
configure a PPPoE or PPPoL2TP interface, this is very unlikely to
happens because protocols not supported by PPPoE or PPPoL2TP are
disabled at LCP/IPCP negotiation but being safe is still better.
Check if passed PPP pointer to PPPoS configuration functions is a PPPoS
interface by using a linked list of exiting PPPoS interfaces.
2015-02-17 23:22:14 +01:00
Sylvain Rochet
d93c21349f
PPP, PPPoS, fixed build with PPP_FCS_TABLE=1
...
Oops, I managed to break builds with PPP_FCS_TABLE=1, fixed.
2015-02-17 23:22:14 +01:00
Sylvain Rochet
9358dbbd99
PPP, PPPoS, various static and const added
...
ppp_get_fcs() is now static, const modifier added on ppp_accm_mask
2015-02-17 23:22:13 +01:00
Sylvain Rochet
2b9d304816
PPP, PPPoS, renamed *sc pointer to *pppos, renamed *pcb pointers to *pppos and *ppp
...
It was a bit confusing and error prone having *pcb pointers for both
ppp_pcb* and pppos_pcb*, fixed confusion with a strict naming for both.
2015-02-17 23:22:13 +01:00
Sylvain Rochet
e6465a6f44
PPP, PPPoS, moved VJ from PPP core to PPPoS
...
VJ is only available for PPPoS, moved VJ from PPP CORE to PPPoS.
2015-02-17 23:22:13 +01:00
Sylvain Rochet
4aa9244b92
PPP, PPPoS moved fd from ppp_pcb to pppos_pcb
...
Moved fd from ppp_pcb to pppos_pcb.
However PPP ioctl PPPCTLG_FD is temporarily disabled until I found a
better solution.
2015-02-17 23:22:13 +01:00
Sylvain Rochet
1ac4d1b793
PPP, PPPoS needs vj.h
2015-02-17 23:22:13 +01:00
Sylvain Rochet
ea205f2fcd
PPP, add PPPoS CB for PPPoS private data
...
Created a new PPPoS CB going to have PPPoS private data, so allocating a
PPPoE or a PPPoL2TP interface does not allocate as well PPPoS variables.
2015-02-17 23:22:13 +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
09b4485870
PPP, generalized callbacks calls from PPP core, removed all PPPoE and PPPoL2TP references
...
Almost there, removed all PPPoE and PPPoL2TP references from PPP core,
using the generic callbacks interface everywhere.
2015-02-17 23:22:13 +01:00
Sylvain Rochet
19282d6d6c
PPP, moved low level protocol connect init to low level protocol files
...
Low level protocol init machine state does not belong to PPP core,
moved those init to respective low level protocol files.
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
0afc34f6fc
PPP, moved ppp_write and ppp_netif_output low level protocols functions to respective low level protocol files
...
Moved ppp_write_over_ethernet() and ppp_netif_output_over_ethernet() to pppoe.c
Moved ppp_write_over_l2tp() and ppp_netif_output_over_l2tp() to pppol2tp.c
2015-02-17 23:22:13 +01:00
Sylvain Rochet
45bfccfddc
PPP, prepare new callbacks for low level protocols
...
New callbacks: write and netif_output
2015-02-17 23:22:13 +01:00
Sylvain Rochet
f8501478f6
PPP: prepared callbacks from PPP core to low level protocols
...
New PPP callback from PPP core to low level protocols, first
step about removing named calls to low level protocols from PPP core.
2015-02-17 23:22:13 +01:00
Sylvain Rochet
a5582e0960
PPP: re-order functions in the common sense API order
...
Re-order ppp.[ch] functions in the order functions should be called from
user application. Moved create functions, which actually return a PPP
control block before functions needing a PPP control block.
2015-02-17 23:22:13 +01:00
Sylvain Rochet
b4fe72c4a2
PPP: removed duplicated code in ppp_close()
...
Looks like previous refactoring and cleaning made ppp_close()
consistent for all our low level protocol backends, cleaned
up duplicated code.
2015-02-17 23:22:13 +01:00
Sylvain Rochet
48f7678771
PPP: re-order prototypes, ppp_init before ppp_new
...
Cosmetic only.
2015-02-17 23:22:13 +01:00
Sylvain Rochet
808098413c
PPP: removed PPPoE and PPPoL2TP callback status notifier
...
Added necessary PPP core functions for PPPoE and PPPoL2TP status
notificaton (ppp_link_failed and ppp_link_end), removed callback,
low level protocol are now calling PPP core "link" functions.
2015-02-17 23:22:12 +01:00
Sylvain Rochet
74fd2dc9ad
PPP: moved ppp_new() to low level protocol init for PPPoE and PPPoL2TP
...
First step of a rework of how low level protocols are using the
PPP core. Low level protocols are now going to use the core instead
of core using the low level protocols.
Final goal: separate PPP core code from low level protocols.
2015-02-17 23:22:12 +01:00
Sylvain Rochet
443b2551c7
PPP: moved duplicated init code from ppp_over_X_create() to ppp_new()
...
Some init code were duplicated for all low-level PPP protocols, moved
uselessly duplicated code to ppp_new().
2015-02-17 23:22:12 +01:00
Sylvain Rochet
7b681bc94a
PPP: re-order functions in the common sense API order
...
Re-order ppp.[ch] functions in the order functions should be called from
user application. Moved create functions, which actually return a PPP
control block before functions needing a PPP control block.
2015-02-17 23:22:12 +01:00
Sylvain Rochet
bd29f7168c
PPP: ppp_init() is not a public function, moving it in private part
...
ppp_init() is not a public fonction anymore, move this function
in ppp.c "private" functions.
2015-02-17 23:22:12 +01:00
Sylvain Rochet
c8c0dc2f53
PPP: using a macro for ppp_set_default() instead of a function
...
This function is only calling netif_set_default(), a macro
is adequate.
2015-02-17 23:22:12 +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
90db821036
patch #8361 "Add support for NTP option in DHCP" (slighly modified)
2015-02-16 21:23:06 +01:00
Sylvain Rochet
99d1fdd270
snmp: syntax error fix on endif comment
...
*/ omitted on comment, added.
2015-02-14 19:38:35 +01:00
Sylvain Rochet
10ab72855d
opt: fix build without SNMP_COMMUNITY_EXT
...
define value omitted on #define SNMP_COMMUNITY_EXT in opt.h, default is 0
2015-02-14 19:38:29 +01:00
sg
0d18516af8
added support for write-access community and dedicated community for sending traps
2015-02-14 15:44:32 +01:00
sg
e22c815444
patch by Freddie Chopin: SNMP: const-correctness around snmp traps and enterprise
2015-02-14 15:11:44 +01:00
sg
e579e98469
minor coding style fix: tab -> spaces
2015-02-14 15:05:12 +01:00
sg
723eaa1f40
Fixed compiler warning in snmp.h introduced by last patches
2015-02-14 15:04:55 +01:00
Freddie Chopin
4ebeeaf1e0
msg_in.c, msg_in.c: add snmp_get_community() and snmp_set_community() accessors
...
Signed-off-by: Freddie Chopin <freddie.chopin@gmail.com >
2015-02-14 14:49:42 +01:00
Freddie Chopin
2c9ceea3cf
msg_in.c, snmp_msg.h: convert snmp_community to a modifiable pointer
...
Signed-off-by: Freddie Chopin <freddie.chopin@gmail.com >
2015-02-14 14:49:41 +01:00
Freddie Chopin
c289872ab7
msg_in.c, msg_out.c, snmp_msg.h: rename snmp_publiccommunity to snmp_community, update descriptions
...
Signed-off-by: Freddie Chopin <freddie.chopin@gmail.com >
2015-02-14 14:49:39 +01:00
Freddie Chopin
9469bdc93e
msg_in.c, snmp_msg.h: don't hardcode size of community string
...
Signed-off-by: Freddie Chopin <freddie.chopin@gmail.com >
2015-02-14 14:47:55 +01:00
Freddie Chopin
9b4564d7f3
snmp_trap_header_sum(): use strlen() to get the length of community string
...
Signed-off-by: Freddie Chopin <freddie.chopin@gmail.com >
2015-02-14 14:46:51 +01:00
sg
b5b5844119
added hook LWIP_HOOK_MEMP_AVAILABLE() to get informed when a memp pool was empty and an item is now available
2015-02-13 21:53:55 +01:00
sg
6ef7563f53
Added the option PBUF_LINK_ENCAPSULATION_HLEN to allocate additional header space for TX on netifs requiring additional headers
2015-02-13 21:42:04 +01:00
sg
e3e3200f95
fixed bug #22070 "MIB_OBJECT_WRITE_ONLY not implemented in SNMP"
2015-02-13 21:12:23 +01:00
sg
7a0f814043
introduce sys_timeouts_sleeptime (returns the time left before the next timeout is due, for NO_SYS==1)
2015-02-12 22:14:28 +01:00
sg
80b62df0a9
fixed bug #36403 "ip4_input() and ip6_input() always pass inp to higher layers": now the accepting netif is passed up, but the input netif is available through ip_current_input_netif() if required.
2015-02-12 22:04:10 +01:00
chrysn
81d4e201bb
include the memp struct list once before actually using it
...
when custom lwipopts.h files are used (MEMP_USE_CUSTOM_POOLS), there is
typically the need to use sizeof(some_struct) in there, but on structs
that are not already declared in lwip; thus, they use #include on custom
headers.
even if the included files have proper include guards, the way memp
headers are used (
typedef enum {
#define LWIP_MEMPOOL(name,num,size,desc) MEMP_##name,
#include "lwip/memp_std.h"
MEMP_MAX
} memp_t;
) breaks when fresh includes are involved. in this patch, this gets
circumvented by including lwip/memp_std.h once with an empty
LWIP_MEMPOOL definition, so that all the includes from custom
lwippools.h files can be handled safely.
2015-02-11 23:10:15 +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
7d8657287e
patch #8362 Add defines for well known ethernet packet types
2015-02-11 21:59:48 +01:00
sg
f7905582db
More tiny code cleanups...
2015-02-11 21:53:12 +01:00
Fred Baksik
f12e6837be
LWIP_PLATFORM_DIAG: check if LWIP_PLATFORM_DIAG is defined as needed.
...
-- LWIP_STATS and LWIP_DEBUG require this macro
2015-02-11 21:44:43 +01:00
Fred Baksik
3870031c6e
LWIP_ASSERT: check for LWIP_PLATFORM_ASSERT if LWIP_NOASSERT is not defined.
...
-- add comment about usage of LWIP_NOASSERT
2015-02-11 21:43:40 +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
974a853f40
patch #8423 "arch/perf.h" should be made an optional item
2015-02-11 21:25:47 +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
04b4971d8c
Added comment that sys_thread_new must not fail (ports have to assert this!)
2015-02-11 21:12:49 +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
ee833ea594
changed comment in struct linger
2015-02-10 21:40:27 +01:00
goldsimon
338feef70e
memp: also export memp_sizes[] if MEMP_USE_CUSTOM_POOLS==1
2015-02-10 15:18:14 +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
goldsimon
e926a93568
tcp_kill_prio(): prefer nearly-closed connections (waiting for the last ACK only) over established connections when out of tcp pcbs
2015-01-20 12:45:26 +01:00
sg
28476e3b7b
Fixed bug #38315 tcp_eff_send_mss_impl() always subtract the difference in IPv6 header size
2015-01-18 14:08:11 +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
48934414b2
patch #8479 Fixed a visibility scope that caused a compile error in some configurations (by Constantine <nongnusucks>)
2015-01-17 14:55:32 +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
69ee35c909
tcp_close_shutdown: remove invalid comment on linger: we cannot support linger for the raw API since linger implies blocking
2015-01-17 14:36:39 +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
goldsimon
1cbd2121e2
Allow to overrid the check for p->ref==1 in TX packets (there *are* netif drivers that can handle this)
2015-01-16 17:58:07 +01:00
goldsimon
c0d9e3231b
Merge branch 'master' of git.sv.gnu.org:/srv/git/lwip
2015-01-16 17:38:20 +01:00
goldsimon
2775fb5a45
fixed bug #20506 "Initial congestion window is very small" again by implementing the calculation formula from RFC3390
2015-01-16 17:38:07 +01:00
Sylvain Rochet
6ca8bc4037
inet_checksum: fixed prototype of lwip_standard_chksum() when LWIP_CHKSUM_ALGORITHM == 1
2015-01-10 13:59:55 +01:00
Sylvain Rochet
5dd6b1effc
PPP, updated pppd followup
2014-12-24 23:23:36 +01:00
Sylvain Rochet
369e9fbf08
PPP, from PPPD upstream, Eliminate some unnecessary ifdefs
2014-12-24 23:12:30 +01:00
Sylvain Rochet
e39d012312
PPP, from PPPD upstream, separate IPv6 handling for sifup/sifdown
...
The current code is buggy regarding handling of link state when using
both IPCP and IPv6CP: if IPv6CP has been set up and if during IPCP
negociation, ipcp_up() fails, it will incorrectly take the interface
down. The simple solution here is to change the platform code to do the
same as on Solaris: separate IPv6CP up/down state handling with sif6up()
and sif6down(), so that we really know when the interface is allowed to
go down.
(Based from pppd commit b04d2dc6df5c6b5650fea44250d58757ee3dac4a)
2014-12-24 23:01:06 +01:00
Sylvain Rochet
7d077a2260
PPP,SLIP include lwip/sio.h after lwip/sys.h to prevent functions prototype collision
...
User port may redefine sio_* functions, we must ensure we are loading
user functions prototypes before loading default prototypes.
2014-12-24 21:23:54 +01:00
Sylvain Rochet
b30faa577d
PPP, moved ppp_init() from public API (ppp.h) to private API (ppp_impl.h)
...
ppp_init() is called by lwip_init(), users don't need to init PPP by themselves
2014-12-24 19:08:58 +01:00
Sylvain Rochet
91356d2d03
PPPAPI, added const modifier on auth strings
2014-12-24 19:05:19 +01:00
Sylvain Rochet
61f0231ce0
PPP, fixed more compiler warnings
...
Using -Wall -pedantic -Wparentheses -Wsequence-point
-Wswitch-default -Wextra -Wundef -Wshadow -Wpointer-arith
-Wbad-function-cast -Wc++-compat -Wwrite-strings -Wold-style-definition
-Wmissing-prototypes -Wredundant-decls -Wnested-externs -Wno-address
2014-12-24 18:14:10 +01:00
Sylvain Rochet
482a18e6de
PPP, added const modifier on auth strings
2014-12-24 17:17:00 +01:00
Sylvain Rochet
382ddac1a1
CORE: fixed missing prototype for pbuf_header_impl() function
...
lwip/src/core/pbuf.c:502:1: warning: no previous prototype for ‘pbuf_header_impl’ [-Wmissing-prototypes]
2014-12-24 15:18:21 +01:00
Sylvain Rochet
2b3e020152
PPP, fixed some compiler warnings
...
Using -Wall -pedantic -Wparentheses -Wsequence-point
-Wswitch-default -Wextra -Wundef -Wshadow -Wpointer-arith
-Wbad-function-cast -Wc++-compat -Wwrite-strings -Wold-style-definition
-Wmissing-prototypes -Wredundant-decls -Wnested-externs -Wno-address
2014-12-24 15:16:03 +01:00
goldsimon
01391f0234
etharp: fixed casting 'ctime' from u16_t to u8_t in local variables (introduced when fixing bug #34682 )
2014-12-22 11:21:18 +01:00
goldsimon
32c6f96000
prevent dhcp from starting when netif link is down (only when LWIP_DHCP_CHECK_LINK_UP==1, which is disabled by default for compatibility reasons)
2014-12-19 16:04:48 +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
goldsimon
5d74d97fe1
TCP_OVERSIZE: make segment size allocated by TCP_OVERSIZE overridable for tests
2014-12-17 09:32:08 +01:00
goldsimon
db4844e3f0
fixed bug #43840 Checksum error for TCP_CHECKSUM_ON_COPY==1 for no-copy data with odd length
2014-12-17 09:26:17 +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
35729f0870
Merge branch 'master' of git.sv.gnu.org:/srv/git/lwip
2014-12-10 09:49:12 +01:00
goldsimon
0ff98eb2f5
mem: added an MEMP_OVERFLOW_CHECK implementation for MEM_USE_POOLS; added another unit test
2014-12-10 09:48:50 +01:00
goldsimon
dbe33783c9
stats: place 'err' in stats_mem more at the front to better see it in debugger overview window
2014-12-10 09:48:00 +01:00
sg
f38352f1af
fixed bug #43596 IGMP queries from 0.0.0.0 are discarded
2014-12-09 20:56:39 +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
ca26fd17a7
fixed bug #43778 : IPv6 header version not set on 16-bit platform (macro IP6H_VTCFL_SET())
2014-12-08 15:00:37 +01:00
goldsimon
4085a3fad4
task #11472 Support PBUF_REF for RX (IPv6 and IPv4/v6 reassembly might not work yet)
2014-12-08 14:45:36 +01:00
chrysn
36f470383b
use u32_t instead of u_int32_t
...
The style u_int32_t is not used anywhere else in the project, and is not
supported by the C standard, now using lwIP u32_t type. It was introduced
in 25e398a .
2014-11-11 16:28:27 +01:00
Sylvain Rochet
52dc9ef418
slightly improved compiler warning fixes
2014-11-07 16:26:15 +01:00
goldsimon
bada7e0f92
mem.h: fixed constants to be unsinged to fix compiler warning
2014-11-07 16:01:19 +01:00
goldsimon
ec93b03d8d
Fixed multiple smaller compiler warnings
2014-11-07 14:29:53 +01:00
goldsimon
a5e748de84
CHANGELOG: fixed date
2014-11-06 14:15:52 +01:00
goldsimon
2809405164
lwip_socket_init() is not needed any more -> compatibility define
2014-11-06 14:14:58 +01:00
goldsimon
79ecf2edb7
SNMP: added missing casts to int for printf arguments
2014-11-03 09:23:50 +01:00
Sylvain Rochet
c2ebf5544b
fixed cosmetic bug #43499 : wrong argument order in src/include/netif/etharp.h defines
2014-10-29 18:56:33 +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
sg
b89e10c3e6
fixed comment (bug #43481 MEMP_SYS_TIMEOUTS is not for NO_SYS=0 only)
2014-10-28 21:26:49 +01:00
goldsimon
5a6c64cc28
Merge branch 'master' of git.sv.gnu.org:/srv/git/lwip
2014-10-21 11:09:30 +02:00
goldsimon
aecbce283d
fixed bug #38219 Assert on TCP netconn_write with sndtimeout set
2014-10-21 11:09:07 +02:00
Sylvain Rochet
60f920df0e
fixed bug #43235 , checking for non-existent preprocessor macros is non-standard, added predefinition for all affected macros
2014-10-12 20:51:58 +02:00
Sylvain Rochet
da19974e81
fixed bug #43235 , cleared compiler warnings when using gcc with -Wextra option
2014-10-12 19:54:43 +02:00
Simon Goldschmidt
ab9feb2e35
fixed bug #43173 , pppos_input() corrupts memory if IP_FORWARD is enabled
2014-10-12 18:23:10 +02:00
goldsimon
b8d798158b
fixed bug #43389 dns_recv() res_idx calculate error
2014-10-09 10:13:50 +02:00
Simon Goldschmidt
82d7c78b0c
Reverted typo fix for vj.c which is in the original sources: no need to add a diff only because of a typo...
2014-09-18 21:25:19 +02:00
Simon Goldschmidt
0074b7becb
More of patch #8397 Typos corrected in comments and text outputs
2014-09-18 21:23:19 +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
aa6f6bc3aa
patch #8480 Fix handling of dns_seqno wraparound
2014-09-17 22:52:58 +02:00
Simon Goldschmidt
f1e023af85
init.c: LWIP_PPP_API needs NO_SYS==0
2014-09-17 21:30:41 +02:00
Simon Goldschmidt
f71a590375
tabs -> spaces in opt.h (ppp-related)
2014-09-16 21:59:07 +02:00
Simon Goldschmidt
9f48488d87
minor: fixed coding style in pppapi.h/.c
2014-09-16 21:57:52 +02:00
Simon Goldschmidt
085c1594de
fixed bug #43192 tcp_enqueue_flags() should not check TCP_SND_QUEUELEN when sending FIN
2014-09-16 20:18:25 +02:00
Simon Goldschmidt
56c6301089
dns.c: change dns_send/dns_recv to operate on pbuf, not on contiguous buffer -> dns_payload_buffer/DNS_MSG_SIZE can be removed
2014-09-16 19:33:20 +02:00
Simon Goldschmidt
e303f30d10
added pbuf_take_at() and pbuf_put_at() (in preparation for dns.c changes)
2014-09-16 19:22:46 +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
9fb46e1206
added source port randomization to make the DNS client more robust (see bug #43144 )
2014-09-15 21:50:41 +02:00
Simon Goldschmidt
8216303524
revert accidentally committed test code
2014-09-05 21:17:20 +02:00
Simon Goldschmidt
6c7357bbf9
DNS: minor coding style fix: pEntry -> entry
2014-09-05 21:15:50 +02:00
Simon Goldschmidt
13add693db
Merge branch 'master' of git.sv.gnu.org:/srv/git/lwip
2014-09-05 21:13:03 +02:00
Simon Goldschmidt
a491aa0f6a
DNS: split request callback information from actual DNS table to be able to optimize memory usage for multiple parallel requests (and clean up the code a bit)
2014-09-05 21:11:57 +02:00
goldsimon
e8f49f1b95
update CHANGELOG and fix coding style (fixed bug #39355 SNMP Memory Leak in case of error)
2014-09-03 08:10:07 +02:00
Fatih Aşıcı
0a8c53575c
snmp: Fix a memory leak
...
Check the value of vbi->ident before replacing it with vbo->ident.
2014-09-03 08:01:25 +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
1fd4b851f5
Moved #define NETDB_ELEM_SIZE from dns.h to netdb.h, where it belongs, and use sizeof() instead of hacked constants that are wrong on 64-bit platforms
2014-09-02 21:27:24 +02:00
Simon Goldschmidt
142cc8fe2a
minor: fixed a comment typo only
2014-09-02 21:26:35 +02:00
Simon Goldschmidt
5c37c63cef
fixed bug #42117 lwip_fcntl does not set errno
2014-09-02 21:08:30 +02:00
Simon Goldschmidt
39caf630a9
fixed bug #42299 tcp_abort() leaves freed pcb on tcp_bound_pcbs list
2014-09-02 20:59:00 +02:00
goldsimon
b0502d1f3b
added optional macros PACK_STRUCT_FLD_8() and PACK_STRUCT_FLD_S() to prevent gcc 4 from warning about struct members that do not need packing
2014-09-02 13:04:36 +02:00
Simon Goldschmidt
7c9b545b30
Fixed CHANGELOG to correctly show the differences to 1.4.1 (got messed up because git master was developed in parallel to the 1.4.1 branch, both starting at 1.4.0)
2014-09-01 21:35:10 +02:00
goldsimon
678dcc2ca5
Moved IPv4/IPv6 headers to common include folder, now that their names are unique -> no need to add 3 directories to the include path when compiling lwIP
2014-09-01 17:19:08 +02:00
goldsimon
54d4d9a881
Fix warning for compilers propagating ~'ed u8_t to int...
2014-09-01 15:57:56 +02:00
Simon Goldschmidt
a5e06ed5b7
fixed bug #42987 lwIP is vulnerable to DNS cache poisoning due to non-randomized TXIDs
2014-08-31 20:29:56 +02:00
Erik Ekman
63038e0305
Restore DHCP relay test packet numbers
...
These were updated in commit e1225cec5f together with other fixes
without any clear reason, and cause the test to fail.
2014-08-20 21:33:58 +02:00
goldsimon
7cea4d7df6
bug #42998 : made NETIF_MAX_HWADDR_LEN overridable for some special networks
2014-08-19 16:09:00 +02:00
goldsimon
936066aa03
tiny formatting correction
2014-08-19 14:25:57 +02:00
Simon Goldschmidt
e7f3224091
again bug #26069 : Documentation of tcp_connect() incorrectly describes handling of errors
2014-06-04 20:54:02 +02:00
Simon Goldschmidt
974f6982a1
fixed bug #37969 SYN packet dropped as short packet in tcp_input function
2014-06-03 21:07:49 +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
9148ab79f3
fixed bug #37184 tcp_write problem for pcbs in the SYN_SENT state
2014-05-20 22:12:36 +02:00
goldsimon
1204f15bfa
bug #35874 reserved identifier violation, 2nd part
2014-05-20 12:27:18 +02:00
goldsimon
f1c7e73bef
fixed last commit (copy & paste from patch broke the code)
2014-05-20 12:22:13 +02:00
Simon Goldschmidt
c18abd4fbe
Fixed bug #41686 (ipv4 ip_reass() crash error) introduced some months ago while fixing bug #41041...
2014-05-19 22:07:57 +02:00
Simon Goldschmidt
c3ac875055
Fixed typo-bug introduced some months ago while fixing bug #41041...
2014-05-19 22:03:19 +02:00
Simon Goldschmidt
dbd125c714
Fixed bug #35874 reserved identifier violation (removed leading underscores from header include guards)
2014-05-19 21:46:18 +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
33b42872e5
Merge branch 'master' into ppp-new
2014-05-08 14:25:30 +02:00
goldsimon
8bb7602145
SNMP: fix "uninitialized variable" warning
2014-05-06 09:42:41 +02:00
Sylvain Rochet
d9e2edd1df
Merge branch 'master' into ppp-new
2014-05-05 20:55:18 +02:00
Simon Goldschmidt
f9d80d5bd2
try to fix another warning from static code analysis
2014-04-30 22:11:49 +02:00
goldsimon
406874b6c2
snmp: added missing default cases (only used for trace output)
2014-04-30 13:50:18 +02:00
goldsimon
e4ddd6cb6d
Multiple fixes found by coverity scan
2014-04-30 12:22:31 +02:00
Sylvain Rochet
a7745e9a86
PPP, PPPoE, fixed bug #42138 , pppoe_destroy() called with wrong pointer, PPPoE control block was never freed
2014-04-19 23:38:24 +02:00
Sylvain Rochet
3fd7bc8058
PPP, updated pppd followup
2014-04-15 22:57:59 +02:00
Sylvain Rochet
25e398a8f0
PPP, from PPPD upstream, accept IPCP ConfAck packets containing MS-WINS options
...
pppd: Accept IPCP ConfAck packets containing MS-WINS options
Since last week I'm seeing IPCP negotiations going like this (and
eventually failing) when connecting to my ISP:
Jul 11 20:03:25 * pppd[4833]: sent [IPCP ConfReq id=0x2 <addr 0.0.0.0> <ms-dns1
0.0.0.0> <ms-dns2 0.0.0.0>]
Jul 11 20:03:26 * pppd[4833]: sent [IPCP ConfReq id=0x2 <addr 0.0.0.0> <ms-dns1
0.0.0.0> <ms-dns2 0.0.0.0>]
Jul 11 20:03:26 * pppd[4833]: rcvd [IPCP ConfNak id=0x2 <addr 10.167.246.198>
<ms-dns1 213.162.69.1> <ms-dns2 213.162.69.169> <ms-wins 124.6.168.55> <ms-wins
17.17.17.17>]
Jul 11 20:03:26 * pppd[4833]: sent [IPCP ConfReq id=0x3 <addr 10.167.246.198>
<ms-dns1 213.162.69.1> <ms-dns2 213.162.69.169> <ms-wins 124.6.168.55> <ms-wins
17.17.17.17>]
Jul 11 20:03:26 * pppd[4833]: rcvd [IPCP ConfAck id=0x3 <addr 10.167.246.198>
<ms-dns1 213.162.69.1> <ms-dns2 213.162.69.169> <ms-wins 124.6.168.55> <ms-wins
17.17.17.17>]
Jul 11 20:03:27 * pppd[4833]: sent [IPCP ConfReq id=0x3 <addr 10.167.246.198>
<ms-dns1 213.162.69.1> <ms-dns2 213.162.69.169> <ms-wins 124.6.168.55> <ms-wins
17.17.17.17>]
...
with the last two lines repeating until the IPCP error limit is
reached. As you can see, the peer added two extra fields in the
ConfNak reply. This is allowed, and indeed the following sent
ConfReq packet reflects this. However, when the ConfAck packet
is received, pppd discards it as invalid, because of the ms-wins
fields.
This fixes it.
2014-04-15 22:55:28 +02:00
Sylvain Rochet
c31b03327f
PPP, from PPPD upstream, Don't crash if NULL pointer passed to vslprintf for %q or %v
...
pppd: Don't crash if NULL pointer passed to vslprintf for %q or %v
This is to avoid crashes like that reported in
https://bugs.launchpad.net/ubuntu/+source/ppp/+bug/1244714
2014-04-15 22:50:53 +02:00
Sylvain Rochet
f6d56e2937
PPP, from PPPD upstream, take out unused %r conversion completely,
...
pppd: Take out unused %r conversion completely
This just removes some code surrounded by #if 0/#endif, which Fedora
apparently feels the need to patch...
2014-04-15 22:34:24 +02:00
Sylvain Rochet
ca7769e041
Merge branch 'master' into ppp-new
2014-04-12 01:25:00 +02:00
Sylvain Rochet
c0aef7dd6b
PPP, VJ compression enabled, fixed IP forward from PPP to Ethernet by allocating a PBUF_LINK instead of a PBUF_RAW if IP forwarding is enabled
2014-04-12 01:23:57 +02:00
Sylvain Rochet
4283ecf774
PPP, PPPoS, fixed IP forward from PPP to Ethernet by allocating PBUF_LINK instead of PBUF_RAW if IP forwarding is enabled
2014-04-11 22:31:01 +02:00
Simon Goldschmidt
88a57dc98d
Fixed bug #36167 tcp server crash when client closes (maximum window)
2014-04-08 21:26:27 +02:00
Simon Goldschmidt
035ecef8a5
Fixed bug #36210 lwIP does not elicit an empty ACK when received unacceptable ACK
2014-04-06 22:40:51 +02:00
Simon Goldschmidt
4c3b6814dc
Fixed compiling broken ip6.c after last commit
2014-04-06 22:33:27 +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
Simon Goldschmidt
be75c483d0
Fixed bug #41787 DHCP Discovery is invalid when an IP is set to thet netif (send discover, request and decline from 'any').
...
Addd functions to send udp/ipv4/ipv6 packets with source address 'any' although netif has an address assigned
2014-04-06 20:32:37 +02:00
Sylvain Rochet
08dd32d32d
PPP, most PPP headers are using u_long, u_int, u_short and u_char types, moved typedef of those types before we include any PPP header
2014-04-04 20:42:01 +02:00
Sylvain Rochet
b49584457a
Merge branch 'master' into ppp-new
2014-03-23 13:17:55 +01:00
goldsimon
40d25adb88
Added LWIP_HOOK_ETHARP_GET_GW to implement IPv4 routing with multiple gateways
2014-03-17 12:53:31 +01:00
Sylvain Rochet
a38e5a44ec
Merge branch 'master' into ppp-new
2014-03-14 20:48:12 +01:00
Simon Goldschmidt
3fceef0936
- fixed bug #36153 TCP Cheksum error if LWIP_CHECKSUM_ON_COPY=1;
...
- don't fail on small mss or snd_wnd_max
2014-03-14 19:46:24 +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
c82f04f54c
fixed bug #40303 DHCP xid renewed when sending a DHCPREQUEST
2014-02-27 22:44:16 +01:00
Simon Goldschmidt
d9d0c52770
fixed bug #41680 raw socket can not receive IPv6 packet when IP_SOF_BROADCAST_RECV==1
2014-02-27 22:18:45 +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
Simon Goldschmidt
8558fa0bcf
etharp_entry::ctime must be u16_t after changing ARP_TMR_INTERVAL from 5 seconds to 1 second when fixing bug #34682
2014-02-26 21:51:56 +01:00
Simon Goldschmidt
f36d6b7ef5
fixed bug #39514 ip_route() may return an IPv6-only interface
2014-02-25 22:37:52 +01:00
Simon Goldschmidt
e9908048ec
fixed bug #39356 Wrong increment in pbuf_memfind()
2014-02-25 22:34:27 +01:00
Simon Goldschmidt
dceed2ea5c
fixed bug #39225 udp.c uses netif_matches_ip6_addr() incorrectly; renamed function netif_matches_ip6_addr() to netif_get_ip6_addr_match()
2014-02-25 22:30:46 +01:00
Simon Goldschmidt
7b63878926
Fixed bug #39224 Unused IPv6 address state defines in nd6
2014-02-25 22:26:02 +01:00
Simon Goldschmidt
01ecd3517e
fixed bug #39145 IGMP membership report for 224.0.0.1
...
-> ensure that we never send a report for 224.0.0.1
2014-02-25 22:21:31 +01:00
Simon Goldschmidt
fbdea8dc71
fixed bug #39076 ETHARP_STATS is not defined when LWIP_STATS is 0
2014-02-25 22:14:26 +01:00
Sylvain Rochet
58d0e8b28f
Merge branch 'master' into ppp-new
2014-02-24 20:21:47 +01:00
Simon Goldschmidt
07fbe82305
fixed bug #34681 Limit ARP queue length by ARP_QUEUE_LEN (=3)
2014-02-22 21:38:56 +01:00
Simon Goldschmidt
05a967564a
fixed bug #34682 Limit ARP request flood for unresolved entry
2014-02-22 21:23:06 +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
Simon Goldschmidt
4d69d0eda5
Fixed IPv6 raw checksumming after a hint from Philip Gladstone
2014-02-21 08:41:44 +01:00
Sylvain Rochet
d7ba4bbb9b
Merge branch 'master' into ppp-new
2014-02-21 00:39:29 +01:00
Simon Goldschmidt
2225b8add7
fixed bug #39683 Assertion "seg->tcphdr not aligned" failed with MEM_ALIGNMENT = 8
2014-02-20 22:35:37 +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
c1dc1a20d6
fixed bug #40050 SNMP problem with MIB arrays > 255
2014-02-20 22:14:10 +01:00
Simon Goldschmidt
a58083b11e
Fixed comment on LWIP_HAVE_LOOPIF
2014-02-20 22:09:38 +01:00
Simon Goldschmidt
0f24fba28a
IGMP: fixed !define LWIP_RAND case
2014-02-20 22:07:58 +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
Freddie Chopin
08b56e8180
SNMP: mib-2.system.sysObjectID is read-only, so make the object "static const" and modify just the pointer; snmp_get_sysobjid_ptr() and snmp_set_sysobjid() take a pointer to "const" object now
...
Signed-off-by: Freddie Chopin <freddie.chopin@gmail.com >
2014-02-20 21:24:23 +01:00
Freddie Chopin
7a77917df6
SNMP: use MEMCPY() instead of ocstrncpy() and objectidncpy()
...
Signed-off-by: Freddie Chopin <freddie.chopin@gmail.com >
2014-02-20 21:24:21 +01:00
Erik Ekman
e432014a88
netif: Update header file documentation
...
IPv6 output method referenced old method name.
2014-02-20 21:22:39 +01:00
Simon Goldschmidt
a89db9872d
Added missing IPPROTO_RAW
2014-02-20 21:13:13 +01:00
Simon Goldschmidt
6dcc85dcf4
patch #7993 : Added support for transmitting packets with VLAN headers via hook function LWIP_HOOK_VLAN_SET and to check them via hook function LWIP_HOOK_VLAN_CHECK
2014-02-20 21:08:50 +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
Simon Goldschmidt
cffe54d094
Patch #7815 by James Smith: added inet_ntop/inet_pton
2014-02-20 16:10:55 +01:00
Simon Goldschmidt
2f02120fee
Fixed typo.
2014-02-20 15:43:51 +01:00
Simon Goldschmidt
c0b534e531
Minor fixes to init.c preprocessor checks
2014-02-12 22:20:25 +01:00
Erik Ekman
5eaef50a77
Remove newlines in LWIP_ERROR calls
2014-02-12 22:10:36 +01:00
Simon Goldschmidt
a80c4d147c
Unit test patch by Erik Ekman: use macro to store correct testcase name
2014-02-12 21:52:21 +01:00
Erik Ekman
ad66b2bf13
Don't mark arrays as const since they are modified by the test
2014-02-12 21:44:51 +01:00
Simon Goldschmidt
ef6ec9de01
Merge branch 'master' of git.sv.gnu.org:/srv/git/lwip
2014-02-12 21:34:43 +01:00
Simon Goldschmidt
751deac9d1
Another fix to window scaling: support queueing more than 64 KByte in ooseq data
2014-02-12 21:34:19 +01:00
Sylvain Rochet
406da499ff
Merge branch 'master' into ppp-new
2014-02-09 16:40:43 +01:00
Sylvain Rochet
a6b48d5273
normalize to LF (auto cleaned due to git attributes and must be commited before switching branch)
2014-02-09 16:34:47 +01:00
Simon Goldschmidt
6272b5c58c
Fixed misleading comment on sys_untimeout()
2014-02-07 14:03:53 +01:00
Simon Goldschmidt
8c9b99458d
Fixed forgotten brackets in last commit
2014-02-07 12:11:36 +01:00
Simon Goldschmidt
3273c68b63
Added comments to clarify the LWIP_TCP_TIMESTAMPS option.
2014-02-07 11:46:23 +01:00
Simon Goldschmidt
a44e2190d6
TCP window scaling: change tcp_pcb::acked to u32_t when window scaling is enabled to prevent an overflow when more than 64 Kbytes are ACKed
2014-02-07 11:32:02 +01:00
Simon Goldschmidt
2dab478c3f
Merge branch 'master' of git.sv.gnu.org:/srv/git/lwip
...
Conflicts:
src/core/tcp_out.c
src/include/ipv4/lwip/ip4_addr.h
2014-02-07 09:40:10 +01:00
Simon Goldschmidt
a32afb28c0
Added .gitattributes to normalize CRLF
2014-02-07 09:36:03 +01:00
Simon Goldschmidt
d2a89b424b
patch #6537/#7858: TCP window scaling support (OOS queueing still needs special handling)
2014-02-06 22:34:06 +01:00
Sylvain Rochet
9502cd7047
Merge branch 'master' into ppp-new
2014-01-19 14:32:14 +01:00
Sylvain Rochet
cd02450095
recently applied patches changed LF-terminated filed to mostly LF and CR+LF only where the patches changed lines
2014-01-19 14:28:17 +01:00
Sylvain Rochet
03a3412e62
Merge branch 'master' into ppp-new
2014-01-19 03:41:01 +01:00
Simon Goldschmidt
33086e6db0
patch #7920 thread-safe api dhcp calls for dhcp_infor, dhcp_renew and dhcp_release
2014-01-18 22:48:15 +01:00
Simon Goldschmidt
d7a951996b
Updated CHANGELOG
2014-01-18 22:41:52 +01:00
Stathis Voukelatos
38bfe50508
Fixed size calculation in MALLOC memory pool creation macro.
...
The LWIP_MALLOC_MEMPOOL macro needs to use the aligned size of the
memp_malloc_helper structure, since mem_alloc() uses it to calculate
the required pool element size. If LWIP_MEM_ALIGN_SIZE(x) is redefined
to align to something larger than 4, then in some cases
the current code can lead to unexpected mem_alloc() failures.
For example:
#define LWIP_MEM_ALIGN_SIZE(size) (((size) + 31) & ~31)
and the largest MALLOC pool is of size 60 bytes, e.g.:
#define LWIP_MALLOC_MEMPOOL(256, 60)
then the following call:
mem_malloc(58)
will cause an assertion.
2014-01-18 22:40:16 +01:00
Simon Goldschmidt
a70567e74f
patch #8009 by chrysn: stats_display_igmp used by ml6d
2014-01-18 22:16:09 +01:00
Simon Goldschmidt
db472c73c1
patch #8021 Add INET[6]_ADDRSTRLEN Preprocessor Definitions If Not Previously Defined
2014-01-18 22:02:32 +01:00
Grant Erickson
29824f9baa
This patch addresses the following error when compiled against clang/LLVM 3.3 with -std=c++11:
...
error: invalid suffix on literal; C++11 requires a space between literal and identifier [-Wreserved-user-defined-literal]
2014-01-18 21:44:44 +01:00
Simon Goldschmidt
32b1a9fc8a
patch #8237 by Brian Fahs: tcp_rexmit_rto fails to update pcb->unsent_oversize when necessary
2014-01-18 21:40:17 +01:00
Simon Goldschmidt
018719d9d3
patch #8027 : Completed HW checksuming for IPv4 and IPv6 ICMP's
2014-01-17 22:32:36 +01:00
Grant Erickson
8ae472821f
autoip: add autoip_remove_struct
...
Added previously-missing autoip_remove_struct as a companion to
autoip_set_struct and to parallel dhcp_{set,remove}_struct.
2014-01-17 22:19:12 +01:00
Simon Goldschmidt
26911ff21c
patch #8160 (by Valery Ushakov): Simplify ip6_addr_set_solicitednode() and ip6_addr_cmp_solicitednode().
2014-01-17 22:05:54 +01:00
Simon Goldschmidt
5070cc07be
Fixed LWIP_IPV6==0
2014-01-17 21:57:40 +01:00
Simon Goldschmidt
1e65eb4936
Added IPv6 loopback address to loopback-netif, fixed last commit
2014-01-17 21:55:46 +01:00
Jay Logue
13e40f754c
Enable support for IPv6 loopback
...
Packets are sent through the loopback path when they are addressed to any
of the valid local IPv6 addresses.
2014-01-17 21:32:24 +01:00
Sylvain Rochet
87cfd930e4
Merge branch 'master' into ppp-new
2014-01-17 00:48:55 +01:00
Simon Goldschmidt
8b63a89267
patch #7912 by Grant Erickson: Add a macro for introspecting the IPv6 loopback address.
2014-01-16 21:50:53 +01:00
Simon Goldschmidt
94eff945b4
Updated CHANGELOG
2014-01-16 21:42:10 +01:00
Stathis Voukelatos
039737ffc2
Fixed netif_poll() operation when LWIP_LOOPBACK_MAX_PBUFS > 0.
...
Using the pbuf_clen() function to calculate the number of pbufs
for the first packet in the queue is not correct here, as pbuf_clen()
will return the total number of pbufs in the loopback I/F queue.
2014-01-16 21:36:49 +01:00
Simon Goldschmidt
08370c7230
Patch #7904 by Grant Erickson: Add mnemonics for IPPROTO_{ICMP,ICMPV6}
2014-01-16 21:28:38 +01:00
Simon Goldschmidt
2f9b28c0fc
Updated CHANGELOG
2014-01-14 21:53:40 +01:00
Freddie Chopin
4e1320d480
SNMP: mib-2.system.sysDescr is read-only, so add const qualifiers to functions and pointers
...
Signed-off-by: Freddie Chopin <freddie.chopin@gmail.com >
2014-01-14 21:51:39 +01:00
Freddie Chopin
e6202cfa97
SNMP: source of ocstrncpy() and objectidncpy() may be const
...
Signed-off-by: Freddie Chopin <freddie.chopin@gmail.com >
2014-01-14 21:51:29 +01:00
Simon Goldschmidt
a15b28a24e
SNMP: fixed typo: snmp_set_sysdesr -> snmp_set_sysdescr
2014-01-14 21:49:33 +01:00
Simon Goldschmidt
9975dbeded
Fixed chrysn's patch: it only works for NO_SYS :-(
2014-01-14 21:48:58 +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
Simon Goldschmidt
51012d07cc
updated CHANGELOG
2014-01-14 21:27:40 +01:00
chrysn
252abbeb8d
make timeouts usable reliably from outside of the timeout routine
...
although timeouts are relative to timeouts_last_time (transitively by
addition to the time values of their predecessors, if there are any),
sys_timeout does not compensate for that; as a result, timeouts fire too
early unless invoked from within a timeout handler (when
timeouts_last_time == now).
2014-01-14 21:25:03 +01:00
Sylvain Rochet
357b28f675
PPP, fixed VJ compression/decompression output IP path
2014-01-14 18:20:18 +01:00
Sylvain Rochet
bf37afd7c7
Merge branch 'master' into ppp-new
2014-01-12 15:05:37 +01:00
Simon Goldschmidt
f311045320
Added an assert that should trigger bug #41009 (IPv6 reassembly broken on 64-bit platforms)
2014-01-10 22:08:01 +01:00
Simon Goldschmidt
381a7b110a
fixed bug #41041 Potential use-after-free in IPv6 reassembly
2014-01-10 21:47:42 +01:00
Simon Goldschmidt
75f2c56558
bug #41188 Alignment error in memp_init() when MEMP_SEPARATE_POOLS==1
2014-01-10 21:26:28 +01:00
Simon Goldschmidt
91333c5d2f
fixed bug #39898 tcp_fasttmr() possible lock due to infinte queue process loop
2014-01-10 21:21:54 +01:00
Sylvain Rochet
ee2ba4e52f
Merge branch 'master' into ppp-new
2013-07-20 21:04:49 +02:00
Simon Goldschmidt
ae300c98a4
partially fixed bug #37585 : IPv6 compatibility (in socket structs)
2013-06-29 21:47:22 +02:00
Simon Goldschmidt
748b70311e
bug #37585/task #12600 : fixed struct in6_addr.s6_addr to conform to spec
2013-06-29 21:16:59 +02:00
Simon Goldschmidt
8d0664186a
- removed include instead of commenting it out;
...
- CHANGELOG should contain worthy entries only, a complete log of all source code changes can be found in git (I'm not saying this has always been observed, but I'd like to keep the list of changes as short as possible for anyone to read if interested)
2013-06-19 22:26:29 +02:00
Simon Goldschmidt
2fb5a71efd
patch #8030 : fixed spelling of "received"
2013-06-19 22:23:05 +02: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
2ceae6014e
PPP, reduced by one buffer PPPoS RX requirements in multithreaded context
...
Removed one unecessary allocated PBUF per PPPoS RX packet if PPP_INPROC_MULTITHREADED is set by adding the necessary data for
pppos_input_callback() in front of the first pbuf instead of allocating a new buffer.
2013-04-26 23:24:08 +02:00
Sylvain Rochet
cf3162cff1
PPP, moved PPP_INPROC_MULTITHREADED compile time option from ppp.h to opt.h
2013-04-26 21:55:30 +02:00
Sylvain Rochet
2350d941a5
PPP, added PPP_USE_PBUF_RAM compile time option
...
pbuf_type PPP is using for LCP, PAP, CHAP, EAP, IPCP and IP6CP packets.
Memory allocated must be single buffered for PPP to works, it requires pbuf
that are not going to be chained when allocated. This requires setting
PBUF_POOL_BUFSIZE to at least 512 bytes, which is quite huge for small systems.
Setting PPP_USE_PBUF_RAM to 1 makes PPP use memory from heap where continuous
buffers are required, allowing you to use a smaller PBUF_POOL_BUFSIZE.
2013-04-26 21:51:15 +02:00
Sylvain Rochet
25f9f55878
PPP, removed PPP_INPROC_OWNTHREAD feature, which almost only make things harder
...
I consider to remove the PPP_INPROC_OWNTHREAD crap in ppp-new,
as said in bugs #37278 and #37353 .
1. It requires the ppp_input_thread() function to be modified to match
user system, like some did by adding the vTaskDelete(NULL); FreeRTOS
call at the end of the function, for example.
This is a tiny-tiny fonction that should be, in my opinion, on the user
port, like the Ethernet input thread we see in many Ethernet port.
2. It is actually not that thread safe.
2.1. pcb->phase IS modified by the lwIP core thread so it should at
least be set to volatile, otherwise the pcb->phase copy may live
indefinitely in CPU register. It works because of the sio_read()
function call which without doubt flush pcb->phase copy from CPU
register. I dont want to set ppp_pcb struct to volatile for obvious
performance reasons.
2.2. This function assume PCB still exists whatever is happening, which
is not the case after you called ppp_delete() function outside of this
thread. If sio_read() is blocking waiting data and pcb destroyed, it is
going to read a deallocated pcb which luckily should still have
pcb->phase set to 0 (=PHASE_DEAD) due to preallocated "control block"
structures of lwIP. Even with sio_read_abort(), there might be timings
issue due to a lack of a synchronization mechanism.
3. I dislike the sys_msleep(1), it means that systems should have at
least a 11 chr buffer at 115200/10 byte/s, and bigger with higher serial
speed, for example with 3G/HSDPA modems accessed through SPI, at 20
Mbits/s this is a ~2000 bytes buffer required to keep incoming data
during this sleep, I don't see why we require systems to do so,
sio_read() should obviously be a blocking call. I cannot easily
remove this sleep because some systems might have wrongfully used this
call as a CPU idle feature with a non blocking sio_read() call.
2013-04-26 20:30:01 +02:00
Sylvain Rochet
07540f3386
Merge branch 'master' into ppp-new
2013-04-26 20:01:18 +02:00
Sylvain Rochet
fe63f36656
picked up the wrong commit date in CHANGELOG, fixed
2013-04-26 19:59:05 +02:00
Sylvain Rochet
434daf87c2
Merge branch 'master' into ppp-new
2013-04-26 19:54:01 +02:00
Sylvain Rochet
c681e5e082
reverted dhcp.c from DOS (CRLF) to UNIX (LF) format
2013-04-26 19:52:42 +02:00
Sylvain Rochet
549f97b54a
cleared compilation warning, C++ style comments are not allowed in ISO C90
2013-04-26 19:48:57 +02:00
Sylvain Rochet
f47a93b0c1
PPP, cleared compilation warning about unused variable 'pcb' in ppp_drop() if neither VJ nor SNMP support are enabled
2013-04-26 14:02:30 +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
Simon Goldschmidt
252126cf76
fixed possible division by zero
2013-04-24 22:20:12 +02:00
Simon Goldschmidt
8609d1e790
fixed bug #38526 Coverity: Recursive Header Inclusion in ip6.h
2013-04-24 21:58:57 +02:00
Simon Goldschmidt
9809f1ff66
Fixed bug #38586
2013-04-24 21:38:01 +02:00
Simon Goldschmidt
796098e4c9
fixed bug #38701 (wrong comment on tcp_pcb::snd_queuelen
2013-04-24 21:28:56 +02:00
Simon Goldschmidt
eb6bcdb3ee
Removed the demand to post trivial patches to lwip-users, things keep getting lost there.
2013-04-24 20:55:45 +02:00
Sylvain Rochet
a1555e0615
PPP, added ppp_free()
...
Free the control block, clean everything except the PPP PCB itself
and the netif, it allows you to change the underlying PPP protocol
(eg. from PPPoE to PPPoS to switch from DSL to GPRS) without losing
your PPP and netif handlers.
2013-04-23 00:19:07 +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
bd3ade31fa
PPP, added define for u_long, u_int, u_short, u_char for compilers or toolchains which don't have them
2013-04-22 21:16:02 +02:00
Sylvain Rochet
d03d2e6d3d
PPP, added ppp_addrs() macro to get the pointer of the ppp->addrs struct
2013-04-22 21:09:28 +02:00
Sylvain Rochet
58ffa8d526
PPP, free input pbuf left in ppp_delete()
2013-02-27 22:29:22 +01:00
Sylvain Rochet
bfe8c15a29
PPP, fixed return code coherency for ppp_netif_output_*() callbacks (using ERR_* as expected by lwIP core instead of PPPERR_*)
2013-02-22 11:52:44 +01:00
Sylvain Rochet
2fa7e003b1
PPP, fixed LCP delayed up feature
...
LCP is stealing a bit from fsm->flags struct member for LCP delayed up feature.
Bit stealed used to be the 9th bit (0x100) but fsm->flags was reduced to u8_t to save memory,
we are now stealing the 8th bit (0x80).
2013-01-31 15:36:30 +01:00
Sylvain Rochet
ba948669cd
Merge branch 'master' into ppp-new
2013-01-29 10:59:39 +01:00
goldsimon
666e84eef2
Improved/fixed comments about timeout.
2013-01-24 09:02:19 +01:00
Sylvain Rochet
69b15c889d
Merge branch 'master' into ppp-new
2013-01-20 02:57:57 +01:00
Simon Goldschmidt
ff3bf6d7f5
fixed bug #37665 ip_canforward operates on address in wrong byte order
2013-01-15 21:10:32 +01:00
Simon Goldschmidt
b844129649
fixed bug #38097 pbuf_free_ooseq() warning
2013-01-15 21:07:01 +01:00
Simon Goldschmidt
86059bd5dd
fixed more unused variables
2013-01-14 21:06:13 +01:00
Simon Goldschmidt
9927d991ef
Fixed bug #37893 Unused variables in tcp_out (and in udp.c/.h)
2013-01-14 20:46:41 +01:00
Simon Goldschmidt
6849b7d555
Added additional sanity check that all headers (without IP- or TCP options) fit into the first pbuf.
2013-01-14 18:05:18 +01:00
Simon Goldschmidt
1efd1ee6ac
fixed bug #37705 Possible memory corruption in DNS query
2013-01-14 18:04:04 +01:00
Simon Goldschmidt
d12600fba0
fixed bug #37705 Possible memory corruption in DNS query
2013-01-14 18:03:23 +01:00
Simon Goldschmidt
769b2a3e30
fixed bug #38066 Raw pcbs can alter packet without eating it: added assertion to check that p->payload is unchanged
2013-01-11 21:59:26 +01:00
Simon Goldschmidt
d237ec7e78
Changed C++ comments to C style
2013-01-11 21:27:45 +01:00
Sylvain Rochet
de1375201f
PPP, "try" variable used in LCP might conflict with some buggy C++ compiler
2013-01-04 23:08:11 +01:00
Sylvain Rochet
13ba8810c7
PPP, fixed one more IAR warnings
2013-01-04 22:51:13 +01:00
Sylvain Rochet
bdfbac2aa6
PPP, added missing semicolon (dammit)
2012-12-23 22:58:52 +01:00
Sylvain Rochet
6bd0bd2ed1
Merge branch 'master' into ppp-new
2012-12-23 22:56:51 +01:00
Sylvain Rochet
211a889528
PPP, fixed some IAR warnings
...
these are the compiler warnings I get with the head of ppp-new. All
of them are trivial, [...] (I'm using IAR EWARM 6.4).
ppp.c
Warning[Pe550]: variable "c" was set but never used
lwip\src\netif\ppp\ppp.c 1012
Warning[Pe111]: statement is unreachable
lwip\src\netif\ppp\ppp.c 1132
Warning[Pe111]: statement is unreachable
lwip\src\netif\ppp\ppp.c 1377
Warning[Pe111]: statement is unreachable
lwip\src\netif\ppp\ppp.c 1412
utils.c
Warning[Pe186]: pointless comparison of unsigned integer with zero
lwip\src\netif\ppp\utils.c 210
2012-12-23 22:52:58 +01:00
Ivan Delamer
3bb29bf63a
Fix bug #37959 : ip6_debug_print prints plen, nexth, hoplim in wrong
...
byte order
2012-12-19 16:38:44 -07:00
Sylvain Rochet
78d52ad2de
Merge branch 'master' into ppp-new
2012-12-19 14:05:59 +01:00
"Grant Erickson"
4fe648415f
Fixed typo in debug formatting in ip6.c
2012-12-14 16:08:24 -07:00
Sylvain Rochet
6751ac4970
PPP, moved FSM configuration to ppp_settings struct
2012-12-09 22:25:28 +01:00
Sylvain Rochet
6764957d06
PPP, moved EAP configuration to ppp_settings struct
2012-12-09 21:45:14 +01:00
Sylvain Rochet
c719ba7bf3
PPP, moved PAP configuration to ppp_settings struct
2012-12-09 21:22:19 +01:00
Sylvain Rochet
31d7293b17
PPP, moved EAP timeouts and max requests default values to opt.h
2012-12-09 20:40:41 +01:00
Sylvain Rochet
defef2222a
PPP, improved PAP and CHAP timeout/request/maxrequests configuration values
2012-12-09 20:24:22 +01:00
Sylvain Rochet
63459f65fb
PPP, moved DEFLOOPBACKFAIL from ppp/lcp.h to lwip/opt.h
2012-12-09 19:28:53 +01:00
Sylvain Rochet
c68e1ceb64
PPP, using timeouts values defined in opt.h instead of values defined in PPP headers or statically assigned values
2012-12-09 18:42:06 +01:00
Sylvain Rochet
07e72d2ac8
PPP, correctly cast int to u8_t in PPPCTLS_ERRCODE in ppp_ioctl()
2012-11-08 14:39:30 +01:00
Sylvain Rochet
7f97e354b4
PPP, switched chap_digests linked list to a const table in .rodata/flash, saving about 100 bytes in .data segment if chap(md5) and mschap is enabled
2012-10-14 02:04:36 +02:00
Sylvain Rochet
e5a554f0b5
PPP, adding const pragma to FSM callbacks, saving about 350 bytes in .data segment
2012-10-13 18:54:25 +02:00
Sylvain Rochet
9e4aa79278
PPP, adding const pragma to struct protent, saving about 200 bytes in .data segment
2012-10-13 18:38:18 +02:00
Sylvain Rochet
a0298728df
PPP, disable persist mode by default, so the default behavior does not look like a buggy behavior. Fixes bug #37279 .
2012-10-12 20:32:05 +02:00
Mark Lakata
0eb83f6ee6
PPP, IAR EWARM won't compile ppp-new due to keyword clash
...
The word "class" is reserved in IAR's EWARM compiler since it looks like c++.
This causes a failure to compile in the lcp code.
Arguably it is a bug in the compiler, but it is easy to work around with a
name change in the lcp.[ch] code. I fixed it by changing "class" to "class_".
2012-10-12 20:17:40 +02:00
Sylvain Rochet
e81f092520
PPP, changed all the code enclosed between PPP_SERVER #if macro to our PPP PCB structure, making it easier to support PPP server in the future
2012-09-27 23:53:20 +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
goldsimon
99aea7eb6f
Added brackets, completed CHANGELOG
2012-09-26 21:30:01 +02:00
Henrik Persson
b4ac36337f
Fix corner case with dhcp timeouts
...
If t1 >= t2 timeout then only t2 timer should be scheduled. This can happen
when a sub 1 minute lease is received.
2012-09-26 21:25:04 +02:00
goldsimon
7072bc3203
Added brackets, completed CHANGELOG
2012-09-26 21:21:26 +02:00
Henrik Persson
7e9f000d0b
Segfault in dhcp_parse_reply if no end marker
...
If no endmarker is present in a dhcp reply a null pointer is potentially
dereferenced.
Add fix and test case as proof of concept.
2012-09-19 22:11:56 +02:00
Sylvain Rochet
af56eebc6a
PPP, cleaned MTU,MRU variables
2012-09-01 19:44:43 +02:00
Sylvain Rochet
387c778496
PPP, added PPPoS reopen support
2012-09-01 19:29:17 +02:00
Sylvain Rochet
fbbde125d9
PPP, removed unnecessary ethif from ppp_pcb
2012-09-01 15:05:21 +02:00
Sylvain Rochet
dbaefd6126
PPP, cleaned persist and holdoff features
2012-09-01 14:43:31 +02:00
Sylvain Rochet
a1c87f7c49
PPP, improved fsm_sconfreq() allocated buffer size
2012-08-27 19:10:09 +02:00
Sylvain Rochet
045ee53468
PPP, using PBUF_POOL instead of PBUF_RAM pbufs for PPP negociation packets
...
PPP stack does not handle chained pbuf, but PPP negociation packets
are at most ~40 bytes long, so we are only checking if the payload
can fit into the allocated pbuf (p->tot_len == p->len).
2012-08-27 00:47:21 +02:00
Sylvain Rochet
b84ab718b0
PPP, ppp_input() code cleaning, removed dead code, fixed indentation
2012-08-25 20:38:54 +02:00
Sylvain Rochet
6144deb6b6
PPP, moved out PPPoS code into their own functions, improved ppp.c readability
2012-08-25 20:30:14 +02:00
Sylvain Rochet
19864a4a08
PPP L2TP, only skip HDLC header if necessary
...
RFC 2661 does not specify whether the PPP frame in the L2TP payload should
have a HDLC header or not. We handle both cases for compatibility.
2012-08-25 18:15:15 +02:00
Sylvain Rochet
7920b6e163
PPP, don't allocate twice struct eth_hdr per PPPoE pbuf
2012-08-25 16:21:58 +02:00
Sylvain Rochet
4928166593
Merge branch 'master' into ppp-new
2012-08-23 20:51:53 +02:00
Sylvain Rochet
ad5f520c68
PPP, updated pppapi_reopen() to follow ppp_reopen() prototype change
2012-08-23 20:47:14 +02:00
goldsimon
150b4fb4f6
fixed bug #37166 : memp_sanity check loops itself
2012-08-22 21:59:02 +02:00
Sylvain Rochet
4f8198b298
Added ChangeLog entry reporting all the work done in the ppp-new branch.
2012-08-22 20:14:45 +02:00
Sylvain Rochet
076f177100
Added PPPd follow-up file, so that we can track what is happening on pppd.
...
The lwIP PPP support is based from pppd 2.4.5 (http://ppp.samba.org ) with
huge changes to match code size and memory requirements for embedded devices.
Anyway, pppd has a mature codebase for years and the average commit count
is getting low on their Git repositories, meaning that we can follow what
is happening on their side and merge what is relevant for lwIP.
So, here is the pppd follow up, so that we don't get away too far from pppd.
2012-08-22 17:40:23 +02:00
Sylvain Rochet
3b939480a4
PPP, added missing entry in pppapi.h
2012-08-22 11:41:07 +02:00
Sylvain Rochet
773a2767c7
PPP, added missing pppapi_delete() thread safe function
2012-08-21 20:26:37 +02:00
Sylvain Rochet
e9b29184d0
PPP, renamed all functions using common names in utils.c that can conflict with lwIP user code during link operation
2012-08-21 20:21:38 +02:00
Sylvain Rochet
0d02b8d1f6
added <stdlib.h> to ppp_impl.h, some PPP modules are using strtol()
2012-08-21 20:03:57 +02:00
Sylvain Rochet
98c0fcc659
Added <string.h> header to ppp_impl.h, this appears to be required, found out by Ivan Delamer.
2012-08-18 22:43:23 +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
1adb900561
Moved the include of lwip_md5.h or md5.h into the #if PPP_MD5_RANDM block, as suggested by Ivan Delamer
2012-08-18 12:56:59 +02:00
Sylvain Rochet
c5c1012ddd
removed some compiler warnings in pppoe_disconnect()
2012-08-17 23:42:14 +02:00
Sylvain Rochet
519f81771a
Merge remote-tracking branch 'origin/master' into ppp-new
2012-08-17 23:11:47 +02:00
Ivan Delamer
c762c06b17
Fixed typo in previous commit.
...
Change-Id: I97f85f4593509911829cfbbb6e309eecedd5465b
2012-08-17 11:24:18 -06:00
Ivan Delamer
8bab543531
Add a "NULL" output function for ipv6 by default, to avoid NULL
...
dereferencing in case of non-IPv6-enabled netifs (e.g. PPP).
Change-Id: I45f08ca89bfa0b8d61962f7052b11cc81a5e3cd1
2012-08-17 10:56:14 -06:00
goldsimon
bab8c82a35
fixed bug #36645 : Calling dhcp_release before dhcp_start dereferences NULL
2012-08-13 21:50:15 +02:00
goldsimon
b82bca7c99
fixed bug #36840 snmp_send_trap() NULL de-reference if traps configured but no interfaces available
2012-08-13 21:38:30 +02:00
goldsimon
556a2126b5
Fixed bug #36899 DNS TTL 0 is cached for a long time
2012-08-13 21:32:44 +02:00
goldsimon
a070751061
fixed bug #37052 : "netconn_alloc: undefined netconn_type" assertion skipped
2012-08-13 21:17:17 +02:00
goldsimon
847845027f
Merge branch 'master' of git.sv.gnu.org:/srv/git/lwip
2012-08-13 20:57:55 +02:00
goldsimon
c69914367d
Sanity-check the size of netif->hwaddr
2012-08-13 20:57:19 +02:00
Sylvain Rochet
48d364e269
Merge remote-tracking branch 'origin/master' into ppp-new
2012-07-24 23:17:15 +02:00
Sylvain Rochet
c58c27ed8b
removed time-based PPP phase state machine hacks from PPPoE dans PPPoL2TP
...
Our PPP phase state machine is now clean, we can safely remove time based
hacks in PPPoE dans PPPoL2TP.
2012-07-24 22:50:17 +02:00
James Smith
97b8abf16c
Fix bug #36857 : tcp_listen_dual_with_backlog() only works with ANY
...
address
Change-Id: I092a4c9978d88040214fc44a4c4b353be618d76c
2012-07-24 10:34:09 -06:00
Sylvain Rochet
59567b43b0
pcb->link_status_cb must be set, we don't need to check each time we use it if not NULL
2012-07-23 00:55:24 +02:00
Sylvain Rochet
e067e84d69
switch to phase dead if PPPoE or PPPoL2TP failed to connect
2012-07-23 00:48:27 +02:00
Sylvain Rochet
35c670513f
fixed some more PPP phase state machine issues
...
The only way PPPoE or PPPoL2TP disconnect it through ppp_link_terminated(),
therefore PPP is always already down, so we don't need to ask PPP to hup or stop.
2012-07-22 23:53:27 +02:00
Sylvain Rochet
8ec92b6fe7
don't call ppp_hup() and ppp_stop() if PPPoE or PPPoL2TP failed to connect
...
This is useless because PPP is not started yet, it confuses the PPP phase
state machine.
2012-07-22 23:37:35 +02:00
Sylvain Rochet
5552f082e8
handle cases when ppp_close() is called while session is in dead or holdoff phase
2012-07-22 21:42:56 +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
a467d21eba
ppp_close() PPPoL2TP support added
2012-07-22 18:05:19 +02:00
Sylvain Rochet
bc724ea206
Do not destroy the PPP control block automatically anymore, added ppp_delete() API function.
...
Without that, PPP user don't know when and how the PPP control block is free()ed, which
can lead to hard fault.
2012-07-22 17:20:40 +02:00
Sylvain Rochet
4ea5c1d973
improved persist mode, we now clear everything we can in the PPP control block structure, ensuring we start a new session from a clean state
2012-07-21 00:26:23 +02:00
Sylvain Rochet
c65883a727
UCHAR_MAX is defined in limits.h, I do not want to add any system include, replaced to 0xff
2012-07-16 20:09:49 +02:00
Sylvain Rochet
a4f6146667
removed some FIXME that are not relevant anymore
2012-07-15 15:57:54 +02:00
Sylvain Rochet
936c6c0d5c
reduced call stack by one when receiving a PPPoE disc packet
2012-07-15 15:12:40 +02:00
Sylvain Rochet
91af8878e1
saved some bytes from PPPoE control block, improved PADI retries
2012-07-15 15:07:07 +02:00
Sylvain Rochet
d2b2ae09e6
saving 14 bytes per PPPoE pbuf; not allocating struct eth_hdr two times per packet
2012-07-15 14:56:30 +02:00
Sylvain Rochet
94c35184a9
replaced PPPoL2TP printf() used to debug to PPPDEBUG a/o deletion
2012-07-14 17:47:30 +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
de6be743c6
added holdoff support for PPPoE and PPPoL2TP when persist mode is used
2012-07-11 23:50:33 +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
0797ab6bc6
some buggy compiler get confused with duplicated labels used in enum tcp_state and fsm.h, prepending PPP's ones
2012-07-09 22:12:14 +02:00
Sylvain Rochet
b4df26a75d
some buggy compiler get confused with duplicated labels used in enum tcp_state and fsm.h, prepending PPP's ones
2012-07-09 22:04:09 +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
Sylvain Rochet
f31b905847
initialize PPP in the lwip_init() function
2012-07-07 17:33:34 +02:00
Sylvain Rochet
572e457e77
improved PPP API header documentation
2012-07-07 15:05:15 +02:00
Sylvain Rochet
be9b23a082
fixed LCP Echo Request/Reply feature
2012-07-07 12:16:48 +02:00
Sylvain Rochet
c9e7531251
Merge branch 'master' into ppp-new
2012-07-04 00:22:33 +02:00
Sylvain Rochet
90faecd86e
replaced u_int{8,16,32}_t to lwIP u{8,16,32}_t types
...
added padding to compiler generated bitfield, this is seen as best practice,
maybe it helps buggy compilers
2012-07-03 22:59:50 +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
Sylvain Rochet
2e069429c2
removed bool type, replaced by u8_t
2012-07-03 22:03:51 +02: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
Erik Ekman
11a3057e8e
PPP: Add option to skip FCS table
...
Option PPP_FCS_TABLE is created which controls if PPPoS FCS calculation
should be done against precalculated table or by using a short algorithm.
Default value is 1, keeps old behaviour.
Setting it to 0 saves around 0.5 kB flash.
2012-06-23 15:11:49 +02:00
Sylvain Rochet
ba0c619844
clarified PPP_INPROC_OWNTHREAD documentation
2012-06-23 13:46:51 +02:00
Sylvain Rochet
a83fb30836
fixed PPPoS multithread support
2012-06-23 13:07:43 +02:00
Sylvain Rochet
dc092653f4
now displaying sent packet before PPPoS add its escaping, trailing flags, ...
2012-06-23 12:04:27 +02:00
Sylvain Rochet
25c6278000
fixed some endianess issues with PPPoS
2012-06-23 02:27:03 +02:00
Sylvain Rochet
5033e0e752
display IPV6CP packets
2012-06-23 01:44:52 +02:00
Sylvain Rochet
295eeef9b6
"ISO C forbids conversion of function pointer to object pointer type" - removed callback function pointer display in debug messages. Anyway, this is quite a meaningless information.
2012-06-22 21:48:21 +02:00
Sylvain Rochet
f63b87e28b
setting tot_len before using it, oops
2012-06-22 21:43:22 +02:00
Sylvain Rochet
1f780e86d5
PPP timeouts required depend on the number of allowed PPP sessions
...
Furthermore we need up to 6 timeouts per PPP (AUTH + PAP|CHAP|EAP + LCP + IPCP + IP6CP + PPPoE)
This can be improved with more conditions.
2012-06-22 21:29:12 +02:00
Sylvain Rochet
408a56ffaf
phase must be set to initalize each time we try to reconnect
2012-06-22 20:48:08 +02:00
Sylvain Rochet
a84f5d52ff
added ppp_pcb to ppp callback
2012-06-22 19:59:46 +02:00
Sylvain Rochet
fb6eed0087
set LL addresses before bringing the interface up for IPv6
2012-06-22 19:45:45 +02:00
Sylvain Rochet
dc242a01b4
don't build ppp_netif_output_ip6() if PPP IPV6 support is disabled
2012-06-22 19:29:55 +02:00
Sylvain Rochet
074d3dd2b1
moved ipv6cp global variables to ppp_pcb
2012-06-22 19:27:03 +02:00
Sylvain Rochet
807afbc879
improved FSM structure size
2012-06-22 18:50:09 +02:00
Sylvain Rochet
8f1eeb1025
improved ipv6cp_options struct size
2012-06-22 18:23:07 +02:00
Sylvain Rochet
dd288f70ec
fixed sent PPPoE dump packet and copy everything we need after pppoe_xmit() free'd the pbuf
2012-06-22 18:07:59 +02:00
Sylvain Rochet
6a11134a18
fixed PPPoS suppport compilation
2012-06-22 17:53:39 +02:00
Sylvain Rochet
9b60b55f03
SNMP prefers tot_len
2012-06-22 17:48:31 +02:00
Sylvain Rochet
77aa06df64
improved ppp_write_over_ethernet(), don't MEMCPY the entire packet into a new pbuf
2012-06-22 17:03:59 +02:00
Sylvain Rochet
9b7860d6ec
merged ppp_write and ppp_write_pbuf
2012-06-22 14:17:35 +02:00
Sylvain Rochet
bda73b1bc9
replaced call from ppp_write to ppp_write_pbuf
2012-06-21 23:31:23 +02:00
Sylvain Rochet
8576ee0981
randomized seed when using MD5 random support and PPPoE
2012-06-21 23:08:20 +02:00
Sylvain Rochet
8093b55e86
don't destroy and create the PPP interface each time sifup() is called (it is actually called twice with IPv4 + IPv6 enabled)
2012-06-21 22:28:52 +02:00
Sylvain Rochet
b6db4a0e2e
PPP IPv6 local link support added
2012-06-21 18:05:17 +02:00
Sylvain Rochet
cd7894dfc9
added compilation macro to eui64.[ch] and cleaned unix-dependant code
2012-06-20 13:39:08 +02:00
Sylvain Rochet
c36d73f42a
added raw IPv6 PPP files
2012-06-20 13:29:21 +02:00
Sylvain Rochet
9871c4ff06
improved IPCP control structure size
2012-06-20 00:10:08 +02:00
Sylvain Rochet
e330983408
improved lcp_options structure size
2012-06-20 00:03:08 +02:00
Sylvain Rochet
4bbf443ba2
improved CHAP structure size, however there is not much we can do
2012-06-19 23:42:41 +02:00
Sylvain Rochet
0234c62c3e
improved PAP control structure size
2012-06-19 23:37:33 +02:00
Sylvain Rochet
0bdc27186d
some more improvements to ppp_pcb
2012-06-19 23:31:20 +02:00
Sylvain Rochet
c51c55b782
LCP and IPCP variable size improved
2012-06-19 23:25:57 +02:00
Sylvain Rochet
26250f1953
removed pcb->chap_mdtype_all
2012-06-19 23:14:31 +02:00
Sylvain Rochet
7ecfe6304a
reduced MTU/MRU variables
2012-06-19 23:03:47 +02:00
Sylvain Rochet
b7be03801c
improved much more ppp_pcb entry size
2012-06-19 22:53:38 +02:00
Sylvain Rochet
b21cb8a396
removed pcb->num if PPP debug is not compiled
2012-06-19 22:08:14 +02:00
Sylvain Rochet
eadd56a376
replaced exit code (pcb->status) with ppp_ioctl()
2012-06-19 22:00:12 +02:00
Sylvain Rochet
2aa9a66c57
don't duplicate user and password anymore, anyway, the PPP user will have them already allocated as static strings or from configuration flash/file
2012-06-19 21:26:52 +02:00
Sylvain Rochet
8e9c07df39
more idle time limit macros
2012-06-19 18:02:23 +02:00
Sylvain Rochet
1d392f0e76
removed useless flags from ppp_settings
2012-06-19 17:54:29 +02:00
Sylvain Rochet
08cbc1b22b
idle time limit and connect time limit are now compile time options
2012-06-19 17:50:02 +02:00
Sylvain Rochet
f744d7a789
reduced ppp_settings types size
2012-06-19 17:42:13 +02:00
Sylvain Rochet
ff2a737094
ppp_settings.remote_name is now a compile time option
2012-06-19 17:38:02 +02:00
Sylvain Rochet
111a1cef52
moved ppp_settings.lax_recv and ppp_settings.noendpoint bool types (so char) to the ppp_settings bitfield
2012-06-19 17:07:02 +02:00
Sylvain Rochet
a44b56dc61
pcb->nak_buffer replaced with a pbuf
2012-06-19 15:36:53 +02:00
Sylvain Rochet
1b586b69bc
do not allocated pbuf of more than pcb->peer_mru instead of PPP_MRU, to save some memory
2012-06-18 15:07:48 +02:00
Sylvain Rochet
4a7f2ffc5e
pcb->outpacket_buf replaced by pbuf everywhere it was used
2012-06-18 02:21:18 +02:00
Sylvain Rochet
503162ec54
CHAP is now using pbuf instead of pcb->outpacket_buf
2012-06-18 01:18:24 +02:00
Sylvain Rochet
22fad86453
PAP is now using pbuf instead of pcb->outpacket_buf
2012-06-18 01:10:21 +02:00
Sylvain Rochet
8641b8a36e
PPP_PCB are now allocated using memp_alloc()
2012-06-17 23:48:55 +02:00
Sylvain Rochet
be2d3b5886
moved back temporarily moved structure definitions from various headers to ppp.h during unit to ppp_pcb transition
2012-06-17 02:33:47 +02:00
Sylvain Rochet
3120487243
cleanified old style C function declaration from utils.c
2012-06-17 01:47:45 +02:00
Sylvain Rochet
4404ef0281
prevent conflict with existing (md4|md5|sha1|des) object file if polarssl is already used elsewhere in the project
2012-06-17 00:55:11 +02:00
Sylvain Rochet
0c68fc409e
fixed pppoe_find_softc_by_session() when we have the same PPPoE session id on 2 ethif
2012-06-17 00:33:02 +02:00
Sylvain Rochet
ea7bf19057
fixed most "unit 0" used instead of pcb pointer
2012-06-17 00:17:22 +02:00
Sylvain Rochet
99bf9775d9
NUM_PPP is defined is opt.h, clearing from ppp_impl.h
2012-06-16 18:45:53 +02:00
Sylvain Rochet
0e2d5f9d0e
removed unused inpacket_buf in ppp_pcb
2012-06-16 14:53:13 +02:00
Sylvain Rochet
3065b9f968
no more pcb->unit, new user selectable pcb->num for debugging purpose (like netif does)
2012-06-16 04:12:10 +02:00
Sylvain Rochet
cce5fbc7b1
fixed PPPoS xmit_accm ppp_pcb variable access
2012-06-16 03:58:48 +02:00
Sylvain Rochet
82a4d4ec65
LCP global variables moved to ppp_pcb as well as input/output buffers
2012-06-16 03:53:05 +02:00
Sylvain Rochet
708147625f
FSM global variables moved to ppp_pcb
2012-06-16 03:30:36 +02:00
Sylvain Rochet
93559a54e9
IPCP global variables moved to ppp_pcb
2012-06-16 03:25:31 +02:00
Sylvain Rochet
f10ddea305
removed fsm->unit
2012-06-16 03:14:26 +02:00
Sylvain Rochet
4a8ff6d824
protent prototype switched from unit to ppp_pcb
2012-06-16 02:43:13 +02:00
Sylvain Rochet
4b7e3af77c
IPCP and LCP structures moved to ppp_pcb
2012-06-16 02:13:50 +02:00
Sylvain Rochet
19238a910c
global variables removed from chap support
2012-06-15 01:22:01 +02:00
Sylvain Rochet
2deb13df43
EAP is now using ppp_pcb as well
2012-06-15 01:06:27 +02:00
Sylvain Rochet
1ece33e79a
PAP and CHAP are now using ppp_pcb*
2012-06-15 00:24:39 +02:00
Sylvain Rochet
844f5e5af1
moved auth.c global variables to ppp_pcb
2012-06-14 00:25:45 +02:00
Sylvain Rochet
51bfac71b0
auth.c functions now use ppp_pcb* as first argument
2012-06-14 00:08:56 +02:00
Sylvain Rochet
81a0fd782f
removed unit from ppp_ioctl()
2012-06-13 00:12:55 +02:00
Sylvain Rochet
3a30e5bf78
removed ppp_input_header, replaced using 2 chained pbuf the only area we need it
2012-06-12 23:28:09 +02:00
Sylvain Rochet
a87096cdc9
fixed PPPoS support, improved ppp_input()
2012-06-12 00:59:02 +02:00
Sylvain Rochet
527d99fd39
removed all PPP unit in ppp.c except pih->unit and unit used in debugging output
2012-06-12 00:55:53 +02:00
Sylvain Rochet
6e2722a6d3
started the unit to ppp_pcb replacement
2012-06-11 01:39:03 +02:00
Sylvain Rochet
8694deaabb
don't add ppp_pcb_rx to ppp_pcb struct if PPPOS support is disabled
2012-06-10 21:06:02 +02:00
Sylvain Rochet
a226099b04
ppp_close() on PPPoE actually works,
...
clear persist mode if user asked the connection to shutdown
2012-06-10 01:45:29 +02:00
Sylvain Rochet
336ba8f419
pppoe now have access to the ppp_pcb structure, removed "persist" option copy
2012-06-10 01:08:37 +02:00
Sylvain Rochet
5abdc99f3e
no more PPP unit number in PPPoE, now using ppp_pcb
2012-06-10 01:00:50 +02:00
Sylvain Rochet
f7ef9887d7
improved ppp_set_auth() mschap support
2012-06-09 23:38:38 +02:00
Sylvain Rochet
fed76f29d0
added missing EAP_SUPPORT macro
2012-06-09 23:38:26 +02:00
Sylvain Rochet
a3cfbfc6ba
ppp_set_auth() modified to handle new handled authtype (mschap + eap)
2012-06-09 23:32:31 +02:00
Sylvain Rochet
444646b65e
renamed ppp_control to ppp_pcb, replaced unit number to ppp_pcb in all ppp.h declared functions
2012-06-09 23:06:45 +02:00
Sylvain Rochet
8bd508a73d
moved ppp_settings to ppp_control, improved PPP API to really allow multiple PPP sessions
2012-06-09 18:06:55 +02:00
Sylvain Rochet
1cceb4e0ad
moved hide_password global variable to ppp_options
2012-06-09 17:05:19 +02:00
Sylvain Rochet
c2d2034ae8
PPPoE persist is working, removing FIXME comments about that
2012-06-09 16:56:32 +02:00
Sylvain Rochet
f94ed922e5
moved exit status global variable to ppp_control
2012-06-09 16:43:12 +02:00
Sylvain Rochet
7a57d28db4
moved listen_time global variable to ppp_settings
2012-06-09 16:18:01 +02:00
Sylvain Rochet
ce5121e659
removed unused "unsuccess" global variable
2012-06-09 16:00:22 +02:00
Sylvain Rochet
a7d7158b05
removed useless error_count global variable from ppp.c
2012-06-09 15:58:51 +02:00
Sylvain Rochet
6b8c78bacc
moved remote_name and explicit_remote global variable to ppp_settings
2012-06-09 15:55:01 +02:00
Sylvain Rochet
2da930ba4c
removed some useless extern
2012-06-09 15:45:52 +02:00
Sylvain Rochet
772cac7946
removed useless error_count global variable
2012-06-09 15:42:57 +02:00
Sylvain Rochet
42f672d85d
phase global variable moved to ppp_control structure
2012-06-09 15:39:16 +02:00
Sylvain Rochet
945f2912a7
using PPP_DEBUG instead of debug global variable
2012-06-09 15:09:00 +02:00
Sylvain Rochet
1ccf516c5e
options.c is now empty, removed
2012-06-09 14:43:56 +02:00
Sylvain Rochet
fb396b8fac
moved debug option from options.c to ppp.c
2012-06-09 14:42:31 +02:00
Sylvain Rochet
6db3026d47
using our_name from ppp_settings (only used in server mode and disabled by default)
2012-06-09 14:39:44 +02:00
Sylvain Rochet
becc306300
using idle_time_limit from ppp_settings
2012-06-09 14:35:06 +02:00
Sylvain Rochet
4e7ce11684
removed holdoff support, can be handled without persist mode outside lwIP
2012-06-09 14:31:45 +02:00
Sylvain Rochet
6589cf9d8e
removed useless options
2012-06-09 14:16:59 +02:00
Sylvain Rochet
552589f098
removed multilink option when multilink support is not compiled
2012-06-09 14:14:06 +02:00
Sylvain Rochet
2ec79c03a0
unused ifunit global variable removed
2012-06-09 01:26:21 +02:00
Sylvain Rochet
21653f0f91
pr_log is unused, don't even try to build it
2012-06-09 01:20:01 +02:00
Sylvain Rochet
b922eaa754
print packet is working back, at least for PPPoE
2012-06-09 00:52:20 +02:00
Sylvain Rochet
d27da93c33
now using maxconnect from ppp_settings
2012-06-07 23:34:06 +02:00
Sylvain Rochet
2e6fa7f8a3
dns server support is done, clearing FIXME entries
2012-06-07 23:05:19 +02:00
Sylvain Rochet
302184938a
removed malloc() from ms chap
2012-06-07 23:02:08 +02:00
Sylvain Rochet
e5355cc45f
PPP server support is now optional (disabled by default, not working until PPP have a "listen" support)
2012-06-07 22:22:57 +02:00
Sylvain Rochet
2fe778507a
fixed randm if random MD5 support is not enabled
2012-06-07 22:19:25 +02:00
Sylvain Rochet
4077422ae2
fixed pbuf leaks in ppp_input() in case of packets not expected
2012-06-07 20:41:21 +02:00
Sylvain Rochet
a9ac45c5f0
added PPPoE persist support (don't timeout sending PADI packets)
2012-06-07 01:48:12 +02:00
Sylvain Rochet
7ef99ee6f3
added a persist option (enabled by default for now until we add a way for users to pass a ppp_settings structure)
...
improved PPPoE state machine and added persist mode support
2012-06-07 00:46:19 +02:00
Sylvain Rochet
e44aada634
improved PPPoE callback with state values, so that PPP know exactly what is happening on the PPPoE side
2012-06-06 23:42:20 +02:00
Sylvain Rochet
ac0a864e14
fixed typos s/parms/params/g
2012-06-06 22:36:23 +02:00
Sylvain Rochet
3c3331d5ed
fixed some debug strings
2012-06-06 22:34:16 +02:00
Sylvain Rochet
6f21f48937
added MTU support (using MRU from the peer)
2012-06-05 23:10:38 +02:00
Sylvain Rochet
2e227f868b
PPPoE is now guessing its MTU from the underlying netif MTU (in most cases 1500 minus 8 = 1492, which is the most common PPPoE MTU)
2012-06-05 22:22:35 +02:00
Sylvain Rochet
7d7513c71c
re-enabled DNS support
2012-06-04 23:19:23 +02:00
Sylvain Rochet
d95f1e9913
added missing initialisation in ppp_init.c
2012-06-04 22:48:12 +02:00
Sylvain Rochet
1013b49ab7
disabled ppp_over_ethernet_close(), which is not exported and probably bogus, until we fix it
2012-06-04 22:23:10 +02:00
Sylvain Rochet
dc0e15a74e
we should reduce nak_buffer[] size
2012-06-04 22:22:37 +02:00
Sylvain Rochet
d6e5ca722f
setting default route by default
2012-06-04 19:00:36 +02:00
Sylvain Rochet
cd3ba00479
get_mask now returns "255.255.255.255" by default, which is what we want in almost all cases on a PPP link
2012-06-04 18:58:05 +02:00
Sylvain Rochet
c549dba725
re-enabled LCP echo interval / echo fail
2012-06-04 16:25:16 +02:00
Sylvain Rochet
ca1ad99bea
PPPoE reauth bug fixed
2012-06-04 15:31:29 +02:00
Sylvain Rochet
2c7bd7e591
fixed print_string() prototype
2012-06-04 01:45:33 +02:00
Sylvain Rochet
bea45b3c30
cleared IDE warnings
2012-06-04 00:59:24 +02:00
Sylvain Rochet
093c7b4386
cleaned depreacted __P() and __V() macros, removed the legacy varargs.h header
2012-06-04 00:34:28 +02:00
Sylvain Rochet
8332a5aa53
disabled all plugins hooks
2012-06-04 00:12:45 +02:00
Sylvain Rochet
eb020656d2
disabled all plugins hooks
2012-06-04 00:12:17 +02:00
Sylvain Rochet
31456a6dfe
removed CamelCase in ppp.c and ppp_impl.h, added compat macro in ppp.h (but disabled for now)
2012-06-03 23:56:56 +02:00
Sylvain Rochet
03fda0f803
removed CamelCase for all ppp.h declared functions
2012-06-03 21:48:10 +02:00
Sylvain Rochet
c09f03f6e8
VJ support is back!
2012-06-03 20:44:47 +02:00
Sylvain Rochet
3bad9ff50a
ppp_impl.h is back!
2012-06-03 20:25:32 +02:00
Sylvain Rochet
0663421d01
re-added PPPoS code from the previous port, it builds, maybe it works
2012-06-03 20:05:40 +02:00
Sylvain Rochet
10175caa38
fixed MD5 Random enabling conditions
2012-06-03 16:59:50 +02:00
Sylvain Rochet
103ad75c50
automatically enable MD5 Random support if CHAP or EAP is enabled
2012-06-03 16:51:03 +02:00
Sylvain Rochet
2f5f86d6fc
don't build any PPP file if PPP support is disabled
2012-06-03 16:38:26 +02:00
Sylvain Rochet
89d2c2917f
more ppp.[ch] cleaning
2012-06-03 16:24:33 +02:00
Sylvain Rochet
05817aa3b9
LQR (Link Quality Report) support is now optional
2012-06-03 14:02:25 +02:00
Sylvain Rochet
5464ed6661
removed all useless header files, merged ppp_defs.h to ppp.h
...
removed session.[ch] and tty.c which are Unix-centric files and disabled
2012-06-03 13:53:45 +02:00
Sylvain Rochet
05c84a147d
added ECP_SUPPORT in opt.h (disabled by default); renamed MD5_SUPPORT to PPP_MD5_RANDM, which is more meaningful
2012-06-03 13:07:46 +02:00
Sylvain Rochet
9c35403b98
clarified a bit more ppp.[ch]
2012-06-03 01:46:46 +02:00
Sylvain Rochet
b5b075eb04
demystified a bit the PPP impl, renamed output() to ppp_output() to prevent conflict
2012-06-03 00:30:12 +02:00
Sylvain Rochet
e1261c9620
removed all system headers except the strict minimum
2012-06-02 23:29:40 +02:00
Sylvain Rochet
5531bca078
make it build with avr32-gcc
...
Disabled Unix-centric non necessary include files
Changed some include paths
Removed all printf() I put there and there for debugging.
It builds with the avr32 gcc toolchain, meaning we removed
all the pppd code requiring a unix base.
2012-06-02 23:04:03 +02:00
Sylvain Rochet
28b9dd50ff
build PolarSSL MD5 if MD5_SUPPORT is enabled (for randm)
2012-06-02 21:31:13 +02:00
Sylvain Rochet
44c2a0a7fc
fixed most PPP compilation warnings with -pedantic
2012-06-02 21:25:58 +02:00
Sylvain Rochet
d143acfc76
fixed all PPP compilation warnings with -Wall
2012-06-02 20:46:52 +02:00
Sylvain Rochet
b4d59fd52d
removed headers that were initially copied but not used (yet)
2012-06-02 19:37:40 +02:00
Sylvain Rochet
2ee2a1b730
removed sys-linux.c
2012-06-02 19:34:37 +02:00
Sylvain Rochet
86ebc8e46c
removed pppd.h and ppp.c, renamed pppmy.c to ppp.c and pppmy.h to ppp.h
2012-06-02 19:30:31 +02:00
Sylvain Rochet
29c5ee6b19
pppd.h disabled, renamed MAX() to LWIP_MAX()
2012-06-02 19:19:51 +02:00
Sylvain Rochet
323aebf1f5
cleaning unused stuff in pppd.h, syslog() is no more used
2012-06-02 18:47:53 +02:00
Sylvain Rochet
a5dd1ccfaa
ppp.c disabled, everything required for lwIP moved to our impl
2012-06-02 18:07:34 +02:00
Sylvain Rochet
4dd297cef2
protent table moved to our PPP impl
2012-06-02 17:22:12 +02:00
Sylvain Rochet
7f9fea18ae
added pppmy.h in all .c files to easily find conflicts
2012-06-02 17:12:55 +02:00
Sylvain Rochet
adb8b881b4
resolve conflit, ipcp.c defines ip_ntoa() which is already defined by lwIP, disabled ipcp.c::ip_ntoa() and using lwIP one
2012-06-02 17:04:46 +02:00
Sylvain Rochet
d3d1b69c7a
more ppp.c cleaning
2012-06-02 16:56:20 +02:00
Sylvain Rochet
922d3716ff
PPP statistics optional (non working) compile time option added
2012-06-02 16:41:09 +02:00
Sylvain Rochet
4158222e86
moved new_phase() to our own implementation, re-enabled new_phase() support
2012-06-02 15:00:18 +02:00
Sylvain Rochet
6727c43441
PPP notifier support is now a compile time option
...
However, as of now, the notify() function is empty, so it requires
some work if someone want to use it.
The notify feature allows someone to be able to follow the
state of the PPP stack (auth ok, ipcp up, initialise, ...), this
is like the callback feature set by pppOverEthernetOpen() and others,
but with more details.
2012-06-02 14:48:04 +02:00
Sylvain Rochet
55c1ec2925
re-enabled auth notifiers
2012-06-02 14:12:54 +02:00
Sylvain Rochet
0f1c18e675
PPP interval timeout support disabled (using lwIP timeout support), protocol_name() moved to our PPP impl and disabled by default
2012-06-02 13:46:45 +02:00
Sylvain Rochet
0de1293ff5
clarifying what is actually the "datainput" entry in protent
2012-06-02 13:03:43 +02:00
Sylvain Rochet
89ab390719
added necessary pppSingleBuf() call before passing the packet to the appropriate PPP subsystem
2012-06-02 02:44:18 +02:00
Sylvain Rochet
88ef3ffa50
POSIX signal support removed
2012-06-02 02:30:43 +02:00
Sylvain Rochet
668d5d9d92
removed set/getenv functions
2012-06-02 02:23:56 +02:00
Sylvain Rochet
6c908ac727
removed more protent fields only used by print packets functions
2012-06-02 02:14:19 +02:00
Sylvain Rochet
2c4bd7162f
print packet functions are now optional
2012-06-02 02:07:49 +02:00
Sylvain Rochet
cf18e0776d
removed demand prototypes if not compiled-in
2012-06-02 01:55:24 +02:00
Sylvain Rochet
8b866beaeb
demand support is now a compile-time option
...
Obviously, it requires some wiring to know if there is new activity
on a not-yet established PPP interface with the default route
already set.
I don't think any lwIP user will ever need that, all should know
when to bring the link up and down.
2012-06-02 00:53:25 +02:00
Sylvain Rochet
ee5fca7a2b
removed pathnames.h and pidfile support
2012-06-02 00:33:37 +02:00
Sylvain Rochet
fc074937f5
Linux ioctl() gone, ECP support optional, CCP support optional
...
Removed all the used Linux ioctl(), sys_linux.c is entirely disabled.
Replaced unecessary functions to set up a PPP link to null fonctions,
however all stuff necessary to shutdown a PPP link should be done.
Some utils functions related to I/O files are disabled too.
ECP and CCP support only set PPP attributes into the PPP kernel support,
they are now compile-time options and are disabled by default and
obviously not supported (yet? :p)
2012-06-02 00:19:40 +02:00
Sylvain Rochet
a17ea13453
autoselecting which PolarSSL files to use support added
2012-06-01 01:10:02 +02:00
Sylvain Rochet
8bb4ea85b8
removed some useless Linux calls
2012-06-01 01:07:27 +02:00
Sylvain Rochet
26e8372c75
changed PolarSSL compile-time condition
2012-06-01 00:59:15 +02:00
Sylvain Rochet
4704efa32a
PAP support is now an optional compile-time feature
2012-05-30 23:32:30 +02:00
Sylvain Rochet
339925e835
CHAP support is now an optional compile-time feature
2012-05-24 00:52:20 +02:00
Sylvain Rochet
28360a7f26
MSCHAP is now an optional compile-time feature
2012-05-23 23:29:19 +02:00
Sylvain Rochet
49bb62d221
and less and less useless auth code (will this end ?)
2012-05-23 00:51:59 +02:00
Sylvain Rochet
04f121b88f
less and less auth code
2012-05-23 00:04:07 +02:00
Sylvain Rochet
6ce5c8eb78
disabled upap_rauthreq()
2012-05-22 23:07:28 +02:00
Sylvain Rochet
7736cdae1c
replaced BCOPY to lwip-MEMCPY
2012-05-22 23:02:02 +02:00
Sylvain Rochet
05aa1f1ae4
using MEMCPY() instead of memcpy()
2012-05-22 22:13:41 +02:00
Sylvain Rochet
42827cdea2
more and more ppp options removal
2012-05-22 21:59:23 +02:00
Sylvain Rochet
b88dad4034
disabled almost all PPP options strings and support as well as useless file-based auth code
2012-05-22 01:28:30 +02:00
Sylvain Rochet
d0645273df
removed HMAC support from ciphers
2012-05-21 23:02:27 +02:00
Sylvain Rochet
dea27e105d
cleaned PolarSSL files
2012-05-21 22:48:41 +02:00
Sylvain Rochet
0bfad4392a
Commit to prouve we copied the raw BSD PolarSSL files
2012-05-21 22:33:37 +02:00
Sylvain Rochet
4c1b507c07
fixed MS-CHAP and MS-CHAP-V2, MD4 polarssl uses bytes as input length, not bits
2012-05-21 22:26:20 +02:00
Sylvain Rochet
0289055948
Revert "Revert "Added PolarSSL DES library, which is necessary for MSCHAP.""
...
This reverts commit a820f32ec9 .
2012-05-21 22:15:40 +02:00
Sylvain Rochet
83a48dafea
Revert "Revert "Replaced md4/md5/sha1 implementations to PolarSSL ones""
...
This reverts commit ca2fd867b8 .
2012-05-21 22:14:29 +02:00
Sylvain Rochet
a7a20a9de4
Revert "now using OpenBSD DES implementation"
...
This reverts commit a9672e1a21 .
2012-05-21 22:14:13 +02:00
Sylvain Rochet
82b67b01ff
Revert "removed salted DES ( known as crypt() function ), we don't need it"
...
This reverts commit 517659640e .
2012-05-21 22:14:02 +02:00
Sylvain Rochet
b896203dcf
Revert "Removed all stuff requiring encryption."
...
This reverts commit c268c5e07c .
Conflicts:
src/netif/ppp/auth.c
src/netif/ppp/ppp.c
src/netif/ppp/pppmy.c
src/netif/ppp/pppmy.h
2012-05-21 22:04:04 +02:00
Sylvain Rochet
795d5807b5
EAP support is now optional
2012-05-21 01:18:36 +02:00
Sylvain Rochet
7d43f4a1f4
removed useless system header from EAP
2012-05-21 00:03:18 +02:00
Sylvain Rochet
c268c5e07c
Removed all stuff requiring encryption.
...
OpenBSD DES require more than 70 kB of static memory.
The GNU libcrypt DES, for information, require more than 131 kB,
so this is probably the case with all non memory optimised DES.
PolarSSL only required 132 bytes of stack with some kB of .rodata
precomputed tables :-)
I personally don't need MS CHAP v1 or MS CHAP v2, and that was not
supported in the previous PPP port, so there is no regression,
I feel comfortable about removing those hard to port stuff.
If someone want to do the MS CHAP port, he first have to find or
do a small memory footprint DES implementation.
2012-05-20 23:23:14 +02:00
Sylvain Rochet
517659640e
removed salted DES ( known as crypt() function ), we don't need it
2012-05-20 22:47:12 +02:00
Sylvain Rochet
a9672e1a21
now using OpenBSD DES implementation
2012-05-20 22:32:24 +02:00
Sylvain Rochet
4570f71f21
modified auth_reset() so that we can choose which auth we want
2012-05-20 20:46:45 +02:00
Sylvain Rochet
ca2fd867b8
Revert "Replaced md4/md5/sha1 implementations to PolarSSL ones"
...
This reverts commit aa2656cb9e .
Licence issue, we cannot include GPLed source code.
2012-05-20 20:40:27 +02:00
Sylvain Rochet
624da03bad
Revert "modified auth_reset() so that we can choose which auth we want"
...
This reverts commit bf10a27db8 .
Licence issue, we cannot include GPLed source code.
2012-05-20 20:40:08 +02:00
Sylvain Rochet
a820f32ec9
Revert "Added PolarSSL DES library, which is necessary for MSCHAP."
...
This reverts commit de70b710af .
Licence issue, we cannot include GPLed source code.
2012-05-20 20:39:15 +02:00
Sylvain Rochet
f5dc6e80c0
Removed uneeded crypt() from auth.c and session.c
2012-05-20 20:04:05 +02:00
Sylvain Rochet
de70b710af
Added PolarSSL DES library, which is necessary for MSCHAP.
...
Added a README about our PolarSSL included files, clarifying what we did.
Removed crypt(), -lcrypt ( setkey() / encrypt() ) dependencies.
2012-05-20 19:57:37 +02:00
Sylvain Rochet
bf10a27db8
modified auth_reset() so that we can choose which auth we want
...
also fixed MS-CHAP and MS-CHAP-V2, MD4 polarssl uses bytes as input
length, not bits
2012-05-20 15:27:52 +02:00
Sylvain Rochet
aa2656cb9e
Replaced md4/md5/sha1 implementations to PolarSSL ones
...
Using cleaned PolarSSL md4/md5/sha1 implementations, without changing the API,
so that lwIP users already doing SSL or using PolarSSL don't need to compile
md4/md5/sha1 twice.
Added to that, we need a DES library for MSCHAP, and PolarSSL provided
a DES support.
And finally, PolarSSL is outstanding :-)
2012-05-20 01:44:22 +02:00
Sylvain Rochet
adf2b2bf03
don't compile wkmodulus[] if SRP is not used
2012-05-19 22:59:08 +02:00
Sylvain Rochet
6773326d96
replaced MIN to LWIP_MIN
2012-05-17 23:41:39 +02:00
Sylvain Rochet
1d7efce0dc
Removed TDB code, which we cannot port, because it needs a filesystem.
...
About multilink support.
Multilink uses Samba TDB (Trivial Database Library), which
we cannot port, for the above reason.
We have to choose between doing a memory-shared TDB-clone,
or dropping multilink support at all.
2012-05-17 23:21:09 +02:00
Sylvain Rochet
1a1deb5d58
reworked magic/randm
2012-05-17 22:42:07 +02:00
Sylvain Rochet
bcba806ef0
ported randm module from previous PPP port
2012-05-17 21:45:02 +02:00
Sylvain Rochet
00648c27eb
world changed, removed IPX support
2012-05-17 20:22:17 +02:00
Sylvain Rochet
4885b39121
removed run_program() support
2012-05-17 20:17:31 +02:00
Sylvain Rochet
0f3e70b679
removed user and passwd globals
2012-05-17 20:05:37 +02:00
Sylvain Rochet
372a0f9eea
moved refuse_mschap, refuse_mschap_v2, refuse_eap from globals to ppp_settings
2012-05-17 19:41:34 +02:00
Sylvain Rochet
2a44bad2e7
removed passwd_from_file usage, removed some of unused PAP file fetch code
2012-05-17 19:29:54 +02:00
Sylvain Rochet
33e8472473
CHAP auth is now working
2012-05-17 19:05:47 +02:00
Sylvain Rochet
8834a8b216
using UNTIMEOUT macro instead of timeout()
2012-05-17 16:36:59 +02:00
Sylvain Rochet
db794c2d32
PPPoL2TP patch from Debian, not used yet, but already fixed
2012-05-17 16:29:00 +02:00
Sylvain Rochet
a1d80c29de
fixed demand_rexmit() with new IP addr, maybe we will never support demand or drop it, but it is already patched just in case
2012-05-17 16:23:32 +02:00
Sylvain Rochet
bea796ebc0
pppd: Terminate correctly if lcp_lowerup delayed calling fsm_lowerup
2012-05-17 16:14:30 +02:00
Sylvain Rochet
d4978210f0
using rp-pppoe pppd exits with EXIT_OK after receiving a timeout waiting for PADO due to no modem attached, from Debian patches
...
http://ppp.samba.org/cgi-bin/ppp-bugs/incoming?id=2211
Using rp-pppoe pppd exits with exitcode 0, whenever there is no modem connected
and pppd get's a timeout while waiting for a PADO.
This happens because status is set to EXIT_OK in main.c at the beginning of the
procedures. Within start_link(), connect() will be called as one of the first
calls.
If that call fails (no pppoe discovery for example), jumps to "fail", which
returns without setting the status variable to failure. So at the end pppd exits
with EXIT_OK.
I moved the status = EXIT_NEGOTIATION_FAILED which will be set later within
start_link, at the top of it. That seems to work out, patch is attached:
2012-05-17 15:56:35 +02:00
Sylvain Rochet
ef59e952d8
added IPCP no/replace default route option from Debian patches, I like the idea
2012-05-17 15:55:27 +02:00
Sylvain Rochet
54d5ee5562
added LCP adaptive echo from Debian patches, I like the idea
2012-05-17 15:50:15 +02:00
Sylvain Rochet
eb75ae05c6
Early development stage of an attempt to port PPPd 2.4.5 to lwIP.
...
PPPoE works, PPPoS code is not ported at all.
I am using the RP-PPPoE server to do my tests using the following
configuration:
$ cat /etc/ppp/pppoe-server-options
debug
login
lcp-echo-interval 10
lcp-echo-failure 10
ms-dns 192.168.4.130
ms-dns 192.168.4.231
netmask 255.255.255.0
defaultroute
noipdefault
usepeerdns
$ cat /etc/ppp/allip
192.168.4.1-200
$ pppoe-server -C isp -L 192.168.4.254 -p /etc/ppp/allip -I tap0
Plus the usual auth-lines in /etc/ppp/pap-secrets and
/etc/ppp/chap-secrets .
And the unix port minimal "echo" project slightly modified to use
the "tcpip" API, so with threads, which I am going to commit with
NO_SYS as a -Dmacro.
It still use some of the linux'ism, such as syslog() and crypt(),
I do not want to drop the syslog() supports at the moment, this is
pretty useful to debug, and we may just convert the way the syslog() is
done to provide a trace feature to our PPP users, as a compile-time
option.
2012-05-16 02:02:02 +02:00
goldsimon
b56a1501d2
fixed bug #36412 : memp.c does not compile when MEMP_OVERFLOW_CHECK > zero and MEMP_SEPARATE_POOLS == 1
2012-05-11 22:56:53 +02:00
goldsimon
fe9c716fbe
Merge branch 'master' of git.sv.gnu.org:/srv/git/lwip
2012-05-11 22:37:30 +02:00
goldsimon
bc308c21fc
fixed bug: #36380 unsent_oversize mismatch in 1.4.1RC1 (this was a debug-check issue only)
2012-05-08 07:42:32 +02:00
goldsimon
3e41f36ef5
Added a readme.txt about the PPP code.
2012-05-07 22:12:01 +02:00
goldsimon
8d2131884c
Added missing name (patch by)
2012-05-05 09:28:24 +02:00
Ivan Delamer
289566afe8
In ip6_input(), do not accept link-local packets on netifs other than
...
inp.
Change-Id: I7f3c779e69292bc078890e0acdc37112559644ce
2012-05-04 18:25:22 -06:00
Ivan Delamer
944adc56ee
Fixed #define that was commited by mistake.
...
Change-Id: Ic44560284e932b2d7c503155085160647ac82bb8
2012-05-04 18:19:40 -06:00
Ivan Delamer
6e81f722ad
In ip6_input(), accept solicited node packets that match the receiving
...
netif addresses, when multicast is disabled.
Change-Id: I3f59258ee605a820f0a525b696b1dede0d53948f
2012-05-04 18:11:47 -06:00
Ivan Delamer
bfa28f4c30
fixes bug #36389 : Use IPv6 Src Address of Echo Response as Destination
...
Address in Echo Response
2012-05-04 17:43:54 -06:00
Ivan Delamer
3dcd33b08f
Fix bug #36391 - inet6_addr_to_ip6addr()
...
Change-Id: I2ab73901a8552e3c247d95985f6ce5d6ef7d4599
2012-05-04 17:33:06 -06:00
goldsimon
3ac81e9d7c
patch by Sylvain Rochet: fixed bug #36283 (PPP struct used on header size computation and not packed)
2012-05-03 20:39:43 +02:00
goldsimon
1704d21356
dhcp: check array bounds before accessing it (bug #36170 )
2012-05-03 20:21:50 +02:00
goldsimon
d690775ca1
Added unit test that pbuf_copy returns a correct error code for pbuf queues ending with a zero-length pbuf.
2012-05-03 20:11:23 +02:00
goldsimon
fb07a28c99
fixed bug #36388 (PPP: checksum-only in last pbuf leads to pbuf with zero length)
2012-05-03 19:45:22 +02:00
goldsimon
1dff9aea62
fixed the fix for bug #35945 (SYN packet should provide the recv MSS not the send MSS) if TCP_CALCULATE_EFF_SEND_MSS==0
2012-03-28 11:06:52 +02:00
goldsimon
e5d54f5344
fixed bug #35756 header length calculation problem in ppp/vj.c - removed unused/invalid defines TCPH_OFFSET(_SET).
2012-03-27 20:42:46 +02:00
goldsimon
a558c01589
fixed bug #35945 : SYN packet should provide the recv MSS not the send MSS
2012-03-27 20:18:23 +02:00
goldsimon
7043983acc
udp_input: fixed unreachable code warning for CHECKSUM_CHECK_UDP==0
2012-03-25 17:20:22 +02:00
goldsimon
dd245c63d7
tcp_abort/tcp_abandon: don't send RST if pcb->state is CLOSED
2012-03-25 17:19:46 +02:00
goldsimon
84d8760561
dhcp unit test: fixed 2 consts, use udp checksum 0x0000 in handcrafted packets so that CHECKSUM_CHECK_UDP==0 is not necessary
2012-03-25 17:18:58 +02:00
goldsimon
e1225cec5f
new dhcp unit test: fix compilation for strict C, made local functions static, made some variables and parameters const
2012-03-25 17:15:56 +02:00
goldsimon
5db6bb02d6
TCP unit tests: fix that ip.rterr stats are increased (some unit tests had no netif set)
2012-03-25 17:12:02 +02:00
Erik Ekman
679d3fd5b3
Add unit tests for DHCP
...
Three simple tests that test the basic functionality of the DHCP client.
They require that UDP checksums are off for now.
2012-03-25 15:34:31 +02:00
goldsimon
c622985fda
Better fix for bug #35927 (missing refragmentaion in ip_forward) when IP_FRAG is disabled.
2012-03-25 15:12:42 +02:00
goldsimon
d910786034
added posix-compatibility include files posix/netdb.h and posix/sys/socket.h which are a simple wrapper to the correct lwIP include files.
2012-03-25 15:02:58 +02: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
d95bcab053
fixed bug #35927 : missing refragmentaion in ip_forward
2012-03-22 19:35:04 +01:00
Ivan Delamer
2b4c10e705
Support single-packet queueing in ND6 (similar to ARP), when
...
!LWIP_ND6_QUEUEING.
2012-03-22 11:14:49 -06:00
Ivan Delamer
ac4c802089
Disable leftover ND6 queueing code when !LWIP_ND6_QUEUING.
2012-03-22 10:25:50 -06: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
52d41d19d3
Merge branch 'master' of git.sv.gnu.org:/srv/git/lwip
2012-03-12 16:43:23 +01:00
goldsimon
0e7df4b193
Removed unnecessary global variable "subnetMask", which is only used in one function (GetMask)
2012-03-12 16:42:18 +01:00
goldsimon
2c9b3b35d1
patch by Bostjan Meglic: fixed bug #35809 : PPP GetMask(): Compiler warning on big endian, possible bug on little endian system
2012-03-12 16:39:52 +01:00
Ivan Delamer
773dcae2f9
Missing declarations in supporting IP_HDRINCL.
2012-03-02 09:35:42 -07:00
Ivan Delamer
22e7b674ed
Check arguments in nd6, and some other minor fixes nearby.
2012-03-02 09:27:14 -07:00
Ivan Delamer
8c95422204
Early exit when checking if ip6 reassembled packet is valid.
2012-03-02 09:18:54 -07:00
Ivan Delamer
34531a8160
Check that pbuf_header succeeds in IPv6 reassembly.
2012-03-02 09:16:33 -07:00
Ivan Delamer
5c199483cd
Support IP_HDRINCL in ip6_output() and ip6_output_hinted(),
...
previously only supported in ip6_output_if().
2012-03-02 09:06:57 -07:00
Ivan Delamer
c52189557e
Fixed error in calculating some IPv6 option header lengths.
2012-03-02 08:59:34 -07:00
Ivan Delamer
bcabe63971
Set ip_data.current_netif earlier to allow ICMPv6 packets in ip6_fwd.
...
Then set to "accepted" netif, not inp.
2012-03-02 08:53:51 -07:00
goldsimon
193ccaa3b4
IGMP stats: added missing tab (by Gisle Vanem)
2012-03-01 19:21:17 +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
7f81c62bf0
fixed bug #35595 : Impossible to send broadcast without a gateway (introduced when fixing bug# 33551)
2012-02-23 10:14:27 +01:00
goldsimon
fc7da615fb
unit tests lwipopts.h: NO_SYS==1, disable netconn and sockets (not tests) -> lwipopts.h is now usable for unix unit test makefile, too
2012-02-22 21:47:33 +01:00
goldsimon
86766f4e20
Minor: cosmetic source code layout changes
2012-02-22 21:35:04 +01:00
goldsimon
8cb0b7d043
Fixed unit tests: adapted lwipopts.h and fixed test_tcp_new_counters_pcb() after adding snd_wnd_max to struct tcp_pcb.
2012-02-22 21:34:22 +01:00
goldsimon
b6cdeeef8e
Added lwipopts.h file for unit tests
2012-02-16 13:11:04 +01:00
goldsimon
ac2175fa7d
fixed pbuf leak when PPP session is aborted through pppSigHUP() (bug #35541 : PPP Memory Leak)
2012-02-16 12:55:14 +01:00
goldsimon
5816bab6a2
fixed bug #35531 : Impossible to send multicast without a gateway (introduced when fixing bug# 33551)
2012-02-16 12:30:52 +01:00
goldsimon
d0d650aa67
Patch by Stéphane Lesage:
...
fixed bug #35536 SNMP: error too big response is malformed
2012-02-16 08:01:54 +01:00
goldsimon
6d5ec9c998
fixed bug #35537 : MEMP_NUM_* sanity checks should be disabled with MEMP_MEM_MALLOC==1
2012-02-16 07:33:38 +01:00
goldsimon
fe08467e45
Removed unused variable in ip_debug_print()
2012-02-14 21:29:14 +01:00
goldsimon
26e03b81fe
Fixed unused variable warning
2012-02-14 19:41:46 +01:00
goldsimon
f6582fd229
Correctly calculate the default value of MEMP_NUM_SYS_TIMEOUT as needed
2012-02-13 21:38:48 +01:00
goldsimon
5e87126c38
Multiple compilation fixes:
...
- use C style comments, not C++ style;
- don't use #if with undefined parameter;
2012-02-13 21:38:28 +01:00
goldsimon
c279692cfe
Fixed unused local variable warning (patch #7711 )
2012-02-13 20:41:58 +01:00
goldsimon
7d0dab9d7d
partly fixed bug #25882 : TCP hangs on MSS > pcb->snd_wnd (by not creating segments bigger than half the window)
2012-02-12 14:14:19 +01:00
goldsimon
16555ad12e
tcp pcb: persist_cnt can be u8_t instead of u32_t (since it is compared against u8_t only)
2012-02-12 14:04:59 +01:00
goldsimon
9a95c2ff08
fixed bug #35435 : No pcb state check before adding it to time-wait queue while closing
2012-02-11 18:15:17 +01:00
Ivan Delamer
1d6347c9b0
Allow unicast NA messages without LLA option, in accordance to RFC2461
...
section 4.4, and as suggested by Phillip Toelke.
Change-Id: Ic9d9a6ad82ec201d25b9fc024936cfb1b41f1a7a
2012-01-27 14:54:39 -07:00
goldsimon
13075460ea
fixed bug #35305 : pcb may be freed too early on shutdown(WR)
2012-01-22 11:18:36 +01:00
goldsimon
4c3dfb92b7
fixed bug #34636 : FIN_WAIT_2 - Incorrect shutdown of TCP pcb: don't let PCBs time out from FIN_WAIT_2 if the RX side wasn't close (by either calling tcp_close or tcp_shutdown(RDWR))
2012-01-21 18:05:15 +01:00
goldsimon
fc2efaeb8c
Fixed my last chagne to pbuf_copy
2012-01-21 16:57:53 +01:00
goldsimon
b15e60243b
- fixed bug #35151 : DHCP asserts on incoming option lengths;
...
- fixed wrong CHANGELOG of the last commit
2012-01-20 21:36:52 +01:00
goldsimon
f2de3215c3
pbuf_copy(): moved the check for "p_to != NULL" to a better place.
2012-01-20 21:21:10 +01:00
goldsimon
efbad07643
fixed bug #35291 : NULL pointer in pbuf_copy
2012-01-20 21:19:26 +01:00
goldsimon
69d61eda01
Added option CHECKSUM_GEN_ICMP
2012-01-16 09:40:15 +01:00
goldsimon
e9255d3714
Merge branch 'master' of git.sv.gnu.org:/srv/git/lwip
2012-01-12 15:40:41 +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
8114627d6a
Fixed typo in define check: LWIP_IPv6_FRAG -> LWIP_IPV6_FRAG
2011-12-14 21:42:51 +01:00
goldsimon
5048a30fc7
Another fix for bug #32417 (debug assert that fires)
2011-12-06 21:21:44 +01:00
Ivan Delamer
ce6fb83ef4
bug #34846 : time-exceeded was sometimes not sent to original fragment
...
source, but to the sender of a packet fragment that triggered a buffer
purge.
Change-Id: I4bf20747bd900150491852649918a85cb7bf2aad
2011-11-29 12:49:43 -07:00
Ivan Delamer
85f8a59d7f
Added parenthesis to netif/ip6 macros.
...
Change-Id: I32d7f28c9e106641e3d5be8342d2c884e166bb0e
2011-11-28 14:07:53 -07:00
goldsimon
dd8729063c
fixed bug #31177 : tcp timers can corrupt tcp_active_pcbs in some cases
2011-11-25 18:36:52 +01:00
goldsimon
14c766e750
fix for bug #34684 was wrong (netif for arp table entries was only set/reset with SNMP enabled)
2011-11-24 21:11:11 +01:00
goldsimon
3a11a8a01d
Merge branch 'master' of git.sv.gnu.org:/srv/git/lwip
2011-11-24 07:47:40 +01:00
goldsimon
988815579a
fixed bug #34884 : sys_msleep() body needs to be surrounded with '#ifndef sys_msleep'
2011-11-23 20:58:19 +01:00
goldsimon
d1fa13ed52
fix compilation of ip_canforward on 8-/16-bit platforms (where constants are 16-bit and thus cannot be left-shifted by 24)
2011-11-23 09:09:22 +01:00
goldsimon
08b497faea
fixed bug #34684 : Clear the arp table cache when netif is brought down
2011-11-22 21:44:28 +01:00
goldsimon
96d332e234
Fix icmp6_send_response: cannot assign (packed) ip6_addr_p_t* to ip6_addr_t* -> need to copy the packed address to an aligned address first
2011-11-22 21:41:20 +01:00
Ivan Delamer
440f31a4d3
Add IPv6 timeouts to check for MEMP_NUM_SYS_TIMEOUT).
...
Change-Id: Ic6a9493cde41652391b34a47e6003b9036f760de
2011-11-17 14:24:16 -07:00
Ivan Delamer
cb91705e03
Generate ICMPv6 responses from a context other than input callback
...
(e.g. timers in IPv6 reassembly). see bug #34846 .
Change-Id: I6b4d27c819291d8371c43288310d57c3f2c1c65f
2011-11-17 10:55:45 -07:00
goldsimon
d12e742373
Fixed bug #34733 Null pointer exception with SOCKET_DEBUG.
2011-11-13 17:06:19 +01:00
goldsimon
7aa7c0f481
SEQ-comparing defines: cast parameters to u32_t for clarity
2011-10-29 21:43:13 +02:00
Ivan Delamer
b3ffa16315
Use pppRecvWakeup only if PPP_INPROC_OWNTHREAD is defined.
...
Change-Id: Ie800289eb5f6a64d0be1d38eab7154d4aa473d57
2011-10-28 16:22:54 -06:00
Ivan Delamer
09d1f55bce
Conditional compilation in ppp.c according to PPP_ options.
...
Change-Id: I466ce2b0114c9428f5e21bd0a09bb221f40bfc3e
2011-10-28 14:23:20 -06:00
Ivan Delamer
21333d0f18
handle NULL when parsing IPv6 address (check for formatting)
...
Change-Id: I42e1288689946c295e0bd1490a5eb4d8befb5877
2011-10-28 13:54:16 -06:00
goldsimon
edcc859b58
fixed bug #34638 : Dead code in tcp_receive - pcb->dupacks
2011-10-28 13:09:04 +02:00
Ivan Delamer
2ce17a724a
Fix bug #34526 : nd6_queue_packet() frees too much if out-of-memory
...
Change-Id: Ib7ac0cb1b5a5389dd5449a908485493bd085ba9d
2011-10-26 14:31:48 -06:00
goldsimon
0fb07ba328
- moved processing of refused_data to an own function (used from tcp_fasttmr and tcp_input);
...
- improved readability of tcp_slowtmr by using defines to access keepalive variables
2011-10-23 18:10:46 +02:00
goldsimon
78f0307246
Slipif: fixed IPv6 support
2011-10-23 17:38:23 +02:00
goldsimon
c5203ab5ea
fixed bug #34429 : possible memory corruption with LWIP_ALLOW_MEM_FREE_FROM_OTHER_CONTEXT set to 1
2011-10-23 17:31:03 +02:00
goldsimon
3d1a306518
SLIP netif: add support for multiple input strategies (threaded, polling, RX from ISR)
2011-10-21 22:25:44 +02:00
goldsimon
2750d61e92
added missing valid/set_invalid defines for NO_SYS
2011-10-21 19:47:37 +02:00
goldsimon
43ac5ad70d
removed the need to disable ARP_QUEUEING when LWIP_ARP is disabled an TCP_QUEUE_OOSEQ when LWIP_TCP is disabled
2011-10-21 13:24:33 +02:00
goldsimon
309e936ad9
Fix default value of TCP_SNDLOWAT for small values of TCP_SND_BUF (broken with my 2nd-last commit)
2011-10-19 12:55:32 +02: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
Simon Goldschmidt
01839b9c14
fixed default values of TCP_SNDLOWAT and TCP_SNDQUEUELOWAT for small windows (bug #34176 select after non-blocking send times out)
2011-10-18 20:22:09 +02:00
Simon Goldschmidt
1f396946e5
fixed bug #34587 : TCP_BUILD_MSS_OPTION doesn't consider netif->mtu, causes slow network
2011-10-18 20:11:39 +02:00
goldsimon
2f58ef781c
fixed bug #34581 missing parentheses in udplite sockets code
2011-10-18 11:04:08 +02:00
goldsimon
8b9f70ac08
fixed bug #34580 fcntl() is missing in LWIP_COMPAT_SOCKETS
2011-10-18 11:00:10 +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
0333e81616
fixed bug #34517 (persist timer is started although no zero window is received) by starting the persist timer when a zero window is received, not when we have more data queued for sending than fits into the window
2011-10-13 21:18:16 +02:00
Simon Goldschmidt
cf1be4ae2d
fixed bug #34541 : LWIP_U32_DIFF is unnecessarily complex: removed that define
2011-10-13 19:29:48 +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
c74d881d3d
fixed bug #34534 : Error in sending fragmented IP if MEM_ALIGNMENT > 4
2011-10-12 18:17:07 +02:00
Simon Goldschmidt
ab51f3bec0
added unit test cases for seqno wraparound on fast-rexmit and rto-rexmit (unsent/unacked lists must be correctly sorted)
2011-10-11 21:43:27 +02:00
Simon Goldschmidt
b4c4fae3f5
slightly rearranged freeing an acked segment to prevent keeping the reference too long
2011-10-11 21:41:58 +02:00
Simon Goldschmidt
ce98df59f1
Added unit test case for persist timer / zero window probes
2011-10-10 21:06:50 +02:00
Simon Goldschmidt
f29bdd21a7
fixed bug #34426 : tcp_zero_window_probe() transmits incorrect byte value when pcb->unacked != NULL
2011-10-09 20:11:33 +02:00
Simon Goldschmidt
9d31401d47
fixed bug #34447 LWIP_IP_ACCEPT_UDP_PORT(dst_port) wrong
2011-10-09 14:30:49 +02:00
Simon Goldschmidt
5c68bbe16f
Tried to fix bug #32417 ("TCP_OVERSIZE seems to have problems with (fast-)retransmission"): Reset pcb->unsent_oversize in 2 more places...
2011-09-29 21:12:34 +02:00
Simon Goldschmidt
07c610e068
Implemented limiting data on ooseq queue (task #9989 ) (define TCP_OOSEQ_MAX_BYTES / TCP_OOSEQ_MAX_PBUFS in lwipopts.h), added unit test for this new feature
2011-09-27 22:42:46 +02:00
Simon Goldschmidt
998f109fc8
fixed bug #28288 : Data after FIN in oos queue
2011-09-27 21:08:49 +02:00
goldsimon
cfb70bccc1
bug #34406 dhcp_option_hostname() can overflow the pbuf
2011-09-27 07:49:04 +02:00
Simon Goldschmidt
7524f9006e
added unit tests for data-after-FIN
2011-09-26 22:10:11 +02:00
Simon Goldschmidt
bcfe3dacc6
fixed unit tests (one TCP test failed, removed comma at the end of array initializers)
2011-09-26 22:09:27 +02:00
Simon Goldschmidt
6c56151d27
fixed bug #34377 MEM_SIZE_F is not defined if MEM_LIBC_MALLOC==1
2011-09-24 13:59:33 +02:00
Simon Goldschmidt
98274d2145
Reverted invalid fix for invalid bug #34360 done yesterday...
2011-09-23 19:26:29 +02:00
Simon Goldschmidt
1d125f55ba
Merge branch 'master' of ssh://git.sv.gnu.org/srv/git/lwip
2011-09-23 19:16:01 +02:00
Simon Goldschmidt
918470affc
fixed bug #33871 : rejecting TCP_EVENT_RECV() for the last packet including FIN can lose data
2011-09-23 19:14:17 +02:00
Simon Goldschmidt
797f26e45b
fixed bug #34360 tcp_shutdown: RST on unacked is not send when shutting down both rx AND tx
2011-09-22 21:38:56 +02:00
Simon Goldschmidt
e145c1d31c
Fixed tcp_accepted define (need brackets around the parameter)
2011-09-22 19:19:07 +02:00
Simon Goldschmidt
bb5d0c5c4a
fixed bug #34355 : nagle does not take snd_buf/snd_queuelen into account
2011-09-22 18:50:18 +02:00
Simon Goldschmidt
0aea1b608a
Corrected fix for bug #34072 (UDP broadcast is received from wrong UDP pcb if udp port matches): pcbs bound to IPADDR_ANY did not receive broadcasts any more (bug #34294 )
2011-09-22 06:24:58 +02:00
Simon Goldschmidt
a2aa43a426
Implemented timeout on send (TCP only, bug #33820 )
2011-09-21 19:36:09 +02:00
Simon Goldschmidt
8d5514603e
fixed default value of TCP_SND_BUF to not violate the sanity checks in init.c
2011-09-21 18:47:44 +02:00
Simon Goldschmidt
b9a2feff5e
Converted runtime-sanity-checks into compile-time checks that can be disabled (since runtime checks can often not be seen on embedded targets)
2011-09-21 18:35:29 +02:00
goldsimon
f13615d97a
fixed bug #34337 (possible NULL pointer in sys_check_timeouts)
2011-09-20 07:21:19 +02:00
Simon Goldschmidt
d6227aece6
splitted ppp.h to an internal and external header file to get a clear separation of which functions an application or port may use (task #11281 )
2011-09-11 19:30:28 +02:00
Simon Goldschmidt
6058389974
nd6: use a static buffer to process RA options instead of using mem_malloc()
2011-09-11 13:44:08 +02:00
Simon Goldschmidt
dccad08508
use pcb->mss instead of TCP_MSS for preallocate mss-sized pbufs (bug #34019 )
2011-09-11 13:13:26 +02:00
Simon Goldschmidt
112158b056
Added a config option to randomize initial local TCP/UDP ports (so that different port ranges are used after a reboot; bug #33818 ; this one added tcp_init/udp_init functions again);
...
fixed a possible endless loop in tcp_new_port() if the number of active PCBs exceeds the number of available ports;
2011-09-11 12:44:01 +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
1b98a64e90
Fixed typo: TCP_SNDQUEUELOWAT must be less than TCP_SND_QUEUELEN (as checked in init.c), not greater
2011-09-09 22:28:01 +02:00
Simon Goldschmidt
4849eb4c54
fixed bug #34072 : UDP broadcast is received from wrong UDP pcb if udp port matches
2011-09-09 22:25:59 +02:00
Simon Goldschmidt
5e8ee7e006
Make LWIP_RAND optional (useful for small targets)
2011-09-03 22:27:30 +02:00
Simon Goldschmidt
e27d34d118
DHCP uses LWIP_RAND() for xid's (bug #30302 )
2011-09-03 22:27:06 +02:00
Simon Goldschmidt
a0bf8d5740
fixed bug #33952 PUSH flag in incoming packet is lost when packet is aggregated and sent to application
2011-09-03 21:57:26 +02:00
Simon Goldschmidt
17a5ba08e4
unit tests: correctly handle small PBUF_POOL_BUFSIZE settings, prevent NULL-pointer-deref. (ooseq test is still not running correctly...)
2011-09-03 21:25:51 +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
55011e5308
fixed bug #31809 LWIP_EVENT_API in opts.h is inconsistent compared to other options
2011-09-01 22:25:03 +02:00
Simon Goldschmidt
2697b3c7da
Merge branch 'master' of ssh://git.sv.gnu.org/srv/git/lwip
2011-09-01 21:01:38 +02:00
Simon Goldschmidt
b9c17dd1f0
fixed bug #34111 RST for ACK to listening pcb has wrong seqno
2011-09-01 21:00:11 +02:00
goldsimon
aea17bfae2
Fixed bogus IPH_V/HL and IPH_VHL_SET endianess dependency
2011-08-30 13:15:10 +02:00
Simon Goldschmidt
0a5755145c
added netif remove callback (bug #32397 )
2011-08-24 22:00:10 +02:00
Simon Goldschmidt
249e19769b
fixed bug #34124 struct in6_addr does not conform to the standard
2011-08-24 21:40:09 +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
Simon Goldschmidt
2e69b54a4f
fixed bug #34057 socklen_t should be a typedef
2011-08-24 20:22:21 +02:00
Simon Goldschmidt
cd5d1ceadf
fixed bug #34112 Odd check in pbuf_alloced_custom (typo)
2011-08-24 20:18:47 +02:00
Simon Goldschmidt
c55f6b40ec
fixed bug #34122 dhcp: hostname can overflow
2011-08-24 20:12:23 +02:00
Simon Goldschmidt
bf4ec9be22
fixed bug #34121 netif_add/netif_set_ipaddr fail on NULL ipaddr
2011-08-24 19:52:06 +02:00
Simon Goldschmidt
ed0626afeb
fixed bug #33962 TF_FIN not always set after FIN is sent. (This merely prevents nagle from not transmitting fast after closing.)
2011-08-22 18:52:27 +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
Ivan Delamer
17efa04ea6
Add cast to IP6_ADDR_BLOCKx
2011-08-09 13:55:40 -06:00
Ivan Delamer
b3f5c8f6b2
Use target address as source address in IPv6 neighbour advertisement
...
messages.
Change-Id: I06d28eb2903c539de0b51bd7420a81ebf4f28963
2011-08-04 16:36:44 -06:00
Ivan Delamer
4507083148
Fixed bug in serialization of IPv6 addresses.
...
Change-Id: Ib63540123803317ec25f7cbf580c5159e4100222
2011-08-04 14:18:33 -06:00
Simon Goldschmidt
f4c0018d7a
Fixed complier error for CHECKSUM_CHECK_TCP==0
2011-07-28 21:59:28 +02:00
Simon Goldschmidt
c9e1d6cca8
adapted unit tests to changes after adding IPv6 support
2011-07-26 21:55:32 +02:00
Simon Goldschmidt
242dc34115
ETHARP_SUPPORT_VLAN: add support for an external VLAN filter function instead of only checking for one VLAN (define ETHARP_VLAN_CHECK_FN)
2011-07-26 21:03:27 +02:00
Simon Goldschmidt
41c785d77a
IPv4: splitted IPv4 header fields version/len and tos, made macros depend on BYTE_ORDER to prevent unnecessary calls to htons()
2011-07-26 20:55:32 +02:00
Simon Goldschmidt
a745528b40
Prevent non-static function that is not declared in header file
2011-07-26 20:21:33 +02:00
Simon Goldschmidt
7465be91d0
Fixed some C compiler warnings
2011-07-24 17:19:17 +02:00
Simon Goldschmidt
d79c5baa1b
Removed commas from the end of enum lists
2011-07-24 17:18:55 +02: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
6323e09a0a
init.c: changed some checks from runtime to compiletime (had to adapt some defines in ip.h for that)
2011-07-22 21:59:16 +02:00
Simon Goldschmidt
d94bdb75c8
forgot CHANGELOG: freeing ooseq pbufs when the pbuf pool is empty implemented for NO_SYS==1: when not using sys_check_timeouts(), call PBUF_CHECK_FREE_OOSEQ() at regular intervals from main level.
2011-07-22 21:07:09 +02:00
Simon Goldschmidt
cc3b4dff20
freeing ooseq pbufs when the pbuf pool is empty implemented for NO_SYS==1: when not using sys_check_timeouts(), call PBUF_CHECK_FREE_OOSEQ() at regular intervals from main level.
2011-07-22 21:05:10 +02:00
Simon Goldschmidt
78ac382fdf
bug #33634 ip_forward() have a faulty behaviour: Added pbuf flags to mark incoming packets as link-layer broadcast/multicast. Also added code to allow ip_forward() to forward non-broadcast packets to the input netif (set IP_FORWARD_ALLOW_TX_ON_RX_NETIF==1).
2011-07-21 21:47:25 +02:00
Simon Goldschmidt
860072aaaf
correctly prefix all functions with 'etharp_' (also static functions)
2011-07-21 21:16:04 +02:00
Simon Goldschmidt
2694a409c6
ETHARP_STATE_STABLE_REREQUESTING: no need for member 'netif' in 'struct etharp_entry' if we re-request only from etharp_output() and use etharp_tmr() to reset the state of such entries to ETHARP_STATE_STABLE: that way, we also only send one ARP request per ARP_TMR_INTERVAL, but only if the entry is really still used.
2011-07-21 20:47:29 +02:00
Simon Goldschmidt
206b1f4631
ETHARP_SUPPORT_STATIC_ENTRIES: don't need the member 'static_entry' on struct etharp_entry, we can use 'state' to mark them as static
2011-07-21 20:40:30 +02:00
Simon Goldschmidt
ef9891e8ff
fixed bug #33551 (ARP entries may time out although in use) by sending an ARP request when an ARP entry is used in the last minute before it would time out.
2011-07-21 20:28:18 +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
fc280c7cd6
Fixed bug #33804 LWIP_IPV6_MLD #define missing from mld6.c
2011-07-20 06:56:20 +02:00
Simon Goldschmidt
435ac2a650
Fixed bug #33801 Corruption of nd6 tables
2011-07-19 21:56:19 +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
1f4b814d0b
Include opt.h so that LWIP_ERROR works correctly
2011-07-06 07:13:45 +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
goldsimon
09ac68c196
Fixed documentation after changing sys arch prototypes for 1.4.0
2011-07-04 19:33:33 +00:00
goldsimon
c2fd905e32
No need to pass 'acc' as u16_t since the _base functions are internal (we save one AND op when passing as u32_t)
2011-07-04 19:10:49 +00:00
goldsimon
cc84f28d1b
Fixed bug #33672 (checksum calculate error!!!) by folding 'acc' to u16_t before calling checksum_pseudo_*_base functions
2011-06-29 19:54:33 +00:00
goldsimon
2bd498524d
Fixed bug #33653 (ip_data.current_ip_header_tot_len calculation errors!) introduced while mergin IPv4 and IPv6
2011-06-29 19:46:21 +00:00
goldsimon
4b934945f3
Slightly reorderd fields of struct tcp_pcb to plug holes introduced by member alignment (to reduce RAM usage)
2011-06-26 17:53:45 +00:00
goldsimon
b666ab0673
Init checks: LWIP_RAND is needed for IPv6, too
2011-06-26 17:51:55 +00:00
goldsimon
6a4c30fe5d
fixed bug #31723 (tcp_kill_prio() kills pcbs with the same prio) by updating its documentation only.
2011-06-26 17:37:09 +00:00
goldsimon
4002aef594
fixed bug #33545 : With MEM_USE_POOLS==1, mem_malloc can return an unaligned pointer.
2011-06-26 17:31:10 +00:00
goldsimon
ba28d36e67
Fixed bug #33544 (warning in mem.c in lwip 1.4.0 with NO_SYS=1)
2011-06-26 17:13:57 +00:00
goldsimon
4444db2990
Added some more asserts to check that pcb->state != LISTEN
2011-06-26 17:07:13 +00:00
goldsimon
d0026793bf
Cleaned up usage of sys.h a bit
2011-06-26 16:51:04 +00:00
goldsimon
93b5cd5ddd
Provide a default for SNMP_GET_SYSUPTIME() based on sys_now()
2011-06-26 16:50:28 +00:00
goldsimon
12c2d7e4cf
- changed "struct ip_addr" to "ip_addr_t";
...
- tcp_accepted(): added a note to call this on the listening pcb, not the connection pcb;
- tcp_write(): change last parameter from "copy" to "apiflags", documented the apiflags
2011-06-25 18:39:37 +00:00
idelamer
4eb5acd9e2
Don't forward IPv6 packets that are larger than outgoing MTU, send ICMPv6 message back for Path MTU discovery.
2011-06-22 12:14:58 +00:00
idelamer
0f56d838ec
Process IPv6 packets arriving from non-Ethernet links.
2011-06-17 11:06:06 +00:00
idelamer
12a948dacb
Allow routing IPv6 packets to neighbours with manually-configured non-link-local addresses.
2011-06-17 11:05:38 +00:00
idelamer
137953605e
Allow IPv6 addresses with arbitrary prefix.
2011-06-17 11:04:47 +00:00
idelamer
629fad6f5f
Minor edits for for IPv6 compilation
2011-06-17 11:03:15 +00:00
goldsimon
2911c84a69
Fixed compilation error after converting sockaddr_aligned from struct to union
2011-06-12 11:57:34 +00:00
goldsimon
89a1420609
Fix compilation error when checking for hidden variable names ('s8_t i' was hidden in some case statements in nd6_input()).
2011-06-08 16:31:55 +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
2ed5413e24
use const char for name pointers in display functions
2011-06-07 19:32:20 +00:00
goldsimon
91532b2d5c
Removed unused static function
2011-06-07 19:19:24 +00:00
goldsimon
732cac1c0e
Moved static variable from inside the function to global scope
2011-06-07 19:10:55 +00:00
goldsimon
5b04860b8b
Moved common call to pbuf_header outside the switch()
2011-06-07 19:10:10 +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
d30246dc05
Fixed bug #33492 (fixed stats for IPv6 protocols)
2011-06-07 19:05:22 +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
d765c9de37
Fixed ipX_netif_get_local_ipX for LWIP_IPV6==0
2011-05-28 09:32:42 +00:00
goldsimon
98b6e2bcce
Fixed ip_2_ipX() and ip6_2_ipX() macros #if !LWIP_ALLOW_STATIC_FN_IN_HEADER
2011-05-28 09:32:07 +00:00
goldsimon
d80be7961c
use PCB_IS_IPV6(pcb) instead of pcb->isipv6 everywhere; fixed compilation with LWIP_IPV6==1 but LWIP_IGMP==0
2011-05-28 09:30:43 +00:00
goldsimon
2aec3a9789
use PCB_IS_IPV6(pcb) instead of pcb->isipv6 everywhere
2011-05-28 09:28:18 +00:00
goldsimon
ccd7dbe0e4
Added ipX versions for routing
2011-05-26 15:46:44 +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
853d1eac96
Fixed pointless conversion when checking TCP port range (bug #33398 )
2011-05-25 17:22:56 +00:00
goldsimon
2ef29d6839
Use conversion defines instead of casting IP addresses
2011-05-25 17:22:13 +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
9546e65617
Removed autoip_init() since it does nothing; minor coding style changes
2011-05-21 16:01:19 +00:00
goldsimon
5852993243
Removed files of old IPv6 implementation
2011-05-17 19:56:08 +00:00
goldsimon
90a03a77ad
Added new files for IPv6
2011-05-17 19:54:40 +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
f3c1686a40
replaced tab with spaces
2011-05-16 18:45:51 +00:00
goldsimon
33a587d97e
Added a test for fast-rexmit
2011-05-14 15:26:43 +00:00
goldsimon
a444ec5111
patch #7449 allow tcpip callback from interrupt with static memory message
2011-05-14 12:23:10 +00:00
kieranm
5ead1bf5c8
Update version numbers for 1.4.1 development
2011-05-06 09:07:38 +00:00
kieranm
3a267586f4
Update CHANGELOG and version numbers for 1.4.0 release
2011-05-06 08:48:37 +00:00
goldsimon
52271e0366
Used upper case 'L' instead of lower case 'l' for long constant for better readability
2011-04-29 11:37:29 +00:00
goldsimon
e4739da961
Fixed overflow in tcp_new_port() after changing port range to IANA "Dynamic and/or Private Ports" range
2011-04-29 11:23:04 +00:00
goldsimon
80b344e9fc
Fixed printf-format error (bug #33079 )
2011-04-21 05:15:45 +00:00
goldsimon
036cb26fa3
sys_arch_timeouts() is not needed any more.
2011-04-20 11:31:07 +00:00
goldsimon
33d6dcec5b
Fixed bug #33048 (Bad range for IP source port numbers) by using ports in the IANA private/dynamic range (49152 through 65535).
2011-04-13 17:52:00 +00:00
goldsimon
791505ab6e
Fixed tcp unit tests after introducing ip_addr_p_t and letting tcp_input check for broadcasts by using current_iphdr_dest.
2011-03-30 18:50:00 +00:00
goldsimon
88e1719d8e
Fixed etharp unit test after changing struct etharp_hdr
2011-03-30 18:47:20 +00:00
goldsimon
0885555521
Fixed broken VLAN support.
2011-03-29 18:56:26 +00:00
goldsimon
36c1750b8f
ethernet_input: check for minimum packet length to prevent assertions from firing.
2011-03-29 07:55:16 +00:00
goldsimon
11b1c9f19f
Fixed bug #32926 (TCP_RMV(&tcp_bound_pcbs) is called on unbound tcp pcbs) by checking if the pcb was bound (local_port != 0).
2011-03-27 17:12:26 +00:00
goldsimon
b5dd87b184
Fixed bug #32280 (ppp: a pbuf is freed twice)
2011-03-27 13:58:26 +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
783404d8d4
Move tcp_pcb_lists to const section.
2011-03-27 13:04:16 +00:00
goldsimon
3bad9f013e
Fixed bug #32820 (Outgoing TCP connections created before route is present never times out) by starting retransmission timer before checking route.
2011-03-27 13:00:54 +00:00
goldsimon
4495516497
Removed 'dataptr' from 'struct tcp_seg' and calculate it in tcp_zero_window_probe (the only place where it was used).
2011-03-27 12:56:16 +00:00
goldsimon
3f849848a4
Fixed bug #32648 (PPP code crashes when terminating a link) by only calling sio_read_abort() if the file descriptor is valid.
2011-03-22 20:59:49 +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
5b084f4b95
tcp_bind: return ERR_VAL instead of ERR_ISCONN when trying to bind with state!=CLOSED; fixed a typo
2011-03-13 11:15:32 +00:00
goldsimon
4e3b2b9f6b
Fixed bug #32561 tcp_poll argument definition out-of-order in documentation
2011-02-21 19:26:57 +00:00
goldsimon
856ccb5bb7
Added missing U/UL modifiers to fix 16-bit-arch portability.
2011-02-18 13:31:28 +00:00
goldsimon
dbf5659cd9
Indentation changed
2011-02-18 13:30:35 +00:00
goldsimon
fee0c6afe9
Fixed constant not being 32 bit.
2011-02-17 17:03:12 +00:00
kieranm
fb7d3a159a
Update version for 1.4.0 rc2
2011-02-03 12:46:56 +00:00
goldsimon
dc6b4e65e0
Adde missing extern "C"
2011-01-25 11:35:48 +00:00
goldsimon
17d4ef4053
Added missing "extern "C" {"
2011-01-25 06:18:50 +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
1bd06bee82
Added note about changed ARP_QUEUEING==0
2010-12-02 20:09:58 +00:00
goldsimon
92cdc1e33f
Fixed ERR_IS_FATAL so that ERR_WOULDBLOCK is not fatal.
2010-12-02 07:07:18 +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
f7627929d5
Fixed bug #31722 : IP packets sent with an AutoIP source addr must be sent link-local
2010-11-22 19:55:05 +00:00
goldsimon
b49cf5e7a2
patch #7328 : Autoip: ETHADDR16_COPY can be used
2010-11-22 17:35:57 +00:00
goldsimon
231a6cecb4
patch #7329 : tcp_timer_needed prototype was ifdef'ed out for LWIP_TIMERS==0
2010-11-22 17:32:12 +00:00
goldsimon
32f02325f9
Added a function to deallocate the struct dhcp from a netif (fixes bug #31525 ).
2010-11-21 13:41:11 +00:00
goldsimon
f418782c2c
tcp_slowtmr(): change the scope of 'pcb2' to reflect its block-only usage.
2010-11-21 10:41:27 +00:00
goldsimon
e52730d1fb
Fixed bug #31170 : lwip_setsockopt() does not set socket number
2010-11-20 18:01:01 +00:00
goldsimon
d2679e58a6
Fixed bug #31304 : Changed SHUT_RD, SHUT_WR and SHUT_RDWR to resemble other stacks.
2010-11-20 17:48:10 +00:00
goldsimon
e3817cd549
Fixed bug #31535 : TCP_SND_QUEUELEN must be at least 2 or else no-copy TCP writes will never succeed.
2010-11-20 17:34:10 +00:00
goldsimon
4ace50a7d7
Fix alignment checking of tcphdr: check for MEM_ALIGNMENT, not for 4
2010-11-20 17:30:48 +00:00
goldsimon
fa092c47c8
Fixed bug #31701 : Error return value from dns_gethostbyname() does not match documentation: return ERR_ARG instead of ERR_VAL if not initialized or wrong argument.
2010-11-20 16:40:35 +00:00
goldsimon
704d90f693
Fixed bug #31385 : sizeof(struct sockaddr) is 30 but should be 16
2010-10-20 17:58:52 +00:00
goldsimon
93dc36e091
Once again fixed #30038 : DHCP/AutoIP cooperation failed when replugging the network cable after an AutoIP address was assigned.
2010-10-06 11:40:30 +00:00
goldsimon
4cc36b2284
Fixed bug #30728 : tcp_new_port() did not check listen pcbs
2010-08-10 20:15:31 +00:00
goldsimon
aaa8d2795e
Don't chain empty pbufs when sending them (fixes bug #30625 )
2010-08-03 08:38:59 +00:00
goldsimon
229137cad1
Applied patch #7264 (PPP protocols are rejected incorrectly on big endian architectures)
2010-08-01 11:15:48 +00:00
goldsimon
d73262a0e5
Fixed compilation with TCP or UDP disabled.
2010-07-29 19:25:50 +00:00
goldsimon
cd22a8d851
Fixed bug #30565 (tcp_connect() check bound list): that check did no harm but never did anything
2010-07-28 16:48:51 +00:00
goldsimon
7f7df4ae19
Fixed bug #30447 : tcp.c:tcp_bind() - suspicious nested #if
2010-07-28 16:44:59 +00:00
goldsimon
3c5723e49d
Fixed invalid fix for bug #30402 (CHECKSUM_GEN_IP_INLINE does not add IP options)
2010-07-21 12:11:22 +00:00
kieranm
960fb14bf5
Update release number for 1.4.0 release candidate 1
2010-07-16 12:50:29 +00:00
kieranm
21e17f649a
Fixed SNMP ASN constant defines to not use ! operator
2010-07-16 12:14:01 +00:00
goldsimon
9782c40d21
fixed the change not about tcp_close chang (bug #30444 )
2010-07-14 15:53:44 +00:00
goldsimon
04beab4f7d
IP_MULTICAST_LOOP shall be disabled by default
2010-07-12 14:10:28 +00:00
goldsimon
194a85387b
patch #7239 : make tcp_state_str pointers constant
2010-07-12 09:49:00 +00:00
goldsimon
a99219ad1f
added missing casts
2010-07-12 09:34:17 +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
714a43b18c
Fixed bug #30402 : CHECKSUM_GEN_IP_INLINE does not add IP options
2010-07-10 12:02:28 +00:00
goldsimon
9f457d3331
Updated to current CHANGELOG
2010-07-06 20:18:12 +00:00
goldsimon
60a456f757
Added ip_addr_netmask_valid() to check if a netmask is valid (starting with ones, then only zeros)
2010-07-05 14:20:58 +00:00
goldsimon
2b355d6b34
Added some helper functions to find strings in chained pbufs
2010-07-05 14:18:03 +00:00
goldsimon
48be546357
fixed bug #30300 (shutdown parameter was not initialized in netconn_delete)
2010-06-30 08:33:14 +00:00
goldsimon
0f74a57267
Re-enabled timer logging if LWIP_DEBUG_TIMERNAMES!=0 (without function pointers, only function names), changed parameter names from 'h' to 'handler'
2010-06-29 19:55:21 +00:00
kieranm
272270c7f4
Remove unportable printing of C function pointers
2010-06-28 13:32:13 +00:00
kieranm
e2f014f457
cleanup: fix minor build failures on unix
2010-06-28 13:24:14 +00:00
goldsimon
1fba33628d
Fixed compilation error due to unexpected include order
2010-06-25 18:59:29 +00:00
goldsimon
7d604a23f0
From patch #7221 : added flag NO_SYS_NO_TIMERS to drop timer support for NO_SYS==1 for easier upgrading
2010-06-24 20:27:49 +00:00
goldsimon
6929a786aa
Fixed bug #10088 : Correctly implemented shutdown at socket level.
2010-06-24 19:33:14 +00:00
goldsimon
f61b80ca6a
Fixed bug #29361 (ip_frag has problems with zero-copy DMA MACs) by adding custom pbufs and implementing custom pbufs that reference other (original) pbufs. Additionally set IP_FRAG_USES_STATIC_BUF=0 as default to be on the safe side.
2010-06-21 18:50:16 +00:00
goldsimon
1aba9f031d
nicer code for the last fix
2010-06-17 11:53:16 +00:00
goldsimon
2ffcc52f03
Fixed bug #30159 : WomnIP_ACCEPT_LINK_LAYER_ADDRESSING
2010-06-16 19:53:07 +00:00
goldsimon
72518a0d6e
fixed typos that MSVS did not complain about
2010-06-16 12:53:46 +00:00
goldsimon
1242575f0f
Added an optional define (LWIP_IP_ACCEPT_UDP_PORT) that can allow link-layer-addressed UDP traffic to be received while a netif is down (just like DHCP during configuration)
2010-06-16 12:25:00 +00:00
goldsimon
6ccc2ef804
Removed leading underscore from struct name, added a comment
2010-06-15 20:33:40 +00:00
goldsimon
b3dc6f2b5b
... and forgot one tiny character...
2010-06-15 20:21:30 +00:00
goldsimon
2427917db8
Fixed bug #29970 : DHCP endian issue parsing option responses
2010-06-15 20:19:14 +00:00
goldsimon
5ab40f016d
Fixed bug #30039 : AutoIP does not reuse previous addresses
2010-06-14 20:27:14 +00:00
goldsimon
435115d4fb
Use ip_addr_set_zero instead of memset(0)
2010-06-14 20:17:08 +00:00
goldsimon
24d823dae6
bug #30129 : struct _ip_addr should be struct ip_addr
2010-06-14 19:52:45 +00:00
goldsimon
2c60a48d02
ip_addr_set_any does not work on pointers...
2010-06-14 19:52:17 +00:00
goldsimon
4b0be4a477
Fixed invalid fix for bug #30038
2010-06-14 19:18:11 +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
66b57f89df
Fixed bug #30038 : dhcp_network_changed doesn't reset AUTOIP coop state
2010-06-12 17:14:00 +00:00
goldsimon
69bd5a29d9
Fixed a possible NULL-pointer deref before checking it
2010-06-12 17:05:54 +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
9bfeb4e5af
Minor: added some spaces for indentation
2010-05-22 21:01:38 +00:00
goldsimon
d3e5ade2da
Correctly NULL-terminate h_addr_list
2010-05-17 12:36:45 +00:00
goldsimon
3833dd86aa
Added LWIP_DEBUGF warning if dns_send returns an error
2010-05-17 12:29:31 +00:00
goldsimon
25f33c8444
struct etharp_hdr: split _hwlen_protolen into two u8_t's to prevent using htons on little-endian platforms
2010-05-16 16:26:12 +00:00
goldsimon
dae247809b
Add preprocessor-macros for compile-time htonl calculation (and use them throughout the stack where applicable)
2010-05-16 15:57:42 +00:00
goldsimon
81df8bdabd
Added PP_HTONx/PP_NTOHx macros that can be calculated by the preprocessor (used for constants only)
2010-05-16 15:55:45 +00:00
goldsimon
03e4eb4de8
changed the semantics of LWIP_PREFIX_BYTEORDER_FUNCS to prevent "symbol already defined" i.e. when linking to winsock
2010-05-16 15:09:55 +00:00
goldsimon
290bd400c3
No need to call pppoe_init any more (since the linked list is implicitly initialized to zero by the loader)
2010-05-16 14:35:03 +00:00
goldsimon
5d0785e47a
PPPoE now uses its own MEMP pool instead of the heap (moved struct pppoe_softc from ppp_oe.c to ppp_oe.h)
2010-05-16 14:34:16 +00:00
goldsimon
16434568b0
Use a simple linked list (next pointer) instead of sys/queue.h (from BSD)
2010-05-16 14:24:40 +00:00
goldsimon
c0e7d54e37
Removed 2 mem_mallocs: error string can be a global variable, include memory for sc_ac_cookie in struct pppoe_softc; commented out unused code (sc_service_name/sc_concentrator_name)
2010-05-16 14:11:53 +00:00
goldsimon
ccb53d9e7d
DNS_LOCAL_HOSTLIST_IS_DYNAMIC uses its own MEMP pool instead of the heap
2010-05-16 14:06:46 +00:00
goldsimon
03bd61c799
DNS_LOCAL_HOSTLIST_IS_DYNAMIC uses its own MEMP pool instead of the heap
2010-05-16 13:36:51 +00:00
goldsimon
6ffd29507c
Free recv_data when TF_RXCLOSED is set
2010-05-16 13:12:15 +00:00
goldsimon
a880709776
Let FIN come through although TF_RXCLOSED is set, send RST when data is received although TF_RXCLOSED is set, added TCP_EVENT_CLOSED for clearer code
2010-05-15 18:12:37 +00:00
goldsimon
874d1641df
Fix compilation for LWIP_EVENT_API==1 (unused args)
2010-05-15 18:10:55 +00:00
goldsimon
d8d964d09e
udp_input/SO_REUSE_RXTOALL: only call pbuf_header if there is a 2nd pcb to pass the data to
2010-05-15 17:11:41 +00:00
goldsimon
46b3cb580d
Removed unused SOF_* flags, ip_pcb.so_options can now be an u8_t instead of an u16_t (saves 3 bytes per pcb on a 32-bit platform)
2010-05-15 17:10:08 +00:00
goldsimon
02f5e19420
udp_input: use SO_REUSE && SO_REUSE_RXTOALL to copy incoming (broad-/multicast) data to additional pcbs
2010-05-15 16:46:53 +00:00
goldsimon
a945bf07af
SO_REUSE: tcp_input: correctly handle multiple pcbs listening on the same port (but different address): first search for a specific address an only pass to ANY if no specific address has been found listening
2010-05-15 16:45:43 +00:00
goldsimon
7e5b0a9eb6
SO_REUSE: tcp_listen/tcp_connect: make sure that the 5-tuple is unique
2010-05-15 16:44:09 +00:00
goldsimon
a56795c149
Added new option SO_REUSE_RXTOALL to pass received UDP broadcast/multicast packets to more than one pcb
2010-05-15 14:52:39 +00:00
goldsimon
baeb41f5f4
SO_REUSEADDR / SO_REUSE is implemented and safe to use
2010-05-12 22:34:06 +00:00
goldsimon
d0348e0c60
task #6995 : Implement SO_REUSEADDR (correctly)
2010-05-12 22:29:58 +00:00
goldsimon
ef0a7ecbcd
Remove uused SOF_* flags, define inherited flags in ip.h, not in tcp_in.c
2010-05-12 22:26:06 +00:00
goldsimon
778c65d27c
CHECKSUM_GEN_IP_INLINE: Use defines to access the u32_t part of an IP address
2010-05-12 08:11:45 +00:00
goldsimon
f3face9f0c
Fix printf-formatter for sio_fd_t/size_t
2010-05-12 07:48:30 +00:00
goldsimon
2edd5230c9
auth_withpeer_fail(): call lcp_close(), like pppd 2.4.5 does
2010-05-11 18:11:46 +00:00
goldsimon
1551bb702d
Fixed bug #29855 : PPP: Backport a bugfix in LcpSendEchoRequest from pppd
2010-05-11 16:53:41 +00:00
goldsimon
d656e9f28e
Added option LWIP_ARP_FILTER_NETIF to use multiple IPs on one hardware interface (by using multiple netifs, each with its own IP)
2010-05-10 14:10:46 +00:00
goldsimon
597764e35b
Minor: source code layout
2010-05-10 14:02:52 +00:00
goldsimon
f9f77876a1
.. and deleted NAT again as Christian obviously didn't have the copyright on the code he sent us... THANKS!!!
2010-05-05 19:49:40 +00:00
goldsimon
67d8c7999a
Free NAT entries on remove (fixes a memory leak)
2010-05-05 19:39:29 +00:00
goldsimon
a7fdb67e8f
task #7506 : added NAT support
2010-05-05 19:34:23 +00:00
goldsimon
4d1ff2418e
Fixed bug #29271 (Application can't re-use pbufs) by updating the doc to not allow reusing pbufs after passing them to a send function
2010-05-04 19:36:49 +00:00
goldsimon
71f5fdef42
Fixed bug #29769 (sys_check_timeouts: sys_now() may overflow)
2010-05-04 19:27:42 +00:00
goldsimon
abc36471d9
Fixed bug #29763 (CHECKSUM_GEN_IP_INLINE), added macro LWIP_MAKE_U16() that's improved for endianess
2010-05-04 18:59:52 +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
108ed3c81a
struct netbuf: reorder members to save some space
2010-05-02 09:10:58 +00:00
goldsimon
f98e5717e5
task #6849 : added udp_send(_to/_if) functions that take a precalculated checksum, added pbuf_fill_chksum() to copy data into a pbuf and at the same time calculating the checksum for that data
2010-04-30 20:39:45 +00:00
goldsimon
3685bc4828
fixed a type
2010-04-30 20:37:22 +00:00
goldsimon
72c580236e
Create overridable macros for copying 2-byte-aligned IP addresses and MAC addresses
2010-04-29 04:57:31 +00:00
goldsimon
01d2a87f5d
Inline generating IP checksum to save a function call
2010-04-28 19:36:51 +00:00
goldsimon
51061fb61e
Fixed bug #29617 (sometime cause stall on delete listening connection)
2010-04-21 19:59:40 +00:00
goldsimon
49e8e28cf6
Check that tcp_abort/tcp_abandon isn't called for listen-pcbs
2010-04-21 19:55:14 +00:00
goldsimon
d2c632fb18
patch #7145 : Various typos in SNMP files
2010-04-14 19:13:35 +00:00
goldsimon
3562be2188
tabs -> spaces
2010-04-14 07:03:31 +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
3347762df3
MEMP_OVERFLOW_CHECK: dump the element's pool's index and name when an overflow/underflow is detected
2010-04-12 11:08:11 +00:00
goldsimon
f1bc73c3ed
Fixed compilation errors
2010-04-02 16:48:53 +00:00
goldsimon
a96fa7d221
Fixed compilation of debug log code (that is currently commented out)
2010-04-02 16:17:51 +00:00
goldsimon
cc3e01a9f5
Fixed compilation (removed extra tokens after #endif)
2010-03-28 18:47:37 +00:00
goldsimon
6caa389c48
Check IP_FRAG && IP_FRAG_USES_STATIC_BUF && LWIP_NETIF_TX_SINGLE_PBUF
2010-03-28 10:50:05 +00:00
goldsimon
e86446b785
patch #7143 : Add a few missing const qualifiers
2010-03-28 10:28:32 +00:00
goldsimon
a00448c35a
create a new (contiguous) PBUF_RAM for every outgoing fragment if LWIP_NETIF_TX_SINGLE_PBUF==1
2010-03-28 10:22:48 +00:00
goldsimon
82b9152b8d
Removed checking ARP_TABLE_SIZE, this is done by the etharp module itself
2010-03-27 17:12:48 +00:00
goldsimon
d778fbb24f
Speedup TX by moving code from find_entry to etharp_output/etharp_query to prevent unnecessary function calls (inspired by patch #7135 ).
2010-03-27 16:51:27 +00:00
goldsimon
3803a0021d
patch #7130 : remove meaningless const qualifiers
2010-03-27 16:25:35 +00:00
goldsimon
3c96819a2c
Make LWIP_NETIF_TX_SINGLE_PBUF work for TCP, too
2010-03-26 16:54:15 +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
7e9eb55350
Added printf format modifier for mem_size_t depending on heap size
2010-03-26 15:38:01 +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
8bbe3d2fe0
Correctly cast pointers when assigning from void*
2010-03-26 14:05:56 +00:00
goldsimon
25f59761b3
fixed bug #29346 (removed comma after last enum member)
2010-03-26 14:05:22 +00:00
goldsimon
4b038f13de
sys_thread_new: name is a const pointer
2010-03-26 14:04:03 +00:00
goldsimon
da3d84d1dc
Fix compilation if ETHARP_SUPPORT_STATIC_ENTRIES==0
2010-03-26 13:40:31 +00:00
goldsimon
5ef976aed5
Fixed bug #29332 : lwip_select() processes readset incorrectly
2010-03-25 12:19:39 +00:00
goldsimon
cf0b831971
Fixed bug #29080 : Correctly handle remote side overrunning our rcv_wnd in ooseq case.
2010-03-25 06:39:01 +00:00
goldsimon
d861daeb4e
Removed function prototype that had no corresponding implementation (pbuf_ref_chain)
2010-03-22 15:46:09 +00:00
goldsimon
0a2eb3fdc8
minor: fixed coding style
2010-03-22 15:45:34 +00:00
goldsimon
6fb248c9e0
task #10088 : Fixed a bug in RST-on-close-when-not-all-data-acked implementation (plus removed some unnecessary casts)
2010-03-22 12:32:05 +00:00
goldsimon
40946a79d3
Removed duplicate TCP_REG/TCP_RMV macros, fixed debug macro implementation
2010-03-22 12:27:38 +00:00
goldsimon
124ca0fed2
tcp_listen() did not copy the pcb's prio
2010-03-22 10:06:49 +00:00
goldsimon
5d153ca1b3
Fixed compilation for MEM_USE_POOLS under MSVC (where ++ doesn't work for enums)
2010-03-22 08:38:28 +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
57594ad7b6
tcp_write: moved initial checks to an own static function for clarity
2010-03-20 12:08:07 +00:00
goldsimon
75bb43698c
Disable MEMP_TCPIP_MSG_INPKT pool for LWIP_TCPIP_CORE_LOCKING_INPUT==1
2010-03-20 11:57:34 +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
5fd410db4b
Added support for static ARP table entries (added option ETHARP_SUPPORT_STATIC_ENTRIES) (+ added test); refactored the etharp code a bit
2010-03-20 11:45:25 +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
d0f1c552e2
Fixed bug #29256 : SNMP Trap address was not correctly set
2010-03-19 20:49:13 +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
7466474365
Fixed compiler warnings when casting where we know the source is aligned (by casting to void-pointer first)
2010-03-15 10:44:19 +00:00
goldsimon
c4bc9ce59a
Fixed alignment warnings when we know alignment is correct (by using LWIP_MEM_ALIGN)
2010-03-15 09:57:03 +00:00
goldsimon
e25c9f7951
Fixed compiler warning when LWIP_SNMP==0
2010-03-15 09:47:43 +00:00
goldsimon
94cbed5096
Corrected comment
2010-03-14 12:35:30 +00:00
goldsimon
f83ace2034
task #6849 : Calculate checksum when creating TCP segments, not when (re-)transmitting them.
2010-03-14 11:26:05 +00:00
goldsimon
84ed9de21a
Prepared for checksum-on-copy (task #6849 ):
...
- Added option LWIP_CHECKSUM_ON_COPY;
- Added function + define lwip_chksum_copy to create checksum when copying data
2010-03-14 11:23:37 +00:00
goldsimon
4e764017c1
Fixed bug #29148 (Incorrect PBUF_POOL_BUFSIZE for ports where ETH_PAD_SIZE > 0) by moving definition of ETH_PAD_SIZE to opt.h and basing PBUF_LINK_HLEN on it.
2010-03-14 10:16:43 +00:00
goldsimon
67f5e17588
Bug #29210 : check alignment of struct sockaddr vs. struct sockaddr_in
2010-03-14 09:54:47 +00:00
goldsimon
d13ac66cc4
Fixed sending one byte of data in tcp_zero_window_probe (which I accidentally broke with v1.103)
2010-03-14 09:43:10 +00:00
goldsimon
9f0b7261e5
Fix calculation of tcp_mss(): when timestamps are on, this is pcb->mss - 12 or else NOCOPY-apps might generate unperformant PBUF_REF chains
2010-03-13 15:04:08 +00:00
goldsimon
ad4a869b94
Some fixes to the TCP_OVERSIZE code:
...
- fix compiling with TCP_OVERSIZE==0;
- fix segment-size calculation when options are used;
2010-03-13 14:29:13 +00:00
goldsimon
79d3b41e13
Reverted the change in struct sockaddr since it wasn't compatible to the standard (bug #29210 )
2010-03-13 14:09:52 +00:00
goldsimon
839befe68a
Corrected comment
2010-03-12 16:06:08 +00:00
goldsimon
097e8c8eb4
Fixed some issues in the TCP_OVERSIZE code:
...
- reset tcp_pcb.unsent_oversize when last_unsent is changed;
- added TCP_OVERSIZE_DBGCHECK: check tcp_pcb.unsent_oversize vs. (debug-only) tcp_seg.oversize_left to ensure the pcb counter is correct;
- fixed a memory leak in tcp_write;
2010-03-12 15:40:01 +00:00
goldsimon
90c7d3aaff
Temporary upgrade helper: define format string for u8_t as hex if not defined in cc.h
2010-03-10 16:18:12 +00:00
goldsimon
2621e3fa19
Use a union to let struct sockaddr have the same alignment requirements as struct sockaddr_in
2010-03-10 10:53:14 +00:00
goldsimon
36d7f50d77
Renamed tcp_output_set_header to tcp_output_alloc_header and included more code common to all callers
2010-03-09 16:29:19 +00:00
goldsimon
ffbb582dde
ip_output: assert for p->ref == 1 to catch TCP retransmissions where the netif hasn't freed the pbuf yet
2010-03-09 16:24:38 +00:00
goldsimon
3bfc07eb92
Added comment, use braces for single-line if-blocks
2010-03-09 15:49:57 +00:00
goldsimon
d91caf1cd3
ip_input: better check for old link-local-address (explicitly check for autoip->llipaddr instead of letting all link-local-addresses through)
2010-03-08 18:24:23 +00:00
goldsimon
2a2be49d2c
task #10241 (AutoIP: don't break existing connections when assiging routable address): when checking incoming packets and aborting existing connection on address change, filter out link-local addresses.
2010-03-08 18:17:52 +00:00
goldsimon
d47a04456b
bug #29105 : Review printf formatters
2010-03-08 17:07:35 +00:00
goldsimon
b9499d07c2
bug #29105 : Review printf formatters: added X8_F to cc.h and use it in etharp.c
2010-03-08 17:04:27 +00:00
goldsimon
5d20e690fd
Added/corrected casts
2010-03-08 12:17:29 +00:00
goldsimon
1c23bfdc7f
Only add hostname if it's not empty (strlen > 0)
2010-03-08 12:15:58 +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
9e37d70163
Create mem_mutext at the end of mem_init. This enables sys_mutex_new to use the heap if required.
2010-03-07 16:50:08 +00:00
goldsimon
99ff7efe80
Use braces for if-blocks
2010-03-06 12:26:20 +00:00
goldsimon
43a08bef14
tcp_accepted(): check pcb state to verify it isn't called on a connection-pcb
2010-03-06 12:06:27 +00:00
goldsimon
92beddd72f
task #7013 (Create option to have all packets delivered to netif->output in one piece): Always copy to try to create single pbufs in tcp_write.
2010-03-06 11:55:00 +00:00
goldsimon
f5b783d107
Fixed LWIP_NETIF_TX_SINGLE_PBUF for LWIP_TCPIP_CORE_LOCKING
2010-03-06 11:52:55 +00:00
goldsimon
a5a870c683
LWIP_NETIF_TX_SINGLE_PBUF needs TCP_OVERSIZE >= TCP_MSS for TCP
2010-03-06 11:51:31 +00:00
goldsimon
19ab25c861
LWIP_TCPIP_CORE_LOCKING_INPUT needs LWIP_TCPIP_CORE_LOCKING to work correctly
2010-03-06 11:32:40 +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
5d4438e652
Don't try to forward link-local addresses
2010-03-06 10:15:39 +00:00
goldsimon
4649c14856
Correctly identify link-local addresses when sending ARP packets
2010-03-06 09:56:52 +00:00
goldsimon
fcf6434b4b
Fixed bug #29087 : etharp: don't send packets for LinkLocal-addresses to gw
2010-03-06 09:33:17 +00:00
goldsimon
464950d51e
Fixed bug #29072 : Correctly set ciaddr based on message-type and state. Renamed dhcp_create/delect_request to dhcp_create/delete_msg.
2010-03-05 13:37:37 +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
b6542b977e
task #7040 (Work on tcp_enqueue): Don't waste memory when chaining segments, added option TCP_OVERSIZE to prevent creating many small pbufs when calling tcp_write with many small blocks of data. Instead, pbufs are allocated larger than needed and the space is used for later calls to tcp_write.
2010-03-05 11:14:31 +00:00
goldsimon
2bf1184c39
Added comment after #endif
2010-03-03 16:05:20 +00:00
goldsimon
103b5a760f
tcp_connect: send timestamp-option only if (pcb->flags & TF_TIMESTAMP) != NULL (same as for passive open)
2010-03-01 19:05:52 +00:00
goldsimon
2b1c389955
Fixed accessing invalid memory when closing a listening pcb (introduced with tcp_shutdown)
2010-03-01 18:43:37 +00:00
goldsimon
8d9fa63460
PPP: use LWIP_DEBUGF() instead of ppp_trace()
2010-02-22 20:16:39 +00:00
goldsimon
52b87b751f
Added a note about socket recv/accept timeout errno value
2010-02-22 19:12:21 +00:00
goldsimon
e934f8aac6
Added/improved comments and debug output; renamed 'pc' to 'pcrx' where appropriate to reflect the variable type
2010-02-22 17:58:05 +00:00
goldsimon
311d16df7d
Fixed compilation error after splitting tcp.h/tcp_impl.h
2010-02-22 17:52:09 +00:00
goldsimon
ea78d69c6d
Added debug output and missing casts
2010-02-22 17:49:49 +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
68678e21df
Fixed compilation for DNS_LOCAL_HOSTLIST==1 and DNS_LOCAL_HOSTLIST_IS_DYNAMIC==1 (bug #28968 )
2010-02-22 08:36:23 +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
1d8538bca4
Added const char* name to mem- and memp-stats for easier debugging.
2010-02-21 12:32:29 +00:00
goldsimon
b73dcfb8cf
task #10140 : Remove DNS_USES_STATIC_BUF (keep the implementation of DNS_USES_STATIC_BUF==1)
2010-02-21 12:15:01 +00:00
goldsimon
bcd4b76d31
Moved stack-internal parts of tcp.h to tcp_impl.h, tcp.h now only contains the actual application programmer's API
2010-02-21 11:35:21 +00:00
goldsimon
7c57ee0c17
Use tcp_debug_state_str() instead of tcp_debug_print_state()
2010-02-21 10:56:00 +00:00
goldsimon
d9157a71bb
Task #10088 : Correctly implement close() vs. shutdown(). Now the application does not get any more recv callbacks after calling tcp_close(). Added tcp_shutdown().
2010-02-20 18:05:56 +00:00
goldsimon
eae9798276
Fixed pcb leak when accept-callback is NULL and asserts are disabled
2010-02-20 17:27:08 +00:00
goldsimon
e131d3e32a
tcp_alloc: set given prio to the new pcb, not TCP_PRIO_NORMAL; minor: changed comments and source code layout
2010-02-20 10:03:03 +00:00
goldsimon
36043a92e7
Restructured TCP_PCB_COMMON for a smaller size (u16_t at the end)
2010-02-20 10:01:43 +00:00
goldsimon
9b48657444
Added UPGRADING doc file that should help to upgrade apps/ports from older versions of lwIP
2010-02-20 09:36:40 +00:00
goldsimon
52970c2459
Renamed mem_realloc() to mem_trim() to prevent confusion with realloc()
2010-02-19 16:23:46 +00:00
goldsimon
8336796c1a
Add matching comment to #endif
2010-02-16 21:05:06 +00:00
goldsimon
16a63c6554
Bug #28917 : don't increase error counters for icmp echo response
2010-02-16 20:38:35 +00:00
goldsimon
c637441f52
tcp_seg(s)_free: remove return value, noone uses it
2010-02-16 17:20:10 +00:00
goldsimon
5b221ecd4f
Added missing cast; added more debug output
2010-02-16 11:28:40 +00:00
goldsimon
7af77aefa7
Added missing casts
2010-02-16 11:28:15 +00:00
goldsimon
7c2054091d
Link status does not depend on LWIP_NETIF_LINK_CALLBACK (fixes bug #28899 )
2010-02-15 19:53:46 +00:00
goldsimon
e04e0cb98e
Fixed bug #28877 (Duplicate ARP gratuitous packet with LWIP_NETIF_LINK_CALLBACK set on) by only sending if both link- and admin-status of a netif are up
2010-02-14 20:20:28 +00:00
goldsimon
e983865ad5
Disable ETHARP_TRUST_IP_MAC by default since it slows down packet reception and is not really necessary
2010-02-14 18:10:34 +00:00
goldsimon
4c9fe60693
Fixed ARP input processing: only add a new entry if a request was directed as us (RFC 826, Packet Reception), otherwise only update existing entries; internalized some functions
2010-02-14 18:08:16 +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
524b7bc36b
Documented the use of netif flags
2010-02-14 16:00:46 +00:00
goldsimon
8908055b63
Revert my last changes and remove structure packing from struct dns_query and struct dns_answer since they are only used with SMEMCPY
2010-02-14 14:02:05 +00:00
goldsimon
10abe8aba2
Use pointers instead of using SMEMCPY
2010-02-14 12:51:53 +00:00
goldsimon
7b24a6360c
Minor speedups: use ip_addr_copy, use SMEMCPY, use htonX on constants instead of variables
2010-02-14 12:43:24 +00:00
goldsimon
96e9689dbd
Use new macro ip_addr_copy where applicable
2010-02-14 12:42:49 +00:00
goldsimon
7e0204bb7b
Improved some defines working on ip addresses, added faster macro to copy addresses that cannot be NULL
2010-02-14 12:41:46 +00:00
goldsimon
dfb80c6b86
fixed compilation for LWIp_SNMP && PPP_INPROC_MULTITHREADED
2010-02-14 12:26:01 +00:00
goldsimon
838c35acf6
struct ip_hdr: split u16_t _ttl_proto to u8_t _ttl and u8_t _proto to prevent unnecessary loading and htons
2010-02-14 11:42:08 +00:00
goldsimon
c858aa5686
Fixed compiler warnings for checksum algorithms 2 and 3
2010-02-14 11:40:13 +00:00
goldsimon
b1736b13d7
Use checksum algorithm 2 as default as it should be faster than 1 on most (if not all) platforms
2010-02-14 11:31:10 +00:00
goldsimon
cbb86fe590
Added stats for mutexes
2010-02-13 17:26:40 +00:00
goldsimon
a61f5f3a78
Fixed old comments
2010-02-13 17:26:08 +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
7c28c66d32
Don't use C++ reserved keyword 'class'
2010-02-13 14:51:46 +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
f89c08872c
Fixed indentation
2010-02-12 17:57:02 +00:00
goldsimon
29eb56a2f6
netif_set_link_up/down: only do something if the link state actually changes
2010-02-12 16:50:23 +00:00
goldsimon
2e795d2706
task #10139 (Prefer statically allocated memory): added autoip_set_struct() and dhcp_set_struct() to let autoip and dhcp work with user-allocated structs instead of callin mem_malloc
2010-02-12 16:42:02 +00:00
goldsimon
8768e4488a
patch #6865 : use so_options SOF_REUSEADDR instead of flags TF_REUSEADDR (which has ben removed again)
2010-02-12 16:32:31 +00:00
goldsimon
bd3f86e505
Code layout: splitted long line
2010-02-12 16:31:18 +00:00
goldsimon
82e4716784
Fixed comment to our flag names
2010-02-12 16:30:58 +00:00
goldsimon
d3635c5eef
patch #6865 (SO_REUSEADDR for TCP): if tcp_pcb.flags has TF_REUSEADDR set, allow binding to endpoint in TIME_WAIT
2010-02-12 15:33:02 +00:00
goldsimon
c73b1b4fa2
Fixed bug #28865 (Cannot close socket/netconn in non-blocking connect)
2010-02-12 15:21:37 +00:00
goldsimon
39df7d048c
Added comment about mem_realloc() vs. realloc()
2010-02-12 14:56:34 +00:00
goldsimon
3529349470
Fixed compilation for NO_SYS==1
2010-02-12 13:56:51 +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
b6babe38ea
Use braces for if blocks
2010-02-12 09:51:30 +00:00
goldsimon
df7e435b86
Fixed bug #28866 (mem_realloc function defined in mem.h)
2010-02-12 09:30:31 +00:00
goldsimon
9e59f661bc
Fixed a compiler warning (comparison between signed and unsigned)
2010-02-10 08:11:18 +00:00
goldsimon
87c2d911c9
Removed invalid assert (always true)
2010-02-10 07:58:21 +00:00
goldsimon
44af02aa1e
Fixed wrong printf formatter
2010-02-10 07:58:01 +00:00
goldsimon
45e51d1929
Removed sys_sem_wait_timeout, added comments to the port-supplied sys(-arch)-functions
2010-02-09 21:05:39 +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
6fe258c6bc
task #10154 (PPP: Update snmp in/out counters for tx/rx packets)
2010-02-09 18:21:21 +00:00
goldsimon
27c1c7a0f7
Added function sys_restart_timeouts() from patch #7085 (Restart system timeout handling)
2010-02-09 17:49:20 +00:00
goldsimon
a668a4e4d1
Fixed compilation for NO_SYS==1
2010-02-09 17:41:34 +00:00
goldsimon
b1250f003d
For loopback packets, adjust the stats- and snmp-counters for the loopback netif.
2010-02-09 17:00:57 +00:00
goldsimon
3f8e6c423c
Fixed unit tests after changing struct ip_addr to ip_addr_t
2010-02-09 16:40:52 +00:00
goldsimon
077caac76d
task #10153 (Integrate loopif into netif.c) - loopif does not have to be created by the port any more, just define LWIP_HAVE_LOOPIF to 1.
2010-02-09 16:01:24 +00:00
goldsimon
91d70a3364
Fixed copying multiple IP addresses from options (e.g. multiple DNS servers) - the amount copied was correct, but the value copied was always the first.
2010-02-09 11:40:46 +00:00
goldsimon
6af20340dd
Minor: Fixed indentation after changing struct ip_addr to ip_addr_t
2010-02-09 11:38:59 +00:00
goldsimon
68ab197b68
Fixed a missing cast warning
2010-02-09 11:38:00 +00:00
goldsimon
79e6b4c819
Added reentrant versions of inet_ntoa/ipaddr_ntoa inet_ntoa_r/ipaddr_ntoa_r
2010-02-08 20:14:21 +00:00
goldsimon
ececc3ca45
Internalize another function; use the supplied max_response_time instead of dividing it by 2
2010-02-08 19:50:49 +00:00
goldsimon
630f575017
Moved most defines from igmp.h to igmp.c for clarity since they are not used anywhere else; removed some function prototypes from igmp.h, too
2010-02-08 19:41:53 +00:00
goldsimon
49274c1507
added netif_s/get_igmp_mac_filter() macros
2010-02-08 19:32:40 +00:00
goldsimon
27d4cf6aef
Improved IGMP stats (patch from bug #28798 )
2010-02-08 19:19:26 +00:00
goldsimon
b156d392cb
Fixed bug #28798 (Error in "Max Response Time" processing) and another bug when LWIP_RAND() returns zero.
2010-02-08 18:12:53 +00:00
goldsimon
b0b4290c29
Reduced the time SYS_ARCH_PROTECT is protecting the socket array
2010-02-08 17:25:57 +00:00
goldsimon
90bed0c5ac
Added yet another IP-address-modifying define, ip_addr_set_any()
2010-02-08 17:24:08 +00:00
goldsimon
b3caddab30
Minor: source code layout
2010-02-08 17:12:45 +00:00
goldsimon
1017279e68
Minor: removed one space
2010-02-08 17:12:14 +00:00
goldsimon
f74cebcbcd
Minot: Fixed comments and code style
2010-02-08 16:53:47 +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
47756a8faa
Fixed macro ip_addr_set_loopback(): htonl was missing (fixes bug #28828 : ip_addr.h some macro error)
2010-02-08 12:25:01 +00:00
goldsimon
6c027c153b
Fixed compiler warnings
2010-02-08 12:24:29 +00:00
goldsimon
28dc5f491c
Correctly initialize netif flags in pppifNetifInit
2010-02-05 11:20:49 +00:00
goldsimon
758e99f362
Added function-like macros to get/set the hostname on a netif
2010-02-05 11:17:55 +00:00
goldsimon
010dc6258e
Fixed another compiler warning (missing cast)
2010-02-05 10:35:47 +00:00
goldsimon
a5c5949009
Added missing casts to suppress compiler warnings (this mainly satisfies MSVC - the double casts are a bit ugly but don't hurt...)
2010-02-05 10:09:38 +00:00
goldsimon
d51d6b2d89
Use macros to compare IP addresses
2010-02-05 10:08:49 +00:00
goldsimon
c58dfa2156
Added missing casts to suppress compiler warnings
2010-02-05 10:08:41 +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
24fcf9a86e
Accidentally changed the member name of struct ip_addr for testing...
2010-02-04 17:25:22 +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
258fe88232
Added an own debug-print option for timers.c (used TCPIP_DEBUG and SYS_DEBUG as the code was copied from there)
2010-02-04 16:53:10 +00:00
goldsimon
9ff7d29696
Fixed compiler warnings when MEM_SIZE < 64000
2010-02-02 20:14:05 +00:00
goldsimon
30d69d68e3
Fix handling of zero-padding and parse file before sname field (if overloaded, according to the RFC)
2010-02-02 18:26:40 +00:00
goldsimon
4495d9ef5b
Fixed an error in dhcp_free_request() from dhcp_inform()
2010-02-02 16:30:11 +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
81c5d9e983
Prevent mem_free (leave struct dhcp allocated on dhcp_stop) to prevent calling mem_malloc when restarting dhcp later
2010-02-01 20:20:38 +00:00
goldsimon
c6f7a34abe
Prevent mem_malloc in dhcp_inform, fix check for subnet mask (remember if it was given by server or not) set back request_timeout in dhcp_set_state()
2010-02-01 19:55:16 +00:00
goldsimon
72d6f1a418
Don't parse broadcast option, we don't use it anyway (made up from ipaddr and netmask), layout change of struct dhcp
2010-01-31 18:59:37 +00:00
goldsimon
8cb3ea1398
Reworked the code that parses DHCP options: parse them once instead of parsing for every option. This also removes the need for mem_malloc from dhcp_recv and makes it possible to correctly retrieve the BOOTP file.
2010-01-31 17:27:15 +00:00
goldsimon
8712deb0b2
Don't call the link-callback from netif_set_up/down() since
...
this invalidly retriggers DHCP.
2010-01-31 13:30:47 +00:00
goldsimon
2e8de4f601
Updated comment about recv_bufsize
2010-01-30 15:20:01 +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
9c41e1eea3
Replaced tabs with spaces
2010-01-29 23:04:06 +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
1dd8300e69
Added comments
2010-01-29 14:41:54 +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
ea3b8f52d5
renamed netif pointer in struct igmp from 'interface' to 'netif' to not use keywords (or at least my editor highlights it as one...); minor layout change
2010-01-28 18:27:26 +00:00
kieranm
95445fc328
Ensure ssthresh >= 2*MSS
2010-01-28 13:14:42 +00:00
goldsimon
21e3cde95c
Added missing casts (bug #28659 )
2010-01-28 12:05:14 +00:00
goldsimon
d587940801
Keep 'const' of varius snmp structs the same throughout 'derived structs'
2010-01-28 12:04:06 +00:00
goldsimon
f5d4f3d83c
For wrong configurations, let the test fail instead of the compiler
2010-01-27 20:37:02 +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
853e33bdb4
snmp_recv: don't peek the UDP header, p->tot_len does the same; no need for the extra checks at the beginning; don't use so many if/else but if/return instead to make the code more readable
2010-01-27 17:36:37 +00:00
goldsimon
0644c4c08e
Fixed bug #27871 : Calling tcp_abort() in recv callback can lead to accessing unallocated memory. As a consequence, ERR_ABRT means the application has called tcp_abort()!
2010-01-27 17:22:06 +00:00
goldsimon
606fed8896
Use memp pools for snmp instead of the heap; added 4 new pools.
2010-01-26 20:28:24 +00:00
goldsimon
a5463f0400
Moved missing include
2010-01-26 16:09:03 +00:00
goldsimon
96338314f1
Partly fixed bug #22070 (MIB_OBJECT_WRITE_ONLY not implemented in SNMP): write-only or not-accessible are still returned by getnext (though not by get)
2010-01-25 17:44:07 +00:00
goldsimon
5d3cab0042
Added one more missing cast
2010-01-25 09:19:52 +00:00
goldsimon
e678e1bdcb
bug #28659 : Missing casts
2010-01-25 08:24:30 +00:00
goldsimon
1811a344f5
Renamed the private mib node from 'private' to 'mib_private' to *not* use reserved C/C++ keywords
2010-01-24 17:25:22 +00:00
goldsimon
ef31aa12e2
Renamed the private mib node from 'private' to 'mib_private' to *not* use reserved C/C++ keywords, added comments, added init-define for private MIB
2010-01-24 17:16:37 +00:00
goldsimon
9dd6c28523
bug #26523 : Compiler Warnings
2010-01-24 14:35:28 +00:00
goldsimon
61e5301d49
bug #26523 : Compiler Warnings
2010-01-24 13:19:34 +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
60696a8485
Removed unused function declaration for netbuf_len (is a macro now)
2010-01-21 17:18:15 +00:00
goldsimon
7044385d8e
Fixed netconn_err() macro
2010-01-20 07:37:24 +00:00
goldsimon
a7139ef06b
Added missing include
2010-01-20 07:36:45 +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
972ca9e6c1
reorganised PPP sourcecode to 2.3.11 including some bugfix backports from 2.4.x.
2010-01-18 20:49:43 +00:00
goldsimon
e0c5c4de88
Fixed bug #28679 : mem_realloc calculates mem_stats wrong and added test case for it
2010-01-18 17:45:41 +00:00
goldsimon
149f21dc58
Only check for LWIP_RAND() if IGMP is used, for now
2010-01-18 08:19:48 +00:00
goldsimon
9632632b85
Minor: source code layout
2010-01-18 08:11:57 +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
3e1cca65bd
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
0e3c256667
Added comment
2010-01-17 17:37:10 +00:00
goldsimon
618355f5a7
Minor: source code layout
2010-01-17 16:23:26 +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
7ede02ca8b
Fixed bug #27856 : PPP: Set netif link- and status-callback by adding ppp_set_netif_statuscallback()/ppp_set_netif_linkcallback()
2010-01-14 20:04:52 +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
b463562241
Use protocol definition from tcp.h, not from sockets.h
2010-01-14 19:59:28 +00:00
goldsimon
04f17c4709
Improved includes in snmp
2010-01-14 19:59:03 +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
6df94d3c76
Coding style
2010-01-13 15:17:01 +00:00
goldsimon
59005b544f
Minor fix: bug #28555 : Retransmission timer only stopped if TCP_QUEUE_OOSEQ==1
2010-01-13 14:24:15 +00:00
goldsimon
8596bb7e7e
The heap now may be moved to user-defined memory by defining LWIP_RAM_HEAP_POINTER as a void pointer to that memory's address (patch #6966 and bug #26133 )
2010-01-13 13:09:55 +00:00
goldsimon
1c47d15577
Minor speedup ip_output_if when writing TTL/proto to ip header
2010-01-13 12:52:15 +00:00
goldsimon
67c587f9f7
Fixed NO_SYS==0: starting pppInputThread failed; fixed some comments
2010-01-13 11:19:03 +00:00
goldsimon
052be0a328
Added comments
2010-01-13 11:16:47 +00:00
goldsimon
68ddcc6ca7
Fixed bug #13315 (PPP PAP authentication can result in erroneous callbacks) by copying the code from recent pppd
2010-01-11 16:38:56 +00:00
goldsimon
9a2d97ec41
Fixed bug #28551 (Compiler warning introduced with closed bug #28506 )
2010-01-11 09:51:33 +00:00
goldsimon
47e770dffa
Fixed comment on struct mem.prev
2010-01-11 09:49:31 +00:00
goldsimon
8292cebfd9
Fixed bug #28506 (raw_bind should filter received packets)
2010-01-10 13:45:24 +00:00
goldsimon
c483c13dc4
Fixed bug #28248 (netif_remove doesn't call netif callback) by calling netif_set_down() from netif_remove()
2010-01-10 13:34:21 +00:00
goldsimon
86f2942c2a
Minor coding style changes, added assertion
2010-01-10 13:32:36 +00:00
goldsimon
e4d19dc4a0
GCC didn't like memp_memory_XXX -> now using memp_memory_XXX_base (as in Bill's original patch)
2010-01-10 13:09:55 +00:00
goldsimon
763760503b
patch #6822 (Add option to place memory pools in separate arrays) - new config option MEMP_SEPARATE_POOLS
2010-01-10 12:44:09 +00:00
goldsimon
13c9d2dade
Added/changed comments
2010-01-10 11:48:28 +00:00
goldsimon
97f6c5b239
D'Oh!
2010-01-10 11:42:31 +00:00
goldsimon
f4a9d173a1
bug #28127 : remove call to tcp_output() from tcp_ack(_now)()
2010-01-10 11:41:25 +00:00
goldsimon
d85a18752f
patch #6463 (IGMP - Adding Random Delay): added define LWIP_RAND() for lwip-wide randomization (to be defined in cc.h)
2010-01-10 10:47:27 +00:00
goldsimon
aa7dd9a8ad
Forgot one line & comments
2010-01-10 10:32:56 +00:00
goldsimon
27c9670718
Fixed bug #28529 : macro LWIP_DEBUG_TIMERNAMES in timers.h
2010-01-09 19:14:23 +00:00
goldsimon
32833bcd56
Inlined netif_is_up() and netif_is_link_up() as defines for speed reasons; fixed type and macro definition.
2010-01-09 13:25:15 +00:00
goldsimon
53bc34f3e2
Fixed bug #28195 (PPP: remove duplicate TCP/IP protocol header definitions - use the lwIP ones) - deleted unused header file
2010-01-09 12:45:23 +00:00
goldsimon
81640c4a83
Fixed compilation of VJ_SUPPORT after separating tx and rx
2010-01-08 15:52:17 +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
39717b2d9d
Copy hostname for DNS_LOCAL_HOSTLIST_IS_DYNAMIC==1 since string passed to dns_local_addhost() might be volatile
2010-01-08 14:42:09 +00:00
goldsimon
79c88cdcfd
Added function names to timer debug output
2010-01-08 14:08:47 +00:00
goldsimon
8a34c16aee
Improved assertion message when MEMP_SYS_TIMEOUT pool is empty
2010-01-08 13:40:50 +00:00
goldsimon
cce192a671
Call tcp_timer_needed() with NO_SYS==1, too
2010-01-07 09:47:30 +00:00
goldsimon
cfe4a12a46
Fixed bug #28496 : missing include guards in netdb.h
2010-01-06 16:30:23 +00:00
goldsimon
3269da52cc
Initial version of PPP for NO_SYS==1, some TODOs are remaining, but it works...
2009-12-31 17:56:51 +00:00
goldsimon
9c51487d1a
Renamed PPP tasks from "pppMain" to "pppInputThread"
2009-12-31 17:21:11 +00:00
goldsimon
3ba5ddefa7
Removed unnecessary tcpip-callbacks: this whole module runs inside the tcpip-thread. This also makes PPPoE usable with NO_SYS==1
2009-12-31 17:18:09 +00:00
goldsimon
1d45aa8d45
Reorganised PPP source code from ucip structure to pppd structure to easily compare our code against the pppd code (around v2.3.1)
2009-12-31 17:08:08 +00:00
goldsimon
a7bcdf4398
Remove warning for TCP_LISTEN_BACKLOG==0
2009-12-31 16:51:17 +00:00
goldsimon
9a0dac5885
Removed unused test function
2009-12-31 16:50:11 +00:00
goldsimon
c9e0652526
Remove C++-style comments
2009-12-31 16:49:36 +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
1740b0d421
Some functions were located outside extern "C" {}
2009-12-31 15:57:22 +00:00
goldsimon
802a048302
Commented 2 variables
2009-12-31 15:12:00 +00:00
goldsimon
fa08823ac4
Added an additional option LWIP_ETHERNET to support ethernet without ARP (necessary for pure PPPoE)
2009-12-27 11:42:16 +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
bf261f4f13
Another fix for bug #28241 (ooseq processing) and adapted corresponding unit test
2009-12-27 11:31:19 +00:00
kieranm
dc8639bc06
Update version numbering for 1.4.0 CVS development
2009-12-24 15:49:12 +00:00
kieranm
125efd8396
Update CHANGELOG for 1.3.2
2009-12-24 15:33:19 +00:00
kieranm
4a9557fa84
Update version information for 1.3.2
2009-12-24 15:32:19 +00:00
kieranm
6b6c82aaee
BUG28241: improve oos sequence processing with patches from Oleg Tyshev.
2009-12-24 15:31:44 +00:00
goldsimon
feca27d69e
Slightly modified the out-of-sequence-FIN test: receive packets with FIN & data and with FIN alone
2009-12-11 13:07:47 +00:00
goldsimon
fbef894674
tcp_set_state: fail on unimplemented state
2009-12-11 13:07:06 +00:00
goldsimon
2e4bb8b3b7
Added explicit check for number of segments and seqno/len of each segment on pcb->ooseq
2009-12-10 17:34:11 +00:00
goldsimon
e9940acb54
Updated comments on which sio-functions are used
2009-12-07 18:58:13 +00:00
goldsimon
957331fff4
Added a note why MSCHAP currently doesn't work with lwIP PPP
2009-12-07 07:50:24 +00:00
goldsimon
faba395cae
Added description about the PPP stack
2009-12-07 07:28:27 +00:00
goldsimon
1d5809679b
Various small improvements from patch #6965 (removed _inet_ntoa, set PPP netif down before removing, change log message and comment)
2009-12-06 11:59:56 +00:00
goldsimon
b5014b0966
tcp_process: add state info to log message that is used for multiple states ("TCP connection closed")
2009-12-06 11:57:31 +00:00
goldsimon
b1ad36eece
Fixed bug #27079 (Yet another leak in PPP): outpacket_buf can be statically allocated (like in ucip)
2009-12-06 11:12:18 +00:00
goldsimon
1b42286bda
pppInit: Remove zeroing the stats - no protocol does that
2009-12-06 10:56:28 +00:00
goldsimon
5da0620c6b
Fixed checking input packet length (20 bytes is a valid packet and is used e.g. with MS RAS server)
2009-12-06 10:14:46 +00:00
goldsimon
96e8f16c05
Sligthly reordered struct netif's members to better meet alignment requirements
2009-12-06 08:58:41 +00:00
goldsimon
b5d28e0a9c
patch #6969 : PPP: missing PAP authentication UNTIMEOUT
2009-12-04 15:41:26 +00:00
goldsimon
73251bc9c1
PPP: Make MAXNAMELEN/MAXSECRETLEN overridable in lwipopts.h
2009-12-04 09:00:55 +00:00
goldsimon
3fa63b35b3
The guy's name is Van Jacobson (not Jabobsen or Jacobsen :-)
2009-12-04 08:57:22 +00:00
goldsimon
65f006e52e
Moved the function definitions so that other modules can use the ICMP protocol header definitions when LWIP_ICMP==0
2009-12-04 08:11:57 +00:00
goldsimon
7d46e06824
Fixed bug #28106 : dup ack for fast retransmit could have non-zero length
2009-12-03 19:42:35 +00:00
goldsimon
32acb82bc0
Fixed some typos
2009-12-03 18:07:00 +00:00
goldsimon
3a1c5944e7
Fixed bug #27904 : TCP sends too many ACKs: delay resetting tcp_input_pcb until after calling the pcb's callbacks
2009-12-02 17:01:29 +00:00
goldsimon
04c5246e02
Fix compilation for PPPOE without PPPOS and VJ_SUPPORT without PPPOS_SUPPORT
2009-12-01 20:46:14 +00:00
goldsimon
46dc1c9bfb
Minor (null-pointer check for not-on-list-netif)
2009-12-01 19:59:36 +00:00
goldsimon
b900253c09
tcp_receive(): removed unnecessary return value, added comment
2009-11-29 13:43:38 +00:00
goldsimon
59a5fb7ce8
Fixed bug #28054 : Two segments with FIN flag on the out-of-sequence queue, also fixed PBUF_POOL leak in the out-of-sequence code
2009-11-29 13:23:21 +00:00
goldsimon
c5d2e536cf
Worked on tcp_oos unit tests, nearly all TCP_QUEUE_OOS code is covered now
2009-11-29 13:20:13 +00:00
goldsimon
aeef0a21f3
Fixed bug #28064 : pbuf_alloc(PBUF_POOL) is not thread-safe by queueing a call into tcpip_thread to free ooseq-bufs if the pool is empty
2009-11-29 11:57:35 +00:00
goldsimon
902ad897b8
Initial check-in of some unit tests
2009-11-27 08:03:53 +00:00
goldsimon
478ccee5fc
tcp_rexmit(): no need to call tcp_output, since always called from tcp_input and thus tcp_output always returns without sending (prevent confusion by thinking data was sent while in tcp_rexmit!)
2009-11-26 16:44:16 +00:00
goldsimon
43fd5c28b5
Fixed bug #28098 : Nagle can prevent fast retransmit from sending segment by basing the nagle-decision on TF_INFR also
2009-11-26 16:42:13 +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
6795aabecf
Fixed filename in last comment
2009-11-22 17:57:19 +00:00
goldsimon
a939c09a6b
Fixed bug #27905 : FIN isn't combined with data on unsent
2009-11-22 17:55:03 +00:00
goldsimon
35d1c33e0a
tcp_alloc: prevent increasing stats.err for MEMP_TCP_PCB when reusing time-wait pcb as suggested by Bill 4 months ago
2009-11-22 17:52:48 +00:00
goldsimon
10edf64873
Fixed bug #27851 (TCP_EVENT_RECV(pcb, NULL,...) results in unreachable code warning) by calling tcp_recv_null if pcb->recv is null.
2009-11-22 16:17:55 +00:00
goldsimon
6d22c38e59
tcp_recv_null: call tcp_recved() if p != NULL to keep the window correct
2009-11-22 16:16:55 +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
6bb7f987f2
Fixed bug #28049 (Keep Alive timeout frees pcb then uses it, sometimes causing crash error) by calling tcp_rst() instead of tcp_abort() in tcp_slowtmr() when retransmit timer expires.
2009-11-22 15:44:12 +00:00
goldsimon
1c018caefe
move tcp_debug_print_state to prevent accessing pcb when it might already be deallocated due to recv_flags == TF_RESET or TF_CLOSED
2009-11-22 15:42:30 +00:00
goldsimon
0c136893e5
Fixed logging of timeout-function-pointer (pointer to local stack was logged instead of actual function pointer), minor coding style fix
2009-11-22 15:25:13 +00:00
goldsimon
f4c0655190
Fixed usage of logging levels (bug #27948 : Incorrect logging levels used in various places)
2009-11-22 15:14:46 +00:00
goldsimon
49bdf32765
Fixed usage of logging levels (bug #27948 : Incorrect logging levels used in various places)
2009-11-22 13:31:31 +00:00
goldsimon
88d02a624a
Clarified debug levels by renaming level OFF to ALL (the old define still exists for now to prevent breaking old code)
2009-11-22 13:14:57 +00:00
goldsimon
98a58f9e67
tcp_input: move tcp_debug_print_state to prevent accessing pcb when it might already be deallocated due to calling tcp_abort in tcp_process.
2009-11-20 16:56:25 +00:00
goldsimon
b30c6f8b9e
Fixed comment: tcp_pcb_remove does *not* deallocate the pcb
2009-11-20 16:43:57 +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
6f38b63a47
Fixed bug #27994 : incorrect define for freeaddrinfo(addrinfo)
2009-11-11 16:52:05 +00:00
goldsimon
70b05c8096
Increased default value for TCP_MSS to 536, updated default value for TCP_WND to 4*TCP_MSS to keep delayed ACK working.
2009-10-30 10:02:06 +00:00
goldsimon
28ac4347d4
Fixed wrong filename
2009-10-29 17:10:19 +00:00
kieranm
dee1d82c11
re-work the fast retransmission code to follow algorithm from TCP/IP
...
Illustrated
2009-10-29 15:48:57 +00:00
kieranm
6d73f82f41
Update version for 1.3.2 rc 1
2009-10-28 15:17:16 +00:00
kieranm
71ddff4964
Fix BUG#27445: grow cwnd with every duplicate ACK
2009-10-28 15:13:51 +00:00
goldsimon
af3b796488
Corrected parameter spelling in doc
2009-10-27 20:30:44 +00:00
goldsimon
e2de2c6bb2
Added netifapi_netif_set_addr()
2009-10-27 20:29:16 +00:00
goldsimon
2ff0ce2d0a
Minor: Improved memory layout/alignment of struct dhcp for 32-bit platforms
2009-10-26 09:59:54 +00:00
goldsimon
b09b8a0ccc
Tiny code size improvement using goto instead of duplicating code
2009-10-26 09:55:46 +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
bcc87ef851
bug-fix in the TCP_EVENT_RECV macro (has to call tcp_recved if pcb->recv is NULL to keep rcv_wnd correct)
2009-10-25 18:47:44 +00:00
goldsimon
650f16b6d9
Minor: fixed typo
2009-10-25 16:47:41 +00:00
goldsimon
ae2dd38e0d
Another fix for bug #26251 : RST process in TIME_WAIT TCP state
2009-10-25 11:45:11 +00:00
kieranm
0319c1cf90
Update link to wiki in README file
2009-10-23 15:23:23 +00:00
goldsimon
81f9442ac7
Fixed bug #27783 : Silly window avoidance for small window sizes
2009-10-23 13:17:18 +00:00
goldsimon
18ab274af3
Fixed bug #26251 : RST process in TIME_WAIT TCP state
2009-10-22 13:37:44 +00:00
goldsimon
65d1f52423
Changed fix for bug #27215 (TCP sent() callback gives leagin and trailing 1 byte len (SYN/FIN)) by decreasing pcb->acked appropriately
2009-10-21 15:42:14 +00:00
goldsimon
f1b82e0e9a
bug #27315 : zero window probe and FIN: only send pure FIN if the enqueued FIN segment doesn't contain any other data
2009-10-21 15:15:34 +00:00
goldsimon
67411c4299
Minor code simplification (don't store received pbuf, change conditional code to assert where applicable), check pbuf length before testing for valid reply
2009-10-19 20:06:01 +00:00
goldsimon
a37e62b7d0
Removed most calls to udp_connect since they aren't necessary when using udp_sendto_if() - always stay connected to IP_ADDR_ANY.
2009-10-19 16:43:50 +00:00
goldsimon
e2c1f7d5b5
dhcp_unfold_reply: NULL memory might have been freed after mem_malloc returned NULL
2009-10-18 09:26:27 +00:00
goldsimon
ec97fbd101
dhcp_inform(): netif->dhcp pointed to unallocated memory when udp_new() failed
2009-10-18 09:13:47 +00:00
goldsimon
b7d7559cc9
Fixed bug #27215 : TCP sent() callback gives leadin and trailing 1 byte len (SYN/FIN)
2009-10-18 08:30:44 +00:00
goldsimon
b4404ff0c8
Corrected typo
2009-10-18 08:23:05 +00:00
goldsimon
502e89f4ad
Fixed bug #27315 : zero window probe and FIN
2009-10-16 21:07:48 +00:00
goldsimon
d8d8cf7e98
Fixed bug #27390 : Source IP check in ip_input() causes it to drop valid DHCP packets -> allow 0.0.0.0 as source address when LWIP_DHCP is enabled
2009-10-16 12:39:24 +00:00
goldsimon
d9a5094068
Fixed bug #27329 : dupacks by unidirectional data transmit
2009-10-15 20:09:13 +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
2dc027401f
Fixed bug #27704 : autoip starts with wrong address: LWIP_AUTOIP_CREATE_SEED_ADDR() returned address in host byte order instead of network byte order
2009-10-15 14:05:35 +00:00
goldsimon
ac638c85f3
Fixed bug #27504 : tcp_enqueue wrongly concatenates segments which are not consecutive when retransmitting unacked segments
2009-10-11 13:06:44 +00:00
goldsimon
c0e22c255c
Fixed default values of some stats to only be enabled if used Fixes bug #27338 : sys_stats is defined when NO_SYS = 1
2009-10-09 20:18:15 +00:00
goldsimon
1309e5e86f
Accidentally endabled to compile the code -> back to #if 0
2009-10-09 20:16:26 +00:00
goldsimon
c34c024dd5
Updated comment in low_level_input() about pbuf len vs. tot_len if using preallocated pbufs (as requested in bug #27576 : pbuf_realloc will assert or crash on a non-chained pbuf list)
2009-10-09 19:56:54 +00:00
goldsimon
6ef69ece95
patch #6930 : [PATCH trivial] TCP_RMV remove unnecessary check - removed two checks for NULL which are not necessary.
2009-10-07 18:04:24 +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
9e5cf1cf8e
Reverted change for bug #27252 (Address pointer invalid after freeing pbuf in UDP receive callback) as it made more problems than before :-(
2009-10-07 17:50:46 +00:00
goldsimon
ddc783bee7
Make ip_current_netif() and ip_current_header() a define referring to extern variables to be save the function call.
2009-10-07 17:47:05 +00:00
goldsimon
68f92050e9
Make tcp_debug_state_str() always available, not only in DEBUG mode
2009-10-07 17:44:59 +00:00
goldsimon
bd2bc2ee14
Fixed bug bug #27345 : "ip_frag() does not use the LWIP_NETIF_LOOPBACK function" by checking for loopback before calling ip_frag
2009-08-30 20:52:43 +00:00
goldsimon
8a7c1c4926
do_connect: LWIP_ERROR on invalid/disabled protocol
2009-08-30 20:24:08 +00:00
goldsimon
cff3e0cad2
bug #26397 : Added SLIP polling support (uses sio_tryread)
2009-08-26 21:06:18 +00:00
stoklund
b55cfbc342
Add patch #6725 to CHANGELOG
2009-08-26 07:18:50 +00:00
goldsimon
3115087d26
Commented the functions, added sio_tryread() for non-blocking read (to be used in slipif-polling mode)
2009-08-25 17:54:28 +00:00
goldsimon
057c51ff6d
Use LWIP_UNUSED_ARG() instead of if(){}, fix unused arg warning if LWIP_ARP==0
2009-08-25 17:50:59 +00:00
goldsimon
f2f20cf133
fixed invalid dependency to etharp_query if DHCP_DOES_ARP_CHECK==0
2009-08-25 17:49:47 +00:00
goldsimon
2c618705f0
task #9033 : Support IEEE 802.1q tagged frame (VLAN), New configuration options ETHARP_SUPPORT_VLAN and ETHARP_VLAN_CHECK.
2009-08-25 15:24:49 +00:00
goldsimon
bc10ad2356
patch #6900 : added define ip_ntoa(struct ip_addr*)
2009-08-25 14:53:25 +00:00
stoklund
857fac1168
Add C++ guards to autoip.h header.
2009-08-24 13:17:42 +00:00
stoklund
103ba9b0fc
The DHCP client should enter the REBOOTING state when connecting to a
...
new network. If DHCP has bound to an address, it must be verified
after netif_set_link_up.
2009-08-24 13:12:37 +00:00
stoklund
d83fc6893b
Don't use an AutoIP-configured address on a new network until the address has been configured.
...
When connecting to a new network with an AutoIP address, take the
interface down until the old address has passed the
AUTOIP_STATE_PROBING state.
2009-08-24 13:11:35 +00:00
goldsimon
e7d5739ce7
Fixed bug #27078 : Possible memory leak in pppInit()
2009-08-23 17:40:29 +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
dea7255fc5
Fixed bug #26649 : TCP fails when TCP_MSS > TCP_SND_BUF, Fixed wrong parenthesis, added check in init.c
2009-08-23 13:03:20 +00:00
goldsimon
ce3082976c
Fixed bug #27266 : wait-state debug message in pppMain occurs every ms
2009-08-23 12:37:36 +00:00
goldsimon
362a295e06
Fixed bug #27252 : Address pointer invalid after freeing pbuf in UDP receive callback
2009-08-23 11:32:38 +00:00
goldsimon
0e91e2adf2
bug #27267 : Added include to string.h where needed
2009-08-23 11:24:51 +00:00
goldsimon
4d49d952b6
patch #6843 : tcp.h macro optimization patch (for little endian)
2009-08-23 11:13:19 +00:00
goldsimon
ae7a7a0abf
Added function tcp_debug_state_str() to convert a tcp state to a human-readable string.
2009-08-23 10:57:37 +00:00
kieranm
4f265dce60
Update version number for CVS development
2009-08-18 12:53:35 +00:00
kieranm
bd96db8c9f
Update version number of 1.3.1 final release
2009-08-18 12:47:13 +00:00
kieranm
0b75917121
BUG27209: handle trimming of segments when out of window or out of
...
order properly
2009-08-12 08:34:48 +00:00
kieranm
fa2dbc2b1b
BUG27199: use snd_wl2 instead of snd_wl1
2009-08-12 08:32:14 +00:00
goldsimon
3a6165f0b9
Added missing include to <string.h>
2009-08-11 14:38:55 +00:00
goldsimon
62c27f7fce
Fixed bug #27155 : "'NULL' undeclared in inet_checksum.c"
2009-08-03 19:28:35 +00:00
goldsimon
7feb116bae
Fixed bug #27105 : "realloc() cannot replace mem_realloc()" by making mem_realloc static doing nothing when MEM_LIBC_MALLOC==1
2009-07-28 17:18:46 +00:00
goldsimon
730a938912
Added debug print when rejecting incoming connections due to exceeded listen backlog
2009-07-28 17:04:04 +00:00
goldsimon
3553efb75e
Added newline to TCP header flags debug print
2009-07-28 17:02:48 +00:00
kieranm
6111230fe9
Fix compile warning on Linux
2009-07-27 15:39:40 +00:00
kieranm
6bce84e070
Update for 1.3.1rc2
2009-07-27 15:21:36 +00:00
kieranm
a6e316a92d
Add missing #include directives
2009-07-27 15:20:33 +00:00
goldsimon
22bcf5892a
Fixed bug #27034 : "Invalid ASSERT in pbuf_alloc()" to prevent breaking PPP (for now).
2009-07-27 15:17:13 +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
stoklund
893ddcf61b
Implement exponential backoff in dhcp.c
2009-07-23 08:59:13 +00:00
stoklund
cf81dbcca4
Reuse XIDs for DHCP retransmissions
2009-07-23 08:57:45 +00:00
goldsimon
5830200029
Added missing include to netif.h
2009-07-20 15:48:55 +00:00
kieranm
972592cf8a
Update version numbers for release candidate
2009-07-09 11:43:28 +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
fb555a0633
Update changelog for recent commits
2009-06-25 12:58:52 +00:00
kieranm
2b87f899ab
BUG26722: initialise netconn write variables in netconn_alloc
2009-06-25 10:17:18 +00:00
kieranm
776e1926a3
BUG26879: set ret value in TCP_EVENT_ macros when function is not set
2009-06-25 10:03:53 +00:00
kieranm
c232edb83a
BUG26301 and BUG26267: correct simultaneous close behaviour, and make
...
snd_nxt have the same meaning as in the RFCs.
2009-06-25 09:57:36 +00:00
goldsimon
aefeba3fc0
Added note about printf formatter defines
2009-05-20 18:59:05 +00:00
goldsimon
6d4064799a
Corrected structure packing
2009-05-20 18:33:45 +00:00
goldsimon
e0e9a63e63
Corrected function implementation of ip_current_* (void was missing)
2009-05-19 18:11:01 +00:00
goldsimon
bcdffce6ce
Corrected function definition of ip_current_* (void was missing)
2009-05-19 05:40:30 +00:00
goldsimon
ff97c8a1a9
Moved function definition below defines and typedefs, added missing include to netif.h
2009-05-18 17:56:01 +00:00
goldsimon
30acd1662d
fixed bug #26507 : "Gratuitous ARP depends on arp_table / uses etharp_query" by adding etharp_gratuitous()
2009-05-12 20:13:45 +00:00
goldsimon
078e2f60d6
bug #26487 : Added ip_output_if_opt that can add IP options to the IP header (used by igmp_ip_output_if)
2009-05-12 18:00:47 +00:00
goldsimon
c7ce2792c8
Fixed compilation if LWIP_PLATFORM_BYTESWAP && (BYTE_ORDER == LITTLE_ENDIAN)
2009-05-11 16:11: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
105d72a3c2
Shrinked ICMP code, added option to NOT check icoming ECHO pbuf for size (just use it): LWIP_ICMP_ECHO_CHECK_INPUT_PBUF_LEN
2009-05-09 08:36:36 +00:00
goldsimon
c752e5731c
Worked on dns: local host-list can be put into FLASH (by defining storage target/linker section), external function can be defined for lookup, combined dns_local_removehostname/removehostaddr to dns_local_removehost
2009-05-07 15:27:02 +00:00
goldsimon
72e9cf53e7
Added netbuf.h to files that may be called from any thread
2009-05-07 14:20:37 +00:00
goldsimon
e66d315c9b
Added more threading info
2009-05-07 14:15:51 +00:00
goldsimon
95f6dc7011
On little endian architectures, use LWIP_PLATFORM_HTONS (if defined) for SWAP_BYTES_IN_WORD to speed up checksumming.
2009-05-06 17:35:50 +00:00
goldsimon
ac9e758f41
Patch #6823 : tcp_in.c - small optimization
2009-05-06 17:30:18 +00:00
goldsimon
518b18dad0
Added #if LWIP_SNMP around snmp-internal header files
2009-05-06 15:35:13 +00:00
goldsimon
bdd5586cee
Added a word or two on threading, which should be sufficient to close task #6683
2009-05-05 19:33:41 +00:00
goldsimon
14dba4ae2b
Added ip_current_netif() & ip_current_header() to receive extended info about the currently received packet.
2009-05-05 17:50:39 +00:00
goldsimon
99d82c4980
Fixed bug #26405 : Prematurely released semaphore causes lwip_select() to crash
2009-05-05 17:20:45 +00:00
goldsimon
fb46e0f192
snmp was not initialized in lwip_init()
2009-05-04 19:22:26 +00:00
fbernon
b055128ec4
CHANGELOG: minor, typo
2009-05-04 08:50:24 +00:00
fbernon
e29f94a980
dhcp.c, netbios.c: Changes if IF_SOF_BROADCAST is enabled.
2009-05-04 08:40:44 +00:00
goldsimon
24342eaab0
Fixed bug #26349 : Nagle algorithm doesn't send although segment is full (and unsent->next == NULL)
2009-05-03 14:17:33 +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
goldsimon
41eecb67d2
fixed bug #25636 : SNMPSET value is ignored for integer fields
2009-05-02 15:45:53 +00:00
goldsimon
9317105c37
Addition to patch #6721 , bug #25575 : call autoip_stop in dhcp_stop if in coop-mode
2009-05-02 15:40:39 +00:00
goldsimon
23d7f5425d
Fixed bug #21680 : PPP upap_rauthnak() drops legal NAK packets
2009-05-01 12:10:34 +00:00
goldsimon
217f279fdb
Fixed bug #24228 : Memory corruption with PPP and DHCP
2009-05-01 11:42:36 +00:00
fbernon
d4ecb23015
raw.c, udp.c, init.c, opt.h, ip.h, sockets.h: bug #26309 : Implement the SO(F)_BROADCAST filter for all API layers. Avoid the unindented reception of broadcast packets even when this option wasn't set. Port maintainers which want to enable this filter have to set IP_SOF_BROADCAST=1 in opt.h. If you want this option also filter broadcast on recv operations, you also have to set IP_SOF_BROADCAST_RECV=1 in opt.h.
2009-04-29 12:42:43 +00:00
fbernon
42c59e1079
netif.c: minor, fix a warning
2009-04-29 12:39:16 +00:00
goldsimon
3b5993e6ee
Integrated patch #6721 : new option to adjust the time when DHCP gives over to AUTOIP and some improvements in DHCP/AUTOIP cooperation
2009-04-28 19:29:46 +00:00
goldsimon
4b8255a588
Bug #25608 : Made SYS_LIGHTWEIGHT_PROT and sys_now() work with NO_SYS=1
2009-04-27 20:09:52 +00:00
goldsimon
36e3d24331
Fixed a bug in tcp_enqueue introduced with v1.79 of this file while fixing bug #25094 (zero-length pbuf)
2009-04-27 19:00:23 +00:00
goldsimon
261dfdf010
fixed bug #24212 : "Deadlocked tcp_retransmit due to exceeded pcb->cwnd": Fixed by sorting the unsent and unacked queues (segments are inserted at the right place in tcp_output and tcp_rexmit)
2009-04-26 12:27:11 +00:00
goldsimon
cbfacb7ed9
bug #26213 "Problem with memory allocation when debugging": memp_sizes contained the wrong sizes (including sanity regions); memp pools for MEM_USE_POOLS were too small; Added option MEM_USE_POOLS_TRY_BIGGER_POOL to try the next bigger malloc pool if one is empty (only usable with MEM_USE_POOLS).
2009-04-25 17:42:27 +00:00
fbernon
4eda29abf9
inet.c: patch #6765 : Fix a small problem with the last changes (incorrect behavior, with ip address string not ended by a '\0', a space or a end of line)
2009-04-24 12:14:54 +00:00
goldsimon
c3f7107e2b
Fixed some issues with DNS_LOCAL_HOSTLIST
2009-04-23 16:54:30 +00:00
fbernon
67a3976a24
init.c: typo
2009-04-23 15:28:52 +00:00
fbernon
4fba1b1430
netdb.c: remplace some %#p by %p to be more portable.
2009-04-23 14:41:52 +00:00
goldsimon
029b786c77
Fixed bug #26069 : Corrected documentation: if tcp_connect fails, pcb->err is called, not pcb->connected (with an error code).
2009-04-21 19:15:16 +00:00
goldsimon
51e02176da
task #7507 , patch #6786 : DNS supports static hosts table. New configuration options DNS_LOCAL_HOSTLIST and DNS_LOCAL_HOSTLIST_IS_DYNAMIC.
2009-04-21 18:35:18 +00:00
goldsimon
ed65d9cd75
Fixed bug #26236 : "TCP options (timestamp) don't work with no-copy-tcpwrite": deallocate option data, only concat segments with same flags
2009-04-19 12:42:48 +00:00
goldsimon
542b8fffb1
Fixed bug #25094 : "Zero-length pbuf" (options are now allocated in the header pbuf, not the data pbuf); added function comments; "inline" is not supported by ANSI C (tcp_build_timetamp_option)
2009-04-19 12:31:16 +00:00
goldsimon
12c50ed87b
tcp_listen_input: format code for #if LWIP_TCP_TIMESTAMPS that calls tcp_enqueue like the other calls.
2009-04-19 12:17:59 +00:00
goldsimon
9d5bf57dd9
fixed bug #25695 : Segmentation fault in do_writemore()
2009-04-18 17:48:41 +00:00
goldsimon
04df18bcd3
Changed ??? to LINK_SPEED_OF_YOUR_NETIF_IN_BPS
2009-04-17 10:14:09 +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
620b3e6739
task #9192 : mem_free of dhcp->options_in and dhcp->msg_in
2009-04-15 19:53:59 +00:00
goldsimon
580f334274
patch #6808 : Add a utility function ip_hinted_output() (for smaller code mainly)
2009-04-15 19:32:01 +00:00
goldsimon
4f52183a39
patch #6765 : Supporting new line characters in inet_aton()
2009-04-15 19:06:39 +00:00
goldsimon
a55f354687
patch #6763 : Global DHCP XID can be redefined to something more unique
2009-04-15 18:48:10 +00:00
goldsimon
9630c9136b
patch #6764 : DHCP rebind and renew did not send hostnam option; Converted constant OPTION_MAX_MSG_SIZE to netif->mtu, check if netif->mtu is big enough in dhcp_start
2009-04-15 18:35:04 +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
4f8f6ba205
Patch#6774 TCP_QUEUE_OOSEQ breaks compilation when LWIP_TCP==0
2009-04-09 15:16:26 +00:00
kieranm
f81ed216db
Patch#6802 Add do-while-clauses to those function like macros in tcp.h
2009-04-09 15:09:22 +00:00
kieranm
f1a9f7ea70
BUG20515: rework way TCP window updates are calculated and sent
2009-03-31 14:23:40 +00:00
kieranm
4b14621208
TASK9218: add support for TCP timestamp options
2009-03-31 14:13:32 +00:00
kieranm
baf30f5eae
BUG20779: cope with SYN packets received during established states,
...
and retransmission of initial SYN.
2009-03-31 10:55:31 +00:00
kieranm
e7a2ab5de9
BUG26010: set push bit correctly when tcp segments are merged
2009-03-31 10:53:11 +00:00
kieranm
fd41c5de2d
Correct change to probe window setting
2009-03-27 11:04:04 +00:00
kieranm
efac109803
BUG25622: handle return code of tcp_enqueue in tcp_listen_input()
2009-03-26 14:31:02 +00:00
kieranm
84505d4cc8
BUG25629: set TCP_ACK flags on keepalive and zero window probes
2009-03-26 14:25:46 +00:00
kieranm
7d8fac62ec
Fix compiler warning about %#p
2009-03-25 11:02:24 +00:00
goldsimon
b6e18d9c6f
cc.h: Added printf formatter for size_t: SZT_F
2009-02-19 19:29:28 +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
103fe60362
mem_free: fix a warning by converting pointer to mem_ptr_t instead of unsigned long
2009-02-18 20:42:16 +00:00
goldsimon
638020ec70
sys_now() must return u32_t, not unsigned long
2009-02-18 20:37:42 +00:00
goldsimon
56038b6457
Fixed many warnings: use %p to pass pointers to printf
2009-02-18 20:37:09 +00:00
goldsimon
96b788bea7
patch #6528 : the buffer used for IP_FRAG_USES_STATIC_BUF could be too small depending on MEM_ALIGNMENT
2009-02-18 16:54:02 +00:00
goldsimon
7b6c11360f
Added check: PBUF_POOL_BUFSIZE must be greater than MEM_ALIGNMENT or else the offset of a pbuf may take the full first pbuf in a chain (resulting in the first pbuf having len==0)
2009-02-18 16:50:40 +00:00
goldsimon
ea1eb45e3f
etharp_raw: allocating PBUF_RAW for outgoing ARP packets instead of PBUF_LINK is enough.
2009-02-18 16:48:30 +00:00
goldsimon
e001a021d5
patch #6539 : (configurable) response to broadcast- and multicast pings
2009-02-16 20:24:29 +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
d976c8e85f
fixed bug #24440 : TCP connection close problem on 64-bit host by moving accept callback function pointer to TCP_PCB_COMMON
2009-02-16 16:50:58 +00:00
goldsimon
d2d33cb984
Fixed compilation error in LWIP_VERSION
2009-02-16 16:43:06 +00:00
goldsimon
eeae59ecb7
LWIP_VERSION: corrected shifting for 16-bit platforms, added LWIP_RC_DEVELOPMENT
2009-02-15 20:44:40 +00:00
goldsimon
466f4e699c
Added LWIP_VERSION to get the current version of the stack (implements task #9032 : Provide means to get Version of Stack and submodules)
2009-02-12 21:00:11 +00:00
goldsimon
bf09400c4c
fixed bug #25345 (DHCPDECLINE is sent with "Maximum message size" option)
2009-02-12 16:16:25 +00:00
goldsimon
c4509e700d
added MEMP_MEM_MALLOC to use mem_malloc/mem_free instead of the pool allocator (can save code size with MEM_LIBC_MALLOC if libc-malloc is otherwise used)
2009-02-11 20:43:41 +00:00
goldsimon
6472e3b35e
fixed bug #24480 (releasing old udp_pdb and pbuf in dhcp_start)
2009-02-11 20:27:00 +00:00
goldsimon
f9bd5019fa
including inet.h because htonl is used
2009-02-11 20:21:20 +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
243e3d0d91
Fixed bug #25544 : DHCP_COARSE_TIMER_MSECS could overflow on 16-bit targets
2009-02-11 17:48:34 +00:00
goldsimon
19884f40b8
Moved INADDR_* defines to inet.h; removing dependency from inet.h to ip_addr.h
2009-02-10 20:44:51 +00:00
goldsimon
10c3ce08af
fixed bug #25467 : Listen backlog is not reset on timeout in SYN_RCVD: Accepts_pending is decrease on a corresponding listen pcb when a connection in state SYN_RCVD is close.
2009-02-10 20:29:38 +00:00
jifl
878532a30d
* ipv4/inet_chksum.c, ipv4/lwip/inet_chksum.h: inet_chksum_pseudo_partial()
...
is only used by UDPLITE at present, so conditionalise it.
2009-01-28 23:58:15 +00:00
jifl
102d69004a
* pbuf.c: reclaim pbufs from TCP out-of-sequence segments if we run
...
out of pool pbufs.
2009-01-28 05:43:35 +00:00
goldsimon
b0c61ffbb1
Reverted last changes since it's wrong when sizeof(int)==2...
2008-12-20 12:24:41 +00:00
goldsimon
9f96f09652
Another fix for bug #6683 (and a typo in changelog)
2008-12-19 18:16:50 +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
goldsimon
6777ae2ada
Another modification for patch #6683 (Customizable AUTOIP seed address)
2008-12-10 17:08:42 +00:00
goldsimon
2cf3e6e9bc
Corrected the range calculation of LWIP_AUTOIP_CREATE_SEED_ADDR, corrected comments
2008-12-04 18:34:48 +00:00
goldsimon
491b73d5f2
Checked in (slightly modified) patch #6683 : Customizable AUTOIP "seed" address. This should reduce AUTOIP conflicts if LWIP_AUTOIP_CREATE_SEED_ADDR is overridden.
2008-12-03 15:13:21 +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
goldsimon
299e2a7077
fixed bug ##24596: Vulnerability on faulty TCP options length in tcp_parseopt
2008-10-18 15:24:06 +00:00
goldsimon
13a139eef7
fixed bug #24517 : IP reassembly crashes on unaligned IP headers by packing the struct ip_reass_helper.
2008-10-15 18:20:23 +00:00
jifl
06df1647e1
* etharp.c (etharp_arp_input): Fix type aliasing problem copying ip address.
2008-10-03 14:47:33 +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
ba98bcdc60
* dns.c: Hard-code structure sizes, to avoid issues on some compilers where
...
padding is included.
2008-10-02 13:53:16 +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
jifl
c231e95cce
* tcp.c: Fix bug #24227 , wrong error message in tcp_bind.
2008-09-30 13:50:39 +00:00
jifl
6f6c8c5434
* pbuf.c (pbuf_copy_partial): Improve function description comment. Thanks to Luca Ceresoli
2008-09-30 13:40:41 +00:00
goldsimon
edf72a7dfb
fixed one small warning (compared u16_t to <= 0)
2008-08-26 19:57:20 +00:00
goldsimon
ba636e19a2
fixed bug #24132 : Cross-dependency between ip_addr.h and inet.h -> moved declaration of struct in_addr from ip_addr.h to inet.h
2008-08-26 19:47:05 +00:00
goldsimon
6374766a55
Added 2 asserts in pbuf_realloc to prevent dereferencing a null pointer in invalid pbuf queues
2008-08-26 19:34:18 +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
fbernon
8367feafa9
stats.h: Fix some build bugs introduced with patch #6483 (missing some parameters in macros, mainly if MEM_STATS=0 and MEMP_STATS=0).
2008-07-08 09:15:56 +00:00
jifl
f6a28808e3
Fix typo of including type in stats_display_memp empty macro
2008-07-07 12:45:47 +00:00
goldsimon
13d8ae859d
fixed bug #21433 : Calling mem_free/pbuf_free from interrupt context isn't safe: LWIP_ALLOW_MEM_FREE_FROM_OTHER_CONTEXT allows mem_free to run between mem_malloc iterations. Added illegal counter for mem stats.
2008-06-30 18:16:51 +00:00
goldsimon
95b15fe463
Fix typo, add comment
2008-06-27 20:34:51 +00:00
goldsimon
779938ea68
patch #6483 : stats module improvement: Added defines to display each module's statistic individually, added stats defines for MEM, MEMP and SYS modules, removed (unused) rexmit counter.
2008-06-27 18:37:53 +00:00
jifl
139944a3ac
* tcp_in.c: Fix for bug #23693 as suggested by Art R. Ensure cseg is unused
...
if tcp_seg_copy fails.
2008-06-24 15:46:38 +00:00
goldsimon
b94e3a874d
Added debug trace for incoming eth packets in ethernet_input like suggested in patch #6519
2008-06-19 16:40:59 +00:00
goldsimon
3d8e5003af
Fixed includes in netif.c, removed loop_cnt_max member in struct netif (instead the define LWIP_LOOPBACK_MAX_PBUFS is used directly)
2008-06-19 16:27:18 +00:00
goldsimon
94cd14e90d
patch #6459 : Made err_t overridable to use a more efficient type (define LWIP_ERR_T in cc.h)
2008-06-17 20:27:31 +00:00
goldsimon
c93cfb2c74
Changed two MEMCPY calls to SMEMCPY
2008-06-17 20:16:23 +00:00
goldsimon
521d439a07
Added a configuration option for slipif for symmetry to loopif (patch #6480 )
2008-06-17 20:14:05 +00:00
goldsimon
460b18e82c
Fixed loopif_poll define (now maps directly to netif_poll)
2008-06-17 20:12:22 +00:00
goldsimon
ef3666ef26
Checked in some ideas of patch #6460 (loop optimizations) and created defines for swapping bytes and folding u32 to u16.
2008-06-17 20:06:25 +00:00
goldsimon
e0aaa87b1f
Increasing etharp error stats on unsupported ethtype in ethernet_input()
2008-06-17 19:46:30 +00:00
goldsimon
eba83ab740
Changed loopback code (less difference between NO_SYS = 0 / 1), added setting LWIP_LOOPBACK_MAX_PBUFS to limit loopback-queued pbufs
2008-06-17 19:39:22 +00:00
goldsimon
a8141c53a8
Got the date & place of the newest feature wrong ;-)
2008-06-12 20:21:40 +00:00
goldsimon
88ff8c83e9
Checked in slightly modified version of patch # 6370: Moved loopif code to netif.c so that loopback traffic is supported on all netifs (all local IPs).
2008-06-12 20:10:08 +00:00
kieranm
24e0b25215
Remove redundant "if" statement, and use real rcv_wnd
...
rather than rcv_ann_wnd when deciding if packets are in-window.
Contributed by <arasmussen@consultant.datasys.swri.edu >
2008-05-30 12:21:29 +00:00
kieranm
7bc881ccc5
Fix BUG#23254. Change macro definition of mem_* to allow
...
passing as function pointers when MEM_LIBC_MALLOC is defined.
2008-05-30 11:37:15 +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
jifl
40d4a8fc2f
Trivial change: correct sense of comment about LWIP_ERROR macro
2008-04-29 16:51:35 +00:00
fbernon
7be9e292dc
sockets.h: minor changes, add comments for ToS options
2008-04-26 10:46:23 +00:00
goldsimon
9ccd31a12e
fixed bug #22804 : dhcp_stop doesn't clear NETIF_FLAG_DHCP (flag now cleared)
2008-04-15 17:24:54 +00:00
goldsimon
a9aefcc1be
Fixed comments for pbuf_copy() and find_entry() as proposed by Luca Ceresoli on lwip-users
2008-04-01 19:05:40 +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
goldsimon
64fa8d78bc
Added global #ifndef __SIO_H__ and some comments
2008-03-27 18:06:02 +00:00
goldsimon
aee9c4c8e6
fixed bug #22249 : division by zero could occur if a remote host sent a zero mss as TCP option.
2008-03-26 11:57:12 +00:00
kieranm
bcb4afa886
Update CHANGELOG for 1.3.0
2008-03-23 13:49:39 +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
7fa9010f35
igmp.h, igmp.c: Fix bug #22613 "IGMP iphdr problem" (could have some problems to fill the IP header on some targets, use now the ip.h macros to do it).
2008-03-17 13:40:00 +00:00
fbernon
03f888c968
ppp: minor changes: fix some 'is unused' warning when debug is off.
2008-03-16 08:53:58 +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
jifl
a48370d5e9
* inet_chksum.c: Allow choice of one of the sample algorithms to be
...
made from lwipopts.h. Fix comment on how to override LWIP_CHKSUM.
2008-03-10 16:12:31 +00:00
jifl
f067d34392
* pbuf.c, ppp.c: Fix warnings on some systems with mem_malloc.
2008-03-04 16:37:46 +00:00
jifl
30d4c243ec
* mem.c, stats.c, mem.h: apply patch #6414 to avoid compiler errors
...
and/or warnings on some systems where mem_size_t and size_t differ.
2008-03-04 16:31:31 +00:00
fbernon
2637f2ad3a
inet_chksum.c: minor change for coding style
2008-03-04 14:26:44 +00:00
fbernon
9b92f4c882
dhcp.c: minor change for coding style
2008-03-04 14:25:58 +00:00
kieranm
42344ce20c
2008-03-04 Kieran Mansley (contributions by others)
...
* Numerous small compiler error/warning fixes from contributions to
mailing list after 1.3.0 release candidate made.
2008-03-04 13:41:23 +00:00
fbernon
faca23b984
Minor change: add a trace in etharp.c, find_entry
2008-02-21 14:26:14 +00:00
fbernon
0cbd7501a1
Minor changes: fix trace text in etharp.c
2008-02-21 09:16:21 +00:00
jifl
03aa8270a6
document that eth drivers input function should be ethernet_input
2008-02-18 12:27:51 +00:00
marcbou
ef70313e05
Fixed comment for LWIP_POSIX_SOCKETS_IO_NAMES
2008-01-31 18:19:29 +00:00
jifl
2ec3c46838
Fix incorrect units in comment for TCP_MSL. Allow override.
2008-01-28 15:30:06 +00:00
goldsimon
52e8ec03ba
Clarify that timeout == 0 means wait forever
2008-01-27 11:28:44 +00:00
goldsimon
c54777d957
Coding style: use named constants instead of numbers only
2008-01-27 11:22:14 +00:00
fbernon
7b11fb75d9
Minor changes: replace directy call to memcpy by MEMCPY macro.
2008-01-26 16:11:39 +00:00
fbernon
e937521014
dns.c: Fix bug #22108 "DNS problem" caused by unaligned structures.
2008-01-25 13:12:12 +00:00
fbernon
f02c39a402
tcp.c, tcp_in.c, tcp.h, opt.h: Rename LWIP_CALCULATE_EFF_SEND_MSS in TCP_CALCULATE_EFF_SEND_MSS to have coherent TCP options names.
2008-01-22 21:15:14 +00:00
fbernon
c580c2be75
Minor changes: fix a warning: "src\core\ipv4\ip_frag.c (782) : warning: potential uninitialized reference to "newpbuflen" in func "_ip_frag""
2008-01-22 18:56:40 +00:00
fbernon
8d0f689cb5
Minor changes: typo in doc files.
2008-01-21 17:00:07 +00:00
fbernon
bfd96264e6
Minor changes: fix warning in dhcp_unfold_reply when LWIP_DEBUG=0
2008-01-21 16:55:26 +00:00
fbernon
baab7c04f7
Minor changes: fix some traces in ip_frag.c (coding style and end of lines)
2008-01-21 16:53:10 +00:00
jifl
3572ec784d
Fix simple compilation error with some compilers to preserve const-ness of ethaddr - from Luca Ceresoli
2008-01-18 19:45:15 +00:00
kieranm
6f00cbb6ef
2008-01-15 Kieran Mansley
...
* tcp_out.c: BUG20511. Modify persist timer to start when we are
prevented from sending by a small send window, not just a zero
send window.
2008-01-15 13:00:51 +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
52e6922e5a
ip.c: Integrate patch #6369 " ip_input : checking before realloc".
2008-01-14 20:53:23 +00:00
fbernon
82ddf82866
Minor change: add comment
2008-01-12 16:46:40 +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
jifl
886cfbe12d
Minor spelling typos and formatting fixes.
2008-01-11 14:28:58 +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
jifl
b333b7c9dc
* opt.h, ip.c: Rename IP_OPTIONS define to IP_OPTIONS_ALLOWED to avoid
...
conflict with Linux system headers.
2008-01-09 10:05:23 +00:00
fbernon
de4b9b584c
Fix DHCP build problem.
2008-01-06 22:07:03 +00:00
jifl
bf924118de
* dhcp.c: fix bug #19927 : "DHCP NACK problem" by clearing any existing set IP
...
address entirely on receiving a DHCPNAK, and restarting discovery.
2008-01-06 21:09:11 +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
caa1834b70
Minor changes in lwip folder: fix some warnings.
2008-01-05 00:13:33 +00:00
fbernon
c61262d839
Minor changes in lwip folder: fix some warnings.
2008-01-04 23:24:05 +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
fbernon
1dfa246674
Minor changes: fix some PPP traces.
2008-01-03 20:22:14 +00:00
jifl
7e616ea71c
* core/ipv4/ip.c (ip_input): Rename ipsrcchecking -> check_ip_src, to make
...
purpose clearer.
2008-01-03 17:49:25 +00:00
kieranm
99afb15ced
Add persist timer
2007-12-31 13:34:47 +00:00
fbernon
22e2540eb6
autoip.c, etharp.c: ip_addr.h: Integrate patch #6348 : "Broadcast ARP packets in autoip". The change in etharp_raw could be removed, since all calls to etharp_raw use ethbroadcast for the "ethdst_addr" parameter. But it could be wrong in the future.
2007-12-31 13:22:03 +00:00
fbernon
8d39b1a152
ip.c: Fix bug #21846 "LwIP doesn't appear to perform any IP Source Address Filtering" reported by Tom Evans.
2007-12-30 01:09:11 +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
kieranm
1cb470662b
Whitespace fix.
2007-12-20 15:05:09 +00:00
kieranm
add4874801
2007-12-20 Kieran Mansley (based on patch from Oleg Tyshev)
...
* tcp_in.c: fix bug# 21535 (nrtx not reset correctly in SYN_SENT stat)e
2007-12-20 14:58:43 +00:00
kieranm
8cc32bc29c
2007-12-20 Kieran Mansley (based on patch from Per-Henrik Lundbolm)
...
* tcp.c, tcp_in.c, tcp_out.c, tcp.h: fix bug #20199 (better handling
of silly window avoidance and prevent lwIP from shrinking the window)
2007-12-20 14:51:35 +00:00
fbernon
fc2d28b851
Minor changes in PPP (coding style, tabs, idents...)
2007-12-19 20:47:22 +00:00
goldsimon
a3ef33c56f
Removed debug code
2007-12-16 16:24: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
goldsimon
d2fa5c91a7
Fix bug #21699 : segment leak in ooseq processing when last data packet was lost (free last segment if FIN is already received)
2007-12-13 20:24:39 +00:00
fbernon
4653974c2a
Minor change: move DNS_MSG_SIZE in opt.h, add comments.
2007-12-12 19:22:20 +00:00
fbernon
de11e7fd75
dns.h, dns.c, opt.h: move DNS options to the "right" place. Most visibles are the ones which have ram usage.
2007-12-12 17:56:03 +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
8d3d08e814
fix bug #21699 (segment leak in ooseq): add assert that all segment lists are empty in tcp_pcb_remove before setting pcb to CLOSED state; don't directly set CLOSED state from LAST_ACK in tcp_process
2007-12-04 20:41:12 +00:00
fbernon
3f96a15fd4
Minor changes (tabs)
2007-12-03 21:44:51 +00:00
goldsimon
22f51f953b
Added short comment in file description about how to handle MEM_USE_POOLS / MEM_LIBC_MALLOC
2007-12-03 18:01:28 +00:00
goldsimon
f3f7bd00e5
ip_input: check if a packet is for inp first before checking all other netifs on netif_list (speeds up packet receiving in most cases)
2007-12-03 17:55:01 +00:00
fbernon
a72e4a406f
Minor changes: coding style (tabs, ident, etc...).
2007-12-02 23:58:11 +00:00
fbernon
2fe1254aae
Minor changes: coding style (tabs, ident, etc...).
2007-12-02 23:38:45 +00:00
fbernon
e4590b26fb
Include a temporary sample of queue.h to fix build.
2007-12-02 23:33:58 +00:00
fbernon
325d6e7cfa
Minor changes: coding style (tabs, ident, etc...).
2007-12-02 23:24:59 +00:00
fbernon
6bce832060
Minor changes: coding style (tabs, ident, etc...).
2007-12-02 22:56:19 +00:00
fbernon
37a5a87057
Minor changes: coding style (tabs, ident, etc...).
2007-12-02 22:35:55 +00:00
fbernon
865f6eb5f3
Changes for coding style (typo, use LINK_STATS_INC, tabs, ident, etc...). Be careful, even if this change is minor, there is lot of lines modified, so, an error is always possible (I hope there is no problems).
2007-12-02 20:38:02 +00:00
fbernon
dde6ddfd7c
process "localhost" name in dns_gethostbyname
2007-12-02 17:15:28 +00:00
goldsimon
47d8d69b81
fix bug #21654 : exclude definition of struct timeval from #ifndef FD_SET. If including <sys/time.h> for system-struct timeval, LWIP_TIMEVAL_PRIVATE now has to be set to 0 in lwipopts.h
2007-12-02 15:24:02 +00:00
goldsimon
df1b7ea311
Minor fix: #include "lwip/api.h" was missing to compile cleanly
2007-12-02 15:18:08 +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
081e4d9209
Minor change: use goto instead of redundant code to return on error in dhcp_rev().
2007-12-02 14:40:32 +00:00
fbernon
e5a98b6a5b
Minor changes: fix some problems with PPPoE include path, add small comments in slip.c (unusual octal values?)
2007-11-30 17:22:20 +00:00
fbernon
2942157ca4
Minor changes: dnsserver initialization with DNS_SERVER_ADDRESS in dns_init
2007-11-30 16:40:46 +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
92aa004b75
connect the UDP pcb to the DNS server (IPaddress and port) to receive faster (unconnected pcbs are very inefficient in udp_input)
2007-11-30 12:46:30 +00:00
goldsimon
b28cd02149
task #7497 : Sort lists (pcb, netif, ...) for faster access UDP: move a (connected) pcb selected for input to the front of the list of pcbs so that it is found faster next time. Same for RAW pcbs that have eaten a packet.
2007-11-30 09:44:18 +00:00
goldsimon
cedd5c21e6
first attempt to fix bug #21655 (DHCP doesn't work reliably with multiple netifs): if LWIP_DHCP is enabled, UDP packets to DHCP_CLIENT_PORT are passed to netif->dhcp->pcb only (if that exists) and not to any other pcb for the same port (only solution to let UDP pcbs 'bind' to a netif instead of an IP address)
2007-11-30 08:55:15 +00:00
fbernon
b714cd5f4b
First fix for bug #21664 "PPP code is broken".
2007-11-29 22:19:56 +00:00
goldsimon
788892ee7c
Minor coding style changes
2007-11-28 21:44:17 +00:00
goldsimon
1b07fecbf3
Introduced ETHARP_STATS
2007-11-28 21:25:06 +00:00
goldsimon
4a01122fb7
Use ICMP_STATS_INC instead of #if ICMP_STATS...
2007-11-28 21:21:06 +00:00
goldsimon
4211da00b3
Use IP_STATS_INC instead of #if IP_STATS...
2007-11-28 21:18:37 +00:00
goldsimon
7f3cff6e09
Use LINK_STATS_INC instead of #if LINK_STATS...
2007-11-28 21:15:55 +00:00
goldsimon
6e612e5def
mem_malloc with MEM_USE_POOLS=1: if size > size of biggest pool and custom pools (in addition to the MEM_POOLs) were defined, the first custom pool was used instead of asserting
2007-11-28 18:24:08 +00:00
jgrubb
a7718b2ef3
Minor change: remove unused #define
2007-11-28 17:19:39 +00:00
jgrubb
472407c719
Fix typo (MEMP_POOL_START/END to FIRST/LAST)
2007-11-28 17:19:15 +00:00
goldsimon
f07c1cf874
fixed bug #21643 (udp_send/raw_send don't fail if netif is down) by letting ip_route only use netifs that are up.
2007-11-28 06:48:50 +00:00
jgrubb
ce7c311ecf
Add two more sanity checks on memory settings
2007-11-28 00:11:05 +00:00
fbernon
499c63bd0a
Fix macro ERR_IS_FATAL (else, no error is fatal).
2007-11-27 21:54:58 +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
b4741332e0
Implemented new function udp_sendto_if which takes the netif to send as an argument (to be able to send on netifs that are down).
2007-11-27 20:13:16 +00:00
goldsimon
3874f5f5e8
Minor coding style changes
2007-11-27 19:55:31 +00:00
fbernon
8c19f9a57e
Fix to be able to build SNMP with LWIP_ARP=0. It's not a perfect solution, but I put some @todo points to review them later.
2007-11-27 19:53:47 +00:00
goldsimon
f57c2424cf
Fixed bug #21582 : pcb->acked accounting can be wrong when ACKs arrive out-of-order
2007-11-26 19:08:39 +00:00
fbernon
181b68b01e
Minor change (forgot last CRLF)
2007-11-26 10:24:36 +00:00
fbernon
93d5bed697
Minor change: add #if 0 / #endif in ethernetif.c skeleton to avoid false bug reports.
2007-11-26 10:23:40 +00:00
goldsimon
5743b11925
Check state == CLOSED in tcp_bind and tcp_connect to prevent binding/connecting twice (using LWIP_ERROR: can be disabled)
2007-11-25 18:37:34 +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
511cdfb951
Minor coding style changes, added some comments
2007-11-25 14:23:59 +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
1b208d0954
dhcp_unfold_reply() uses pbuf_copy_partial instead of its own copy algorithm; corrected some assert messages
2007-11-25 11:51:44 +00:00
goldsimon
4ac4d56b53
Added documentation / minor code layout changes
2007-11-25 10:43:28 +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
goldsimon
be0686d905
Added some more comments and function documentation
2007-11-25 10:01:22 +00:00
fbernon
9940b049ec
Minor changes (documentation).
2007-11-25 00:28:06 +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
3fc883e8fb
Added the wiki and a note about the mailing lists
2007-11-24 19:49:05 +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
32a09370e1
tcpip.h was not compilable with both NO_SYS and LWIP_NETCONN set to 0 (include sys.h was missing)
2007-11-24 14:50:26 +00:00
fbernon
32c6893081
Minor changes (typo and wrong defines names in sanity checks)
2007-11-22 10:17:16 +00:00
goldsimon
95425552d7
Implemented calculating the effective send-mss based on the MTU of the netif used to send. Enabled by default. Disable by setting LWIP_CALCULATE_EFF_SEND_MSS to 0. This fixes bug #21535 .
2007-11-21 18:37:23 +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
fbernon
c31b405af6
Minor changes in DNS client.
2007-11-20 21:37:04 +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
goldsimon
b3c52f574a
Added function documentation to dns.c, removed function documentation from dns.h (functions should be documented where they are implemented!), dns_table_entry doesn't have to be packed (slower, bigger code for most machines), converted dns_init to return void, dns_table is implicitly initialized to zero, dns_lookup can be static, dns_send returns correct error values, added some asserts, compacted dns_recv using some (ugly) gotos, compacted dns_gethostbyname by combining the same return value
2007-11-20 20:28:01 +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
fbernon
da4df1f414
Fix DNS client TTL processing.
2007-11-18 21:30:45 +00:00
fbernon
7f0640b040
Minor changes on DNS.
2007-11-18 21:04:53 +00:00
fbernon
8c0e6de00a
fix DNS problem with pbuf chain.
2007-11-18 20:54:44 +00:00
fbernon
8ff1194b6a
Changes on DNS client. Add multiples dns servers support.
2007-11-18 20:30:12 +00:00
goldsimon
9dd4ad6c1f
Added thread-safe function gethostbyname_r (as in glibc)
2007-11-18 16:36:34 +00:00
fbernon
4e398e2aa9
Minor changes on DNS client. Coding style & add "response" checking
2007-11-18 15:51:34 +00:00
fbernon
92401faa72
Minor changes on DNS client. Note that "compressed answers are fixed".
2007-11-18 15:01:45 +00:00
fbernon
edc46281a4
Minor changes on DNS client.
2007-11-18 14:19:27 +00:00
goldsimon
6c8b3e3b58
Deleted old inet.c/inet6.c files
2007-11-16 19:32:19 +00:00
goldsimon
1faf0ab9e3
Moved inet files into ipv4/ipv6 directory; splitted inet.c/inet.h into inet and chksum part; changed includes in all lwIP files as appropriate
2007-11-16 19:31:10 +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
goldsimon
7e447c83fb
Turned all hostname variables and parameters into (const char*)
2007-11-16 17:08:03 +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
8020ba2dc5
tcp_send_ctrl(): call tcp_enqueue with the new flag TCP_WRITE_FLAG_COPY instead of 1
2007-11-12 19:38:25 +00:00
goldsimon
21bbc9a81a
Fixed bug: assert fired when MEMP_ARP_QUEUE was empty (which can happen any time). Now the packet simply isn't enqueued when out of memory.
2007-11-10 17:41:46 +00:00
goldsimon
bfe24b138d
Patch #6215 : added ifAdminStatus write support (if explicitly enabled by defining SNMP_SAFE_REQUESTS to 0); added code to check link status for ifOperStatus if LWIP_NETIF_LINK_CALLBACK is defined.
2007-11-06 20:53:37 +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
4a6f60937a
Minor change, add comment for "apiflags" parameters.
2007-11-01 19:38:01 +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
goldsimon
2d5908f4de
Fixed bug #21494 : The send mss (pcb->mss) is set to 536 (or TCP_MSS if that is smaller) as long as no MSS option is received from the remote host.
2007-11-01 16:53:43 +00:00
goldsimon
298d5cf042
Fixed bug #21491 : The MSS option sent (with SYN) is now based on TCP_MSS instead of pcb->mss (on passive open now effectively sending our configured TCP_MSS instead of the one received).
2007-11-01 16:23:32 +00:00
goldsimon
853765954e
Fixed bug #21181 : On active open, the initial congestion window was calculated based on the configured TCP_MSS, not on the MSS option received with SYN+ACK.
2007-11-01 15:51:43 +00:00
goldsimon
7a99d73092
Added some explaining comments.
2007-10-28 17:43:21 +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
86dc53b72a
Minor change (coding style, #if/#endif to include icmp.h is not necessary)
2007-10-16 07:11:35 +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
goldsimon
6d9b44e243
IP_REASSEMBLY: send ICMP time exceeded when discarding datagrams for which the first fragment was received; try to keep the header of the first (octet 0) fragment; combined code to make it smaller; fixed bug in timer: when freeing packets, counter was not updated correctly
2007-10-15 19:33:16 +00:00
goldsimon
e864ba6c91
IP_REASSEMBLY: Changed 'packet' to 'datagram' to match the names used in the RFCs
2007-10-15 19:28:09 +00:00
goldsimon
0686380302
Removed bug on memory failure introduced 3 months ago in rev 1.34 (input pbuf was freed on puf_alloc failure)
2007-10-15 19:18:02 +00:00
fbernon
282e9ead17
Minor change (sanity check for MEMP_NUM_REASSDATA only done if IP_REASSEMBLY=1)
2007-10-12 06:50:16 +00:00
goldsimon
1f08a5e5f5
Added code to free the oldest packets if the IP_REASS_MAX_PBUFS limit is reached or MEMP_REASSDATA is empty.
2007-10-11 19:49:06 +00:00
goldsimon
c41508cc8d
Added check that MEMP_NUM_REASSDATA is bigger than IP_REASS_MAX_PBUFS (because each MEMP_NUM_REASSDATA has one pbuf at least!)
2007-10-11 19:26:04 +00:00
goldsimon
187df4464e
Added description for MEMP_NUM_REASSDATA and changed the default value to 5.
2007-10-11 19:24:59 +00:00
goldsimon
c94d640e2a
Gave the parameters of pbuf_cat() and pbuf_chain() better names to make the use more clear.
2007-10-11 19:24:23 +00:00
fbernon
cf998b7bf8
Minor fix (remove warning)
2007-10-10 08:13:58 +00:00
fbernon
1a104762ea
Update documentation for the SNMP uptime timestamp.
2007-10-10 08:12:19 +00:00
fbernon
2a5209bb5a
Update documentation for the SNMP uptime timestamp.
2007-10-10 08:05:34 +00:00
fbernon
ebd167b658
Add sanity checking on TCP_MAXRTX and TCP_SYNMAXRTX
2007-10-09 20:48:28 +00:00
goldsimon
c13ec867c9
Forgot two explicit initializations...
2007-10-09 20:00:55 +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
536f2e42d2
Fixed UDPLite receive: checksum was calculated wrong if checksum coverage != tot_len
2007-10-09 19:43:29 +00:00
goldsimon
0f9799d7e0
Added todo: free the oldest entry when the MEMP_REASSDATA pool is empty or the IP_REASS_MAX_PBUFS limit is reached
2007-10-09 19:31:54 +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
goldsimon
8980c3f74e
Typo in chain_frag_into_packet_and_validate (but obviously worked anyway...)
2007-10-09 06:13:12 +00:00
goldsimon
418f57dd6a
Removed type conversion warning in debug statement.
2007-10-08 19:06:58 +00:00
goldsimon
9ef005454a
lfree was not updated in mem_realloc!
2007-10-08 18:39:44 +00:00
fbernon
afad35a8ac
Minor change (add a default value to tune for MEMP_NUM_REASSDATA in opt.h)
2007-10-08 07:39:24 +00:00
goldsimon
2ca113a218
Fixed UDPLite SENDING: Checksum was always generated too short and also was generated wrong if checksum coverage != tot_len.
2007-10-07 20:19:23 +00:00
fbernon
911ee4d9f9
Minor change (coding style)
2007-10-07 17:41:21 +00:00
fbernon
9804b25acc
Fix CHANGELOG entry
2007-10-07 17:30:50 +00:00
fbernon
87e16a8f47
sockets.c, api.h, api_lib.c: First step to fix "bug #20900 : Potential crash error problem with netconn_peer & netconn_addr". VERY IMPORTANT: this change cause an API breakage for netconn_peer, since a parameter type change. Any compiler should cause an error without any changes in yours netconn_peer calls (so, it can't be a "silent change"). It also reduce a little bit the footprint for socket layer (lwip_getpeername & lwip_getsockname use now a common lwip_getaddrname function since netconn_peer & netconn_addr have the same parameters).
2007-10-07 17:26:54 +00:00
goldsimon
e561c7b49d
Added check for overlapping or duplicate fragments. ip_reass_init() is not needed any more (the check is done in chain_frag_into_packet_and_validate()).
2007-10-07 11:52:32 +00:00
goldsimon
8cd65eaf46
Check for TCP_SND_QUEUELEN overflow.
2007-10-07 11:27:45 +00:00
goldsimon
b7ef6077df
Changed IP_REASSEMBLY to enqueue the received pbufs so that multiple packets can be reassembled simultaneously and no static reassembly buffer is needed.
2007-10-06 15:24:43 +00:00
goldsimon
cb71d6d393
Moved ethernet_input from tcpip.c to etharp.c so all netifs (or ports) can use it.
2007-10-05 14:00:48 +00:00
fbernon
79c00be516
netifapi.h, netifapi.c: add function netifapi_netif_set_default. Change the common function to reduce a little bit the footprint (for all functions using only the "netif" parameter).
2007-10-05 13:34:48 +00:00
fbernon
949efb414a
netifapi.h, netifapi.c: add functions netifapi_netif_set_up, netifapi_netif_set_down, netifapi_autoip_start and netifapi_autoip_stop. Use a common function to reduce a little bit the footprint (for all functions using only the "netif" parameter).
2007-10-03 16:54:27 +00:00
jifl
5dd1256769
Small tweak: clarify use of link speed in comments for NETIF_INIT_SNMP.
2007-10-03 09:10:28 +00:00
fbernon
c52ef1d2b3
Minor changes for debug (indent, and set LWIP_DBG_TYPES_ON to LWIP_DBG_ON to have all traces selected display per default, in the same spirit that LWIP_DBG_MIN_LEVEL is set per default to LWIP_DBG_LEVEL_OFF)
2007-09-22 11:16:07 +00:00
fbernon
c7e91d3302
Minor change, sys_prot_t is undefined is NO_SYS=1
2007-09-21 21:23:39 +00:00
jifl
c1bbcf5ed3
Add further checking that MEMP_NUM_SYS_TIMEOUT is high enough
2007-09-21 14:39:03 +00:00
fbernon
87c5a61d07
Minor changes by Andrew Dennison: add sanity check, improve debug messages for memp, fix some warnings...
2007-09-21 12:36:35 +00:00
goldsimon
0aa3d89134
Fixed bug #21080 (tcp_bind without check pcbs in TIME_WAIT state) by checking tcp_tw_pcbs also
2007-09-20 18:27:50 +00:00
kleshov
4ffafdeb86
Fixed bug #21077 : inaccuracy in calculation of lwip_stat.mem.used
2007-09-19 17:56:39 +00:00
goldsimon
0bf32b957d
Fixed bug #21107 (didn't reset IP TTL in ICMP echo replies)
2007-09-19 06:12:34 +00:00
fbernon
2bdd916b06
udp.h, udp.c, sockets.c: Changes for " #20503 IGMP Improvement". Add IP_MULTICAST_IF option in socket API, and a new field "multicast_ip" in "struct udp_pcb" (for netconn and raw API users), only if LWIP_IGMP=1. Add getsockopt processing for IP_MULTICAST_TTL and IP_MULTICAST_IF.
2007-09-15 15:19:41 +00:00
kleshov
93c487fb75
Fix bug #21077 : inaccuracy in calculation of lwip_stat.mem.used
2007-09-15 11:34:06 +00:00
fbernon
036d1aae50
Fix "bug #21075 : pbuf_realloc() use with PBUF_RAM and MEM_LIBC_MALLOC fails" signaled by Bill Florac
2007-09-15 06:53:16 +00:00
kleshov
f600a868f5
Indentation fix
2007-09-13 17:46:13 +00:00
fbernon
95f2d48ac4
Avoid to lost previous error codes in sockets.c and api_lib.c.
2007-09-13 15:03:42 +00:00
fbernon
8c847a85ae
Add a sanity check for PPP, and a #if !NO_SYS/#endif for slipif_loop
2007-09-12 19:16:44 +00:00
fbernon
c265fa3331
Add missing #if/#endif to fix build problems with:
...
#define NO_SYS 0
#define LWIP_SOCKET 0
#define LWIP_NETCONN 0
2007-09-12 09:19:43 +00:00
fbernon
6aab0332e8
Add missing #if/#endif to fix build problems
2007-09-12 09:02:26 +00:00
fbernon
47ae677652
enable to remove SNMP timer (which consumne several cycles even when it's not necessary). snmp_agent.txt tell to call snmp_inc_sysuptime() each 10ms (but, it's intrusive if you use sys_timeout feature). Now, you can decide to call snmp_add_sysuptime(100) each 1000ms (which is bigger "step", but call to a lower frequency). Or, you can decide to not call snmp_inc_sysuptime() or snmp_add_sysuptime(), and to define the SNMP_GET_SYSUPTIME(sysuptime) macro. This one is undefined by default in mib2.c. SNMP_GET_SYSUPTIME is called inside snmp_get_sysuptime(u32_t *value), and enable to change "sysuptime" value only when it's queried (any direct call to "sysuptime" is changed by a call to snmp_get_sysuptime).
2007-09-10 18:50:44 +00:00
jgrubb
54e1b79ac5
Make pbuf_alloc a bit easier to read (change parameter name from "l" to "layer" and use LWIP_MIN instead of ternary operatory)
2007-09-10 18:25:15 +00:00
jgrubb
6afe1f3597
DHCP_DOES_ARP_CHECK is set to 1 by default -- the compile-time checks fail if DHCP is off... So this patch sets the default to be 1 only if both DHCP and ARP are set.
2007-09-10 18:12:13 +00:00
fbernon
4466260480
Remove CVS keyword
2007-09-10 07:56:16 +00:00
fbernon
1c6e31173d
Add missing include files.
2007-09-09 22:34:55 +00:00
fbernon
939180c1a1
igmp.h, igmp.c, netif.h, netif.c, ip.c: To enable to have interfaces with IGMP, and others without it, there is a new NETIF_FLAG_IGMP flag to set in netif->flags if you want IGMP on an interface. igmp_stop() is now called inside netif_remove(). igmp_report_groups() is now called inside netif_set_link_up() (need to have LWIP_NETIF_LINK_CALLBACK=1) to resend reports once the link is up (avoid to wait the next query message to receive the matching multicast streams).
2007-09-09 20:46:33 +00:00
fbernon
8205737fdb
sockets.c, ip.h, api.h, tcp.h: declare a "struct ip_pcb" which only contains IP_PCB. Add in the netconn's "pcb" union a "struct ip_pcb *ip;" (no size change). Use this new field to access to common pcb fields (ttl, tos, so_options, etc...). Enable to access to these fields with LWIP_TCP=0.
2007-09-07 23:47:02 +00:00
fbernon
75d4c9b446
Add some deprecated options from "task #7142 : Sanity check user-configurable values".
2007-09-07 23:28:02 +00:00
fbernon
e3cd1ac1f9
Minor changes (but in lot of files): add #if/#endif for options where they could miss. #if LWIP_xxx if always put after #include "lwip/opt.h" (note this one indirectly include cc.h). Move others includes inside #if/#endif block.
2007-09-07 23:01:59 +00:00
fbernon
027a70a415
Last sanity checking centralization for "task #7142 : Sanity check user-configurable values".
2007-09-07 17:59:30 +00:00
fbernon
3dfe5f993b
DON'T WORRY, it's just a test on CVS keywords (I will remove)
2007-09-07 12:32:40 +00:00
fbernon
f5991dd9b6
DON'T WORRY, it's just a test on CVS keywords (I will remove)
2007-09-07 12:31:50 +00:00
fbernon
58c5d008d5
DON'T WORRY, it's just a test on CVS keywords (I will remove)
2007-09-07 09:23:51 +00:00
fbernon
ac1149156d
several-files: replace some #include "arch/cc.h" by "lwip/arch.h", or simply remove it as long as "lwip/opt.h" is included before (this one include "lwip/debug.h" which already include "lwip/arch.h"). Like that, default defines are provided by "lwip/arch.h" if they are not defined in cc.h, in the same spirit than "lwip/opt.h" for lwipopts.h.
2007-09-06 16:43:43 +00:00
fbernon
ca866c0d7d
Integrate "task #7272 : LWIP_ICMP option". The new option LWIP_ICMP enable/disable ICMP module inside the IP stack (enable per default). Be careful, disabling ICMP make your product non-compliant to RFC1122, but help to reduce footprint, and to reduce "visibility" on the Internet.
2007-09-05 17:20:45 +00:00
fbernon
90a3f88c08
Change parameters list for sys_thread_new (see "task #7252 : Create sys_thread_new_ex()"). Two new parameters have to be provided: a task name, and a task stack size. For this one, since it's platform dependant, you could define the best one for you in your lwipopts.h. For port maintainers, you can just add these new parameters in your sys_arch.c file, and but it's not mandatory, use them in your OS specific functions.
2007-09-05 16:14:28 +00:00
fbernon
c1f89c5640
Move some build time checkings inside init.c for task #7142 "Sanity check user-configurable values".
2007-09-05 13:19:25 +00:00
fbernon
5865a78c1e
Minor fix (add some parenthesis where macro expansion could cause problems)
2007-09-05 10:18:39 +00:00
fbernon
d4616a7fc6
Replace mem_malloc call by memp_malloc, and use a new MEMP_NUM_IGMP_GROUP option (see opt.h to define the value). It will avoid potential fragmentation problems, use a counter to know how many times a group is used on an netif, and free it when all applications leave it. MEMP_NUM_IGMP_GROUP got 8 as default value (and init.c got a sanity check if LWIP_IGMP!=0).
2007-09-04 15:15:20 +00:00
fbernon
d794357504
Fix warnings inside sockets.c with "gcc" compilers. See "Description" in http://www.opengroup.org/onlinepubs/007908799/xns/syssocket.h.html :
2007-09-04 14:30:26 +00:00
fbernon
79b0484e20
Minor changes (fix some warnings like "function declaration isn't a prototype" and "no previous prototype for 'lwip_init'"...)
2007-09-04 13:51:48 +00:00
fbernon
62b4741b19
Changes for " #20503 IGMP Improvement". Initialize igmp_mac_filter to NULL in netif_add (this field should be set in the netif's "init" function). Use the "imr_interface" field (for socket layer) and/or the "interface" field (for netconn layer), for join/leave operations. The igmp_join/leavegroup first parameter change from a netif to an ipaddr. This field could be a netif's ipaddr, or "any" (same meaning than ip_addr_isany).
2007-09-03 14:53:18 +00:00
fbernon
327f06bbaf
Replace "netif_default = NULL;" by "netif_set_default(NULL);" in netif_remove (do some processing, like for SNMP...)
2007-09-03 12:22:00 +00:00
fbernon
d7cd90b5b8
Add in igmp_joingroup & igmp_leavegroup a LWIP_ERROR checking on netif value.
2007-09-03 09:56:38 +00:00
fbernon
85fef90c94
Add enum snmp_ifType in snmp.h, and use it in network interfaces for NETIF_INIT_SNMP
2007-08-31 10:14:09 +00:00
fbernon
fca25479ad
Minor fix (else, cause build error). Since SO_REUSE is always used in the code (even if the current code is not working), it is defined in opt.h with 0 as default value (it's normal). So, the error is not if it is defined, but if it is defined to 1.
2007-08-31 09:42:32 +00:00
fbernon
231d965bcb
Minor fix (use ETHARP_HWADDR_LEN)
2007-08-31 09:02:53 +00:00
jgrubb
6c10282f9a
Put back in SO_REUSE
2007-08-30 22:41:24 +00:00
jgrubb
cb399272fd
Move deprecated options from opt.h to init.c
2007-08-30 22:33:55 +00:00
fbernon
245bce04d1
Add netbuf.h, netbuf.c, Change api.h, api_lib.c: #7249 "Split netbuf functions from api/api_lib". Now netbuf API is independant of netconn, and can be used with other API (application based on raw API, or future "socket2" API). Ports maintainers just have to add src/api/netbuf.c in their makefile/projects.
2007-08-30 16:55:10 +00:00
fbernon
3101bdf127
Add some others sanity checkings
2007-08-30 16:06:51 +00:00
fbernon
384ae9c407
Minor change (ident, remove comment, change trace text)
2007-08-30 15:53:15 +00:00
fbernon
c671f8e7ef
Replace API programmation error checking for IGMP join/leave (ismulticast(addr)) by LWIP_ERROR checking.
2007-08-30 15:48:14 +00:00
jifl
f39b9c85fe
Add further checks. Move compile-time checks out of LWIP_DEBUG ifdef
2007-08-30 15:33:51 +00:00
fbernon
ab36270885
igmp.h, igmp.c: Some changes to remove some redundant code, add some traces, and fix some coding style.
2007-08-30 14:20:54 +00:00
fbernon
bd65dd8098
init.c: Add first version of lwip_sanity_check for task #7142 "Sanity check user-configurable values".
2007-08-30 10:15:17 +00:00
fbernon
36b6f308e6
Minor fix (coding style, comments, spaces, endline...)
2007-08-30 09:14:28 +00:00
fbernon
cd208314e0
igmp.h, igmp.c, tcpip.c, init.c, netif.c: change igmp_init and add igmp_start. igmp_start is call inside netif_add. Now, igmp initialization is in the same spirit than the others modules. Modify some IGMP debug traces.
2007-08-29 21:12:32 +00:00
fbernon
da7b5135de
Minor Fix (ident)
2007-08-29 20:50:53 +00:00
fbernon
cb3d2b327a
Minor fix: replace C++ comments by C comments.
2007-08-29 09:25:17 +00:00
fbernon
48db3a3e92
Add init.h, init.c, Change opt.h, tcpip.c: Task #7213 "Add a lwip_init function" Add lwip_init function to regroup all modules initializations, and to provide a place to add code for task #7142 "Sanity check user-configurable values". Ports maintainers should remove direct initializations calls from their code, and add init.c in their makefiles. Note that lwip_init() function is called inside tcpip_init, but can also be used by raw api users since all calls are disabled when matching options are disabled. Also note that their is new options in opt.h, you should configure in your lwipopts.h (they are enabled per default).
2007-08-29 08:11:06 +00:00
fbernon
7182fb8fb0
tcpip.c: Fix TCPIP_MSG_INPKT processing: now, tcpip_input can be used for any kind of packets. These packets are considered like Ethernet packets (payload pointing to ethhdr) if the netif got the NETIF_FLAG_ETHARP flag. Else, packets are considered like IP packets (payload pointing to iphdr).
2007-08-29 07:51:20 +00:00
fbernon
d7da390ae9
Fix coding style (use #if and not #ifdef) for IPv6
2007-08-28 16:03:53 +00:00
fbernon
54c1025ec0
First fix for "bug #20900 : Potential crash error problem with netconn_peer & netconn_addr". Introduce NETCONN_LISTEN netconn_state and remove obsolete ones (NETCONN_RECV & NETCONN_ACCEPT).
2007-08-27 10:08:53 +00:00
jifl
5e7b7cba31
"Fix" a few more cases where Paradigm C++ may mis-compile 16-bit right shifts on 32-bit quantities
2007-08-27 01:59:52 +00:00
marcbou
5a6b1cbf66
Added CHANGELOG entries for my recent contributions.
2007-08-27 00:14:21 +00:00
marcbou
180e6d2c75
Reset the callbacks and arg (conn) to NULL in do_close_internal(), because
...
TCP callbacks in api_msg.c can under certain circumstances be called with an
invalid conn pointer after the connection has been closed (and conn has been
freed).
2007-08-26 23:58:33 +00:00
fbernon
acbf25f2eb
netif.h, netif.c: Integrate "patch #6163 : Function to check if link layer is up". Add a netif_is_link_up() function if LWIP_NETIF_LINK_CALLBACK option is set.
2007-08-25 10:43:19 +00:00
kieranm
7c90cc6aac
inet.c Modify (acc >> 16) test to ((acc >> 16) != 0) to help buggy
...
compiler (Paradigm C++)
2007-08-24 14:31:53 +00:00
fbernon
261af8dc07
netif.h, netif.c, opt.h: Rename LWIP_NETIF_CALLBACK in LWIP_NETIF_STATUS_CALLBACK to be coherent with new LWIP_NETIF_LINK_CALLBACK option before next release.
2007-08-22 11:26:01 +00:00
fbernon
2f344268ff
Minor fix (spaces and comment)
2007-08-22 11:00:02 +00:00
fbernon
42f3c24fc4
tcpip.h, tcpip.c, ethernetif.c, opt.h: remove options ETHARP_TCPIP_INPUT & ETHARP_TCPIP_ETHINPUT, now, only "ethinput" code is supported, even if the name is tcpip_input (we keep the name of 1.2.0 function).
2007-08-22 10:04:35 +00:00
fbernon
c4b97a1710
Forget to rename this line (pbuf->flgs->pbuf->flags)
2007-08-22 08:47:48 +00:00
fbernon
4f76bc42d7
Rename pbuf's "flgs" in "flags" (see in [lwip-devel] Last changes by Marc)
2007-08-20 19:15:43 +00:00
fbernon
fbd5600563
Force a build error if MEMP_NUM_TCPIP_MSG is always defined
2007-08-20 18:53:33 +00:00
fbernon
3259e2eac9
Replace PBUF_LINK_HLEN before PBUF_POOL_BUFSIZE, restore PPP options changed by Marc Boucher but lost with last Jared changes...
2007-08-20 17:05:01 +00:00
jgrubb
baca292f47
Task #7136 : Fix bug of wrong file name for centralized mempool settings.
2007-08-20 16:42:16 +00:00
fbernon
8babf0ec73
Fix wrong define for both pool "struct tcpip_msg" + minor fix (coding style)
2007-08-20 16:25:15 +00:00
fbernon
c07d124d4b
Minor change (fix comment)
2007-08-20 16:22:17 +00:00
marcbou
a0db1eaa32
Removed PBUF_FLAG_LINK_BROADCAST.
2007-08-17 22:23:42 +00:00
marcbou
dbd61d129d
Fix potential pbuf leaks.
2007-08-17 22:15:24 +00:00
jgrubb
21b5fb5ddb
Task #7143 : Clean up opt.h. Made all the comment formats the same (uses Doxygen style), a couple minor reorderings. Changed a few of the default stats variables to depend on whether the modules were even used (i.e. #define TCP_STATS (LWIP_TCP) ). PPP options could still use some cleaning.
2007-08-17 18:31:05 +00:00
jgrubb
f55fafbc66
*** empty log message ***
2007-08-17 18:19:25 +00:00
jgrubb
768843f1f0
Task #7136 : Centralize mempool settings into new memp_std.h and optional user file lwippools.h. (Remove MEMP_POOL_SIZE/NUM flags, add new MEMP_USE_CUSTOM_POOLS option)
2007-08-17 18:18:58 +00:00
jgrubb
cc7d1226ee
Task #7136 : Centralize mempool settings into new memp_std.h and optional user file lwippools.h.
2007-08-17 17:49:17 +00:00
fbernon
8abafc54a6
Fix comment
2007-08-17 10:49:35 +00:00
fbernon
885695fa67
Minor changes (tabs)
2007-08-17 10:46:07 +00:00
fbernon
e0bf309bb5
Add raw_init in tcpip_init + minor changes (tabs, ident, coding style...)
2007-08-17 09:57:37 +00:00
marcbou
d907bcd57a
lwip_recvfrom() tweaks.
2007-08-17 05:55:24 +00:00
marcbou
0167bbb89a
Per Frederic's suggestion, renamed
...
[MEMP_[NUM_]]TCPIP_MSG to [MEMP_[NUM_]]TCPIP_MSG_API
and
[MEMP_[NUM_]]TCPIP_MSG_INPUT to [MEMP_[NUM_]]TCPIP_MSG_INPKT.
Added defines in opt.h for temporary compatibility with older lwipopts.h.
2007-08-17 02:46:43 +00:00
marcbou
0471aaec52
Use enum pbuf_flag as pbuf_type.
...
Renumber PBUF_FLAG_*.
2007-08-17 02:09:43 +00:00
marcbou
18636a4df5
Fixed misplaced #endif.
2007-08-17 02:07:26 +00:00
fbernon
2be122875a
Minor changes (tabs, ident, coding style...)
2007-08-17 00:30:27 +00:00
marcbou
c517f6daf9
Backed out lwip_close() change after discussion with Frederic.
2007-08-16 23:09:04 +00:00
marcbou
07223bf5ef
Backed out last change to netconn_delete() after discussion with Frederic.
2007-08-16 23:06:42 +00:00
marcbou
7862ba583e
Moved lwip/src/netif/ppp/ppp_oe.h to lwip/src/include/netif/ppp_oe.h
2007-08-16 21:12:24 +00:00
marcbou
8c10d91135
ethbroadcast now a shared global provided by etharp.
2007-08-16 20:52:59 +00:00
marcbou
c81d0f3393
fix ethernet_input() return code warning.
2007-08-16 20:50:43 +00:00
marcbou
0b8b9e8033
Changed // style comment to /* style */ comment.
2007-08-16 20:41:56 +00:00
marcbou
b73198d5ef
Provide default value for MEMP_NUM_TCPIP_MSG_INPUT if not defined.
2007-08-16 20:39:29 +00:00
marcbou
4236699052
Split pbuf flags in pbuf type and flgs.
...
Improved lwip_recvfrom(). TCP push now propagated.
2007-08-16 20:22:15 +00:00
marcbou
75935ad251
Changed // style comments to /* style */ comments.
2007-08-16 20:17:50 +00:00
marcbou
a3c3f47e17
lwip_close(): call netconn_delete() under socksem to properly handle
...
concurrent closes.
2007-08-16 20:08:33 +00:00
marcbou
17f07a36ef
netconn_delete(): unblock potentially waiting recv.
2007-08-16 20:03:23 +00:00
marcbou
557a0c7ae3
Removed TCPIP_MSG_ETHINPUT. TCPIP_MSG_INPUT now used for
...
both ETHARP_TCPIP_INPUT and ETHARP_TCPIP_ETHINPUT.
2007-08-16 19:55:30 +00:00
marcbou
1b98df4a0d
Added distinct memp (MEMP_TCPIP_MSG_INPUT) for input packets to prevent
...
floods from consuming all of MEMP_TCPIP_MSG and starving other message types.
2007-08-16 19:49:08 +00:00
marcbou
58bfb0458e
Added PPPoE support to ethernet_input()
2007-08-16 19:16:03 +00:00
marcbou
95cbf95c50
Added mem_calloc().
2007-08-16 18:37:15 +00:00
marcbou
0b4402ebc8
lwip_accept(): check netconn_peer() error return.
2007-08-16 18:29:37 +00:00
marcbou
d64b3f21e6
Initialize newconn->state to NETCONN_NONE in accept_function;
...
otherwise it was left to NETCONN_CLOSE and sent_tcp() could prematurely
close the connection.
2007-08-16 18:24:29 +00:00
marcbou
931fcfd0f5
Added PPPoE support and various PPP improvements.
2007-08-16 18:12:20 +00:00
kieranm
a6ca9aa306
* tcp_in.c: Fix for bug #19953 - correct TCP state machine when
...
* receiving FIN+ACK in SYN_RECV state
2007-08-16 15:57:31 +00:00
fbernon
40ef282982
Minor change: add in tcp_in.c in tcp_input(), some calls to handle error statistics (stats & snmp)
2007-08-14 18:01:34 +00:00
fbernon
9152d6671c
Comments Fix for Doxygen documentation
2007-08-09 22:21:44 +00:00
fbernon
d057e95ce3
Minor Fix (remove unused USE_ROUTER_ALERT and some coding style)
2007-08-09 20:21:59 +00:00
fbernon
ac2932bac3
stats.h, stats.c, igmp.h, igmp.c, opt.h: Fix for bug #20503 : IGMP Improvement. Introduce IGMP_STATS to centralize statistics management.
2007-08-09 20:09:22 +00:00
fbernon
118331207b
udp.c: Fix for bug #20503 : IGMP Improvement. Enable to receive a multicast packet on a udp pcb binded on an netif's IP address, and not on "any".
2007-08-09 18:34:03 +00:00
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
11c94b6566
Minor fix (spaces)
2007-08-09 10:51:26 +00:00
jgrubb
c555b532a2
Add NETIF_LINK_CALLBACK into the netif_set_link_up/down functions
2007-08-08 18:22:08 +00:00
fbernon
fdc4c25e67
Minor fix (warnings on unused args, wrong type, cast u32_t to u16_t...)
2007-08-01 13:41:31 +00:00
fbernon
083134bc12
Minor fix (warning when LWIP_DEBUG is undefined)
2007-07-29 09:25:19 +00:00
fbernon
f1c4a9ebfa
Minor fix (warning when LWIP_DEBUG is undefined)
2007-07-29 08:31:31 +00:00
fbernon
1edd2ed3db
Minor fix on pbuf_init (fix warning) and use same coding style that mem.h, sys.h, tcp.h, etc...
2007-07-29 08:23:57 +00:00
fbernon
b8b04271b5
Minor fix (warning, linker helper) signaled by Bill Florac
2007-07-29 08:11:33 +00:00
jifl
f0b33f5ced
Make pbuf_init() call be an empty macro for now
2007-07-27 15:06:03 +00:00
fbernon
42eead8f41
igmp.c: Fix bug #20595 to accept IGMPv3 "Query" messages.
2007-07-26 17:10:56 +00:00
goldsimon
33054a18db
Added a better comment to explain why tcp_close doesn't care for the return value of tcp_output
2007-07-26 09:31:09 +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
fbernon
328b25d561
Minor Fix: remove obsolete MEMP_NUM_API_MSG define and update comment
2007-07-25 07:46:44 +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
fbernon
a1d8335a8c
Fix do_delconn when used with LWIP_TCPIP_CORE_LOCKING=1 on "non-TCP" connections...
2007-07-24 17:27:48 +00:00
fbernon
d5a174364a
Minor fix: debug text inside ethernetif_input
2007-07-24 08:49:00 +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
goldsimon
ebcb46cd48
Included the mem_malloc pools in memp_names if MEM_USE_POOLS=1
2007-07-18 20:30:21 +00:00
goldsimon
1689361ff2
Another change for fixing bug #20478 (put the memp += MEMP_SIZE in another place)
2007-07-15 10:54:24 +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
jgrubb
eb998bda62
Bug fix #20478 : memp_malloc returns NULL+MEMP_SIZE rather than NULL on a failed allocation
2007-07-14 00:07:43 +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
fbernon
a2dffd430b
Fix minor patch #5741 build error...
2007-07-13 13:12:07 +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
fbernon
5d872b26a1
sockets.c: Fix a possible problem because any new socket can't be created during the "close" (which can be "long" since fix for bug #20021 ).
2007-07-04 21:13:25 +00:00
goldsimon
8d2c8065eb
Removed old debug variables from pbuf_copy()
2007-07-04 16:43:54 +00:00
fbernon
bf176ed712
Minor fix (indent)
2007-07-03 21:27:59 +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
2a77b9fcc7
Bug in last version (fix to close problems): netconn thread might get active before calling its callback, so conn was already deallocated.
2007-07-03 20:20:33 +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
fbernon
3a0ab861c2
ip.h, etharp.c: Fix warnings & errors about LWIP_NETIF_HWADDRHINT (perhaps compiler dependant)
2007-07-03 10:36:21 +00:00
goldsimon
fdc0d30337
#ifdef LWIP_NETIF_HWADDRHINT around IP_PCB.addr_hint
2007-07-03 08:09:50 +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
goldsimon
0113b735ad
Fixed a little cast-warning from u32_t to u16_t
2007-07-02 20:07:19 +00:00
goldsimon
d228ff0f43
Removed warning when assigning from u32_t to u16_t by casting to u16_t.
2007-07-01 16:04:35 +00:00
goldsimon
9abbb581c5
Changed tcp_pcb->snd_queuelen from u8_t to u16_t to prevent overflowing when sending many small packets with big send buffer, added assertions and oveflow checks for snd_queuelen.
2007-07-01 15:56:04 +00:00
goldsimon
d7c50f56d7
Fixed a wrong assert statement in etharp_query when ARP_QUEUEING=1 and packets should be queued.
2007-07-01 14:52:09 +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
c91caa06d3
Set/get ARP hwlen and protolen in one piece.
2007-06-30 11:42:41 +00:00
goldsimon
6c3c184bc7
Added check to prevent tcp_pcb->snd_queuelen from overflowing.
2007-06-29 17:09:47 +00:00
fbernon
af71292aba
Minor fix (extra spaces)
2007-06-29 13:37:33 +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
goldsimon
d73ca29a07
Fixed minor indentation fault
2007-06-28 10:29:13 +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
fbernon
dd1cd5e491
sockets.c: process NETCONN_RAW connections with LWIP_TCPIP_CORE_LOCKING=1
2007-06-28 09:56:37 +00:00
goldsimon
2b02db2675
Remove warning in tcp_enqueue (cast from u32_t to u16_t)
2007-06-27 16:42:20 +00:00
goldsimon
6f93a8f091
Set the err_to_errno_table to be const
2007-06-26 17:38:52 +00:00
goldsimon
47074c897e
Removed warning: LWIP_DEBUGF had wrong argument count
2007-06-26 08:12:15 +00:00
goldsimon
2270f0d172
Fixed bug #20259 : struct udp_hdr was lacking the packin defines.
2007-06-26 07:32:17 +00:00
goldsimon
1b5d3466ba
etharp_arp_input: stricter checking of hwtype, proto, hwlen & protolen allows us to leave some header fields like they are when sending ARP reply (only changing the addresses is needed)
2007-06-25 18:03:23 +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
4f5b781b88
Moved filling of ethernet header for outgoing IP packets into an extra function to reduce code size.
2007-06-25 17:20:10 +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
4848de3a8e
etharp_tmr function had a bug (pending entries were pending for too long)
2007-06-24 12:46:13 +00:00
goldsimon
88b1cebe1d
Sorry, checked in some of my local changes with the LWIP_ERROR modification!
2007-06-23 13:09:58 +00:00
goldsimon
bb9e9e5480
Changed the expression of LWIP_ERROR to the same as for LWIP_ASSERT
2007-06-22 20:50:21 +00:00
goldsimon
786a7fbaf4
no-pool-big-enough was not correctly caught
2007-06-22 20:26:30 +00:00
goldsimon
0ce27296aa
ASSERTS were using old MEM_ALIGN define, therefore, was not compilable without LWIP_NOASSERT defined
2007-06-22 20:23:26 +00:00
fbernon
a1d176b643
autoip.h/.c: change autoip_init & autoip_create_rand_addr to use netif's MAC address and tried_llipaddr to generate an "autoip"...
2007-06-22 18:54:34 +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
065b8c945b
Added ASSERT to check that lwip_send(to) is not called for length not fitting into u16_t (for UDP & RAW sockets)
2007-06-21 19:58:31 +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
67795ad26e
Corrected do_write for LWIP_TCPIP_CORE_LOCKING=1
2007-06-21 19:14:02 +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
fbernon
4c07b1606c
Minor changes: fix some comments for Doygen documentation
2007-06-21 07:17:29 +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
fbernon
ec7333d406
Some changes for AutoIP integration in tcpip.c, and some comments.
2007-06-19 10:11:27 +00:00
fbernon
6a40426421
Minor fix: warning, type... for patch #5952 : Integration of AutoIP module
2007-06-18 21:45:34 +00:00
goldsimon
c9ebb895a1
Removed warning "empty body in an if statement" in tcp_receive() for LWIP_DEBUG=0
2007-06-18 20:08:31 +00:00
goldsimon
f66bbda8b1
Ooops, checked in a wrong (test-) version before!
2007-06-18 19:52:55 +00:00
goldsimon
da2d9f3733
Shortened some lines to ~80
2007-06-18 19:36:58 +00:00
goldsimon
9e0252b209
Corrected two formatters in LWIP_DEBUGF calls
2007-06-18 19:23:27 +00:00
goldsimon
531ea17088
Forgot to implement getsockopt for SO_NO_CHECK
2007-06-17 19:18:59 +00:00
fbernon
e89f5983be
tcp_in.c: Fix bug #20126 : Zero ssthresh bug (by Per-Henrik Lundblom and Kieran Mansley).
2007-06-17 16:15:34 +00:00
goldsimon
6784fd64f3
Done some work on task #6933 : converted some LWIP_ASSERTs to LWIP_ERROR to give back an error return value for LWIP_NOASSERT=1
2007-06-17 15:20:21 +00:00
goldsimon
ced2543be0
Done some work on task #6933 : converted some LWIP_ASSERTs to LWIP_ERROR to give back an error return value for LWIP_NOASSERT=1
2007-06-17 14:39:50 +00:00
goldsimon
261e92c57b
In accept_function, one LWIP_ERROR had a wrong expression (since it is inverted compared to LWIP_ASSERT...)
2007-06-17 14:38:32 +00:00
goldsimon
55bd48dc10
Always align PBUF_POOL_BUFSIZE, pbuf_init is not needed any more, minor changes to meet coding style requirements
2007-06-17 14:36:19 +00:00
goldsimon
96dc30dea2
Done some work on task #1549 (function documentation)
2007-06-17 12:18:11 +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
1db9013bc4
Done some work on task #1549 (function documentation)
2007-06-16 15:08:47 +00:00
goldsimon
060cbe15d6
Done some work on task #1549 (function documentation), added some LWIP_ERROR checks, don't call pcb_new() from do_bind() and do_connect() since a netconn without pcb can't exist any more (after the recent changes to netconn_new_*())
2007-06-16 15:07:11 +00:00
goldsimon
8532d0d152
Added comments for the callback functions included in struct tcp_listen_pcb
2007-06-16 15:04:50 +00:00
goldsimon
173e63f01b
Minor fix: coding style
2007-06-16 15:03:09 +00:00
goldsimon
066daf21ef
Added comments for the callback functions included in structs tcp_pcb, udp_pcb and raw_pcb.
2007-06-16 14:33:37 +00:00
goldsimon
10f4604939
Corrected some copy & paste errors
2007-06-16 14:09:27 +00:00
goldsimon
08ab2d89f4
Created define instead of extra-function for netconn_new, netconn_new_with_callback and netconn_err, added netconn_type NETCONN_INVALID
2007-06-16 13:58:32 +00:00
goldsimon
775deefeaa
Done some work on task #1549 (function documentation), added some LWIP_ERROR checks, created define instead of extra-function for netconn_new, netconn_new_with_callback and netconn_err
2007-06-16 13:57: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
f1d95379bc
Changed all references to old debug defines to the new ones (e.g. LWIP_DBG_TRACE)
2007-06-16 11:39:01 +00:00
goldsimon
7c4377af0e
Added debug output for icmp_input if ip_output_if worked or not.
2007-06-16 11:23:26 +00:00
goldsimon
f93b8fe377
pbuf_copy(): removed copy & paste error which did not copy pbuf chains correctly
2007-06-14 17:40:39 +00:00
goldsimon
978c68dcf8
pbuf_copy: chained pbufs were not copied correctly because of wrong packet-queue-check
2007-06-14 07:22:43 +00:00
goldsimon
c0925d2d04
minor fix in assertion text
2007-06-14 07:21:55 +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
fbernon
5f7831b3c8
Minor fix (comment is not at the good place)
2007-06-13 09:04:03 +00:00
goldsimon
6336279ce0
In udp_input, for UDP Lite, chksum_len_tx was used instead of chksum_len_rx
2007-06-12 07:03:32 +00:00
fbernon
ab4b59afb9
Partial fix for bug# 20147: "getsockopt() with SO_ERROR option" 'socket layer error is not updated if no operation on netconn).
2007-06-11 20:16:38 +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
fbernon
5993c816d8
Minor fix. Add "static" to IGMP's global variables, and rename group_list to igmp_group_list...
2007-06-11 07:27:12 +00:00
fbernon
15ccac78d9
Minor fix. Add comments in source file from documentation text file by Dominik Spies.
2007-06-11 07:26:10 +00:00
fbernon
d81841f54e
Minor fix (coding style)
2007-06-10 20:02:43 +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
goldsimon
df0e4492a7
Forgot some brackets in an if statement in v1.109
2007-06-10 09:49:04 +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
fbernon
792f5b3f22
Patch from Jared Momose (j.momose@ieee.org) for bug #19699 : "Bug in SNMP ASN1 decode; submitted patch"
2007-06-09 10:36:21 +00:00
fbernon
a42baedc28
Just add a comment to explain that the lwip_sendto patch for LWIP_TCPIP_CORE_LOCKING option is just show a sample (it's not a full implementation, RAW connection and "to" field are not handled, ...)
2007-06-09 09:59:16 +00:00
goldsimon
6607cab902
set netif->output to etharp_output by default to save a function call
2007-06-08 22:42:43 +00:00
goldsimon
3a09de82e3
Corrected #if ... when to include copy_from_pbuf()
2007-06-08 22:20:59 +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
6b1dc21383
Changed etharp_tmr() to be smaller
2007-06-08 22:19:23 +00:00
goldsimon
613acd93c0
Minor change: don't define some local (unused) variables if LWIP_TCPIP_CORE_LOCKING=1
2007-06-08 21:33:28 +00:00
goldsimon
837cb42679
Done some work on task #1549 (function documentation)
2007-06-08 20:59:17 +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
fbernon
090aaefb39
Add LWIP_TCPIP_CORE_LOCKING option (0 as default value) to experiment "locking" as feature to communicate with tcpip_thread for sequential API (netconn & socket layers). Add a alternative code for lwip_sendto to how the code can be optimized with such feature....
2007-06-08 19:27:59 +00:00
goldsimon
0b9c9f9ede
pbuf_copy(): Corrected a wrong comment & try to behave correctly if LWIP_NOASSERT is defined
2007-06-08 17:27:36 +00:00
goldsimon
8e65fb920f
loopif_output(): use pbuf_copy() to copy the pbuf to reduce code size
2007-06-08 17:24:58 +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
b7e4d2a8ff
Done some work on task #1549 (function documentation) and minor changes to meet coding standard + added some comments to make the code easier to read.
2007-06-08 17:10:05 +00:00
fbernon
9768657fc7
Minor fix (spaces)
2007-06-08 16:24:28 +00:00
goldsimon
a185e19bc1
Let lookup_group() call lookfor_group() to reduce code size, done some work on task #1549 (function documentation) and minor changes to meet coding standard
2007-06-08 12:54:40 +00:00
goldsimon
b7603f8600
Done some work on task #1549 (function documentation)
2007-06-08 12:52:46 +00:00
goldsimon
d8d281281c
Done some work on task #1549 (function documentation)
2007-06-08 12:08:44 +00:00
goldsimon
5ee9c95ebd
Fixed a cast warning by including the type to TCP_PCB_COMMON: (Moved members common to structures tcp_pcp and tcp_listen_pcb into define TCP_PCB_COMMON (like IP_PCB) to keep (possible) code changes consistent.)
2007-06-08 12:00:45 +00:00
goldsimon
fb5a1a2c0f
Minor changes to meet coding standard
2007-06-08 11:51:57 +00:00
goldsimon
4a5a7ee922
Done some work on task #1549 (function documentation)
2007-06-08 11:49:59 +00:00
goldsimon
d258bc263a
Done some work on task #1549 (function documentation)
2007-06-08 11:35:54 +00:00
goldsimon
8a30754e9c
Done some work on task #1549 (function documentation) and minor changes to meet coding standard
2007-06-08 11:30:14 +00:00
goldsimon
a14bc9ed44
Moved members common to structures tcp_pcp and tcp_listen_pcb into define TCP_PCB_COMMON (like IP_PCB) to keep (possible) code changes consistent.
2007-06-08 11:28:47 +00:00
fbernon
75adf4bac6
Fix typo and remove RAW_STATS (not used)
2007-06-08 07:22:21 +00:00
goldsimon
8d6013454c
Done some work on task #1549 (function documentation)
2007-06-07 21:36:20 +00:00
goldsimon
1a25062af0
Done some work on task #1549 (function documentation)
2007-06-07 21:29:44 +00:00
goldsimon
8aedcadd3e
Done some work on task #1549 (function documentation) and minor changes to meet coding standard
2007-06-07 21:29:13 +00:00
goldsimon
027d59fd46
Done some work on task #1549 (function documentation)
2007-06-07 20:56:48 +00:00
fbernon
273e70e403
Minor, fix an obsolete comment about LWIP_SO_RCVTIMEO
2007-06-07 14:18:38 +00:00
goldsimon
aee6c1f72f
Corrected setsockopt for LWIP_IGMP=1 (did not compile & errors were not returned)
2007-06-05 18:46:10 +00:00
goldsimon
9ee40d9f88
Defined IGMP_DEBUG defaulting to LWIP_DBG_OFF in opt.h
2007-06-05 18:19:48 +00:00
goldsimon
754fe60979
Typo in lwip_setsockopt() (getsockopt_internal was called instead of setsockopt_internal!!!)
2007-06-05 07:38:39 +00:00
goldsimon
3a429eabcd
Set q to NULL after freeing it before returning: cleaner code!
2007-06-04 10:42:03 +00:00
fbernon
9209a2ee33
Minor fix for warning: pbuf_copy declaration is now mandatory (since it's used in icmp.c)
2007-06-04 09:54:58 +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
3639daa329
IPv6: #define IPH_PROTO(hdr) (iphdr->nexthdr) to remove #ifdef IPv6 in udp_input()
2007-06-03 18:10:33 +00:00
goldsimon
8fd6a61df6
Done some work on task #1549 (function documentation)
2007-06-03 18:05:52 +00:00
goldsimon
a6b0d40f9d
Converted some DEBUGFs that should never happen to LWIP_ASSERTs
2007-06-03 17:18:33 +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
75fd6fc4a4
Needed for patch to bug #19937 : pbuf_copy is always compiled, not only if ARP_QUEUEING is enabled
2007-06-03 11:28:25 +00:00
goldsimon
4f7dc3c76c
Done some work on task #1549 (function documentation)
2007-06-03 11:26:55 +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
d5a159d7af
Done some work on task #1549 (function documentation)
2007-06-02 17:12:36 +00:00
goldsimon
add68e0da1
Checked in patch #5914 : Moved sockopt processing into tcpip_thread.
2007-06-01 17:15:54 +00:00
goldsimon
a85f9db5b1
Made etharp_find_addr() use find_entry to concentrate the knowledge of arp_table layout in find_entry().
2007-06-01 17:11:47 +00:00
goldsimon
c43ab76bbe
Use TCP_RMV instead of tcp_pcb_remove when removing pcbs from tcp_bound_pcbs list (bug introduced while fixing bug #1895 )
2007-05-29 11:02:53 +00:00
goldsimon
98df3c6e0a
Removed LWIP_DEBUG_ASSERT
2007-05-24 07:19:34 +00:00
fbernon
0a4130a4ff
Minor, fix files modified by last patch...
2007-05-23 19:49:55 +00:00
fbernon
93828fde80
Fixed patch #5965 : Remove unused conntype in struct api_msg_msg, by Simon Goldsmith
2007-05-23 19:28:07 +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
d1ef610822
Minor fix (spaces, indent) and check for LWIP_SO_RCVTIMEO..
2007-05-22 21:29:04 +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
goldsimon
b5ab0c5285
Included some missing braces in lwip_send & lwip_sendto (if !LWIP_UDP && !LWIP_RAW)
2007-05-22 20:32:22 +00:00
goldsimon
2442b985bf
Broke some (too long) lines down to multiple lines, made the file fit our coding standards
2007-05-22 20:30:30 +00:00
goldsimon
78201c0146
Added some comments, better max-size-check, removed Adams original mem_malloc.
2007-05-22 19:38:12 +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
fbernon
2106f491d0
Minors fix (spaces, comments, unused variable)
2007-05-22 08:20:18 +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
fbernon
980af63b8d
Remove warning (missing include)
2007-05-21 16:55:57 +00:00
goldsimon
613644bfc6
Re-included unneeded cases in do_disconnect() and do_send() to prevent warnings.
2007-05-21 09:52:23 +00:00
fbernon
7f5d6bc964
api_msg.c: Fix some errors forwarding ( https://savannah.nongnu.org/task/?6880 )
2007-05-19 16:27:02 +00:00
fbernon
d5e37309e5
Minor Fix (unsed code, spaces, idents..)
2007-05-19 16:24:40 +00:00
fbernon
6bfa99a774
Minor fixs to reduce footprint on the "recv part" of Sequential API...
2007-05-19 13:54:56 +00:00
fbernon
c899097802
Remove warning in snmp/msg_in.c
2007-05-19 10:19:14 +00:00
goldsimon
70187bd47e
Gave the overflow functions some better names which correspond to the (future) mem.c function names
2007-05-18 21:10:33 +00:00
goldsimon
018efc9631
Check the user-overridable defines MEMP_SANITY_REGION_BEFORE and MEMP_SANITY_REGION_AFTER for aligment.
2007-05-18 20:25:27 +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
cde11f9d9c
Added some new functions as null-definitions if NO_SYS=1
2007-05-18 18:34:34 +00:00
goldsimon
8fa3b6802e
Added #if !NO_SYS to most of the api files since they only work with a sys layer (makes it easier for port projects).
2007-05-18 11:27:46 +00:00
goldsimon
4192df97ec
Corrected check of PBUF_POOL overflow
2007-05-18 11:13:34 +00:00
goldsimon
9085abd838
Added comments whether fields are host or network byte order (task #1568 )
2007-05-17 12:45:50 +00:00
goldsimon
874415a193
Added comments whether fields are host or network byte order (task #1568 )
2007-05-17 12:21:32 +00:00
goldsimon
5e9d80fbdb
tcpip_input()/tcpip_ethinput(): don't free the pbuf if returning ERR_MEM, that is the netif driver's responsibility
2007-05-17 09:04:36 +00:00
goldsimon
75f7f21eb0
...and again replacing tab by spaces ;-)
2007-05-17 09:02:30 +00:00
goldsimon
c01e265e07
changes tabs to spaces
2007-05-17 08:55:50 +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
goldsimon
a27dc1e908
Finally removed all occurences of PBUF_STATS :-)
2007-05-16 18:00:36 +00:00
goldsimon
e9abfa6602
Removed PBUF_STATS and related code from opt.h & msg_in.c
2007-05-16 14:15:54 +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
2e479b88a8
Updated stats.h/.c to reflect the integration of pbuf pool into memp
2007-05-16 13:49:44 +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
887077b5a4
pbuf_alloc(PBUF_POOL): Added asserts to make sure payload+len is still in bound of the pbuf (also to make sure bug #15659 is fixed).
2007-05-16 10:45:28 +00:00
fbernon
4e71ec4480
Minor fix (tabs)
2007-05-15 16:34:30 +00:00
goldsimon
8ef712787a
Aligned MIN_SIZE, memset(0) the complete ram_heap instead of only the used area, only to be on the safe side...
2007-05-15 10:35:48 +00:00
goldsimon
6c39b8a10c
Found a little bug in ARP_QUEUEING: if pbuf_alloc for the packet to be queued failed, pbuf_copy was called with a NULL pointer.
2007-05-14 20:10:46 +00:00
fbernon
3c32c993f5
Include inet.h to avoid warnings (see http://savannah.nongnu.org/patch/?5865 ).
2007-05-14 08:32:08 +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
055e3d52b6
Modified struct pbuf size determination so that sizeof(struct pbuf) does not necessarily be a multiple of MEM_ALIGNMENT
2007-05-13 16:12:29 +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
goldsimon
bd570561e8
Fix for bug #19740 : 2 static functions are unused, simply ifdefing them out for now to get rid of warnings
2007-05-13 11:08:04 +00:00
goldsimon
19d49db305
sys.h: moved #include "arch/sys_arch.h" down a little, so that functions using the defines SYS_ARCH_TIMEOUT/SYS_MBOX_EMPTY can be define as static (inline) in sys_arch.h. This should not affect any others since the defines couldn't be overridden anyway...
2007-05-13 10:31:51 +00:00
goldsimon
ab4993fda2
Ooops, checked in the wrong version before :-(
2007-05-11 19:42:50 +00:00
goldsimon
6f4056cf99
- Changed mem_malloc(): near fit behaves like exact fit since mem->next is always used
...
- Included some more alignment statements
- Every malloced block is at least MIN_SIZE big (can be overridden, can be used to work against fragmentation)
- Added many comments so that the next developer knows what I was thinking :-)
2007-05-11 19:42:10 +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
6a2e323792
Added some ASSERTs and NULL-pointer checks to sys_timeout/sys_untimeout
2007-05-10 14:23:38 +00:00
goldsimon
d4834803ae
Included opt.h before checking the options.
2007-05-10 11:00:16 +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
b41520f9e2
Removed unused pbuf stats items
2007-05-08 18:55:29 +00:00
goldsimon
0e881170c2
Fixed 3 typos of the version checked in yesterday...
2007-05-08 18:09:14 +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
4dbf1dcad4
mem_realloc: Added assert to check that memory is shrinked, not expanded.
2007-05-08 10:50:19 +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
615e52d396
Prototype of igmp_tick() in igmp.h did not match the one in igmp.c
2007-05-04 16:30:37 +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
fbernon
05ea5f05ae
Minor fix (tab, indent...) to respect source code style...
2007-05-04 15:14:14 +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
fbernon
eb28133b1f
Remove forgotten printf in pbuf_init().
2007-05-02 09:26:51 +00:00
goldsimon
c66932ab25
Checked in patch #5453 : removed mutex/other locking stuff if SYS_LIGHTWEIGHT_PROT=0, moved some pbuf pool logic to static functions
2007-04-30 13:18:22 +00:00
goldsimon
36e8213e42
PBUF_POOL_BUFSIZE: For the default length, alignment check in pbuf_init() failed.
2007-04-30 13:12:33 +00:00
goldsimon
cde6d0deed
pbuf_alloc() / pbuf_realloc(): added LWIP_DEBUG_ASSERT() and cast operator when assigning s32_t to u16_t to get rid of compiler warnings
2007-04-30 11:56:48 +00:00
goldsimon
b462cb4575
Define ETH_PAD_SIZE after including opt.h to avoid conflict with lwipopts.h
2007-04-30 11:45:39 +00:00
goldsimon
dd4ccfc672
task #6792 : added added LWIP_DEBUG_ASSERT(x,y), which triggers #ifndef LWIP_NOASSERT and #ifdef LWIP_DEBUG
2007-04-29 16:35:55 +00:00
goldsimon
6006e2f917
Changed some includes for loopif and added comments
2007-04-24 08:42:32 +00:00
goldsimon
4bedb07aa0
Added some more LWIP_UNUSED_ARG()s
2007-04-24 08:35:19 +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
goldsimon
82e579a29d
Changed the comment to pbuf_realloc() that it can't grow (only shrink) chains to reflect the fact that we decided not to change this.
2007-04-17 17:48:35 +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
kieranm
79be888b6f
* tcp.c, tcp_in.c, tcp_out.c, tcp.h: Modify way the retransmission
...
timer is reset to fix bug#19434, with help from Oleg Tyshev.
2007-04-12 14:56:07 +00:00
jifl
58b3b0603d
Note succesful error return for sys_arch_mbox_tryfetch
2007-04-12 02:50:08 +00:00
jifl
9d43d74ee3
Document new sys_arch_mbox_tryfetch requirement for ports
2007-04-12 01:30:53 +00:00
fbernon
9bc49b3268
opt.h: rename DBG_TYPES_ON & DBG_MIN_LEVEL with LWIP_ prefix.
2007-04-12 00:16:30 +00:00
jifl
d92e0dec22
From bug #19222 comment #18 . Minor tweak to sys_mbox_fetch to avoid redundant
...
code.
2007-04-11 23:16:49 +00:00
goldsimon
7932bf483b
Ongoing fix to patch #5822 : converted more statements like (void)arg; into LWIP_UNUSED_ARG(arg);
2007-04-11 19:39:24 +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
jifl
712a22e18c
Applied patch #5832 from Tai-hwa Liang to keep ipv6 building.
2007-04-10 13:18:14 +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
787eecbf43
Fix mistakes in netconn's error field checking.
2007-04-05 21:11:16 +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
goldsimon
f8aa14d402
Fix bug #5848 : add #if PAP_SUPPORT around the whole file pap.h
2007-04-04 19:21:27 +00:00
goldsimon
11a4f5538b
Change names of 2 global variables again, as the previous names did not have lwip-style...
2007-04-03 16:33:14 +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
goldsimon
34fcccc50b
- Changed the names of some variables in SNMP module to avoid them shadowing each other (which produces a lot of warnings and makes the code hard to maintain)
...
- Added missing defines for 3 snmp-functions if LWIP_SNMP==0
2007-04-02 20:39:24 +00:00
goldsimon
2f53df93e8
Removed printf formatter warning introduced by last check-in (changed local variable from u32_t to u16_t)
2007-04-02 20:34:18 +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
f75be85eea
Add NETIF_FLAG_ETHARP flag and comments in this skeleton.
2007-03-30 10:32:57 +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
4208bcd8d1
Fix on NETIF_FLAG_ETHARP test (test inverted)
2007-03-30 09:25:41 +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
9ec08fa76a
Missing recv_timeout initialize in accept_function. Minor style fix (indent, mbox checking...)
2007-03-28 18:21:24 +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
d301b69dae
Minor. Add LWIP_NETIF_HOSTNAME in skeleton and comment on #endif for LWIP_SNMP.
2007-03-28 10:29:06 +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
goldsimon
4aee4c1ac7
Free pbuf if pbuf_header() fails
2007-03-26 19:27:11 +00:00
goldsimon
bef0503545
Removed warning: sizeof() was automatically casted to negative
2007-03-26 18:57:30 +00:00
goldsimon
7aea2cd6f1
Remove warnings: "converting from 'u32_t' to 'u16_t': possible loss of data": check that received timeout values fit into u16_t.
2007-03-26 18:52:52 +00:00
goldsimon
028d707077
Remove warning in netif_add(): "converting from 's16' to 'u8_t': possible loss of data" (static variable netifnum)
2007-03-26 17:19:12 +00:00
goldsimon
c9df03d1a9
Remove warnings: "comparision between signed and unsigned" and "converting from 'unsigned long' to 'u8_t': possible loss of data"
2007-03-26 17:15:23 +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
fbernon
544e469eeb
api_msg.h, api_msg.c: Remove obsolete API_MSG_ACCEPT and do_accept (never used).
2007-03-22 09:34:18 +00:00
fbernon
db739d16ce
api_lib.c: somes resources couldn't be freed if there was errors during netconn_new_with_proto_and_callback.
2007-03-22 09:27:04 +00:00
fbernon
5fff6e7ff8
ethernetif.c: update netif->input calls to check return value. In older ports, it's a good idea to upgrade them, even if before, there could be another problem (access to an uninitialized mailbox).
2007-03-22 09:09:27 +00:00
goldsimon
776c01e60b
fixed bug #5067 (essentialy a signed/unsigned warning fixed by casting to unsigned).
2007-03-21 21:14:06 +00:00
fbernon
3eb38d7611
api_lib.c, api_msg.c, tcpip.c: integrate sys_mbox_fetch(conn->mbox, NULL) calls from api_lib.c to tcpip.c's tcpip_apimsg(). Now, use a local variable and not a dynamic one from memp to send tcpip_msg to tcpip_thread in a synchrone call. Free tcpip_msg from tcpip_apimsg is not done in tcpip_thread. This give a faster and more reliable communication between api_lib and tcpip.
2007-03-21 16:38:58 +00:00
fbernon
766159e27e
opt.h: Add LWIP_NETIF_CALLBACK (to avoid compiler warning) and set it to 0.
2007-03-21 15:35:02 +00:00
fbernon
bb34d8cfd1
api_msg.c, igmp.c, igmp.h: Fix C++ style comments
2007-03-21 14:47:52 +00:00
fbernon
a880469d7d
Remove obsolete include from my port.
2007-03-21 13:57:45 +00:00
kieranm
e5147d5562
* netif.c, netif.h: Apply patch#4197 with some changes (originator: rireland@hmgsl.com).
...
Provides callback on netif up/down state change.
2007-03-21 13:24:20 +00:00
kieranm
d7ff85850c
2007-03-21 Kieran Mansley
...
* opt.h Change default PBUF_POOL_BUFSIZE to accomodate default MSS +
IP and TCP headers
2007-03-21 13:05:51 +00:00
kieranm
7294cb080b
* Fix all uses of pbuf_header to check the return value. In some
...
cases just assert if it fails as I'm not sure how to fix them, but
this is no worse than before when they would carry on regardless
of the failure.
2007-03-21 12:55:00 +00:00
kieranm
b422864d5d
sockets.c, igmp.c, igmp.h, memp.h: Fix C++ style comments and
...
comment out missing header include in icmp.c
2007-03-21 12:50:04 +00:00
fbernon
eab3667b61
memp.h, stats.c: Fix stats_display function where memp_names table wasn't synchronized with memp.h
2007-03-20 18:12:06 +00:00
fbernon
713e89cdb2
tcpip.c: Initialize tcpip's mbox, and verify if initialized in tcpip_input, tcpip_ethinput, tcpip_callback, tcpip_apimsg, to fix a init problem with network interfaces. Also fix a compiler warning.
2007-03-20 18:01:40 +00:00
kieranm
b290f0442d
udp.c: Only try and use pbuf_header() to make space for headers if
...
not a ROM or REF pbuf.
2007-03-20 16:58:08 +00:00
fbernon
b035a6196a
Add return types to tcpip_apimsg() and api_msg_post() to check ERR_MEM problems (api_lib.c can be change now).
2007-03-19 20:35:32 +00:00
fbernon
e4cd00b5ea
Remove unimplemented "memp_realloc" function from memp.h.
2007-03-19 20:23:58 +00:00
goldsimon
3bb13829fe
checked in patch #5796 : pbuf_alloc: len field claculation caused memory corruption.
2007-03-11 20:07:37 +00:00
fbernon
1af676385c
Add igmp.h and igmp.c inside tree :
...
src/core/ipv4/igmp.c
src/include/ipv4/lwip/igmp.h
2007-03-11 19:45:32 +00:00
fbernon
a24a170b84
New configuration option LWIP_IGMP to enable IGMP processing. Based on only one filter per all network interfaces. Declare a new function in netif to enable to control the MAC filter (to reduce lwIP traffic processing).
...
Mace Gael for the upper layers, Steve Reynolds for lower ones...
2007-03-11 19:16:38 +00:00
goldsimon
bc4b3764fc
Fixed bug #19251 (missing `const' qualifier in socket functions), to get more compatible to standard POSIX sockets.
2007-03-11 17:57:13 +00:00
fbernon
9b143dd5dc
Based on patch from Dmitry Potapov, bug#19225.
...
Add asserts inside bind, connect and sendto to check input parameters. Remove excessive set_errno() calls after get_socket(), because errno is set inside of get_socket(). Move last sock_set_errno() inside lwip_close.
2007-03-11 16:53:37 +00:00
fbernon
5c65d4733b
Keepalive values can be configured at run time with LWIP_TCP_KEEPALIVE, but don't change this unless you know what you're doing (default are RFC1122 compliant). Note that TCP_KEEPIDLE and TCP_KEEPINTVL have to be set in seconds.
...
Old TCP_KEEPALIVE can always be used, and its only difference with TCP_KEEPIDLE is this last use seconds and not milliseconds with setsockopt.
Some documentation (not perfect, but...):
http://publib.boulder.ibm.com/infocenter/pseries/v5r3/index.jsp?topic=/com.ibm.aix.commtechref/doc/commtrf2/setsockopt.htm
2007-03-11 15:53:43 +00:00
goldsimon
41a84ef1d3
Fixed bug #11400-2: New etharp queueing introduced bug: memp_memory was allocated too small.
2007-03-09 07:15:04 +00:00
fbernon
86cecd6700
Keepalive values can be configured at compile time, but don't change this unless you know what you're doing (default are RFC1122 compliant).
2007-03-08 21:02:39 +00:00
fbernon
fdcb87db19
Implement LWIP_SO_RCVTIMEO configuration option to enable/disable SO_RCVTIMEO on UDP sockets/netconn.
2007-03-08 20:58:46 +00:00
goldsimon
a868832776
Initialize dhcp timers in tcpip_thread (if LWIP_DHCP) to protect the stack from concurrent access.
2007-03-08 10:37:31 +00:00
goldsimon
5eabd4591a
SNMP UDP ports can be configured at compile time
2007-03-08 10:32:29 +00:00
goldsimon
91afefa61a
Reverted pbuf_alloc() to REV 1.82
2007-03-07 15:47:54 +00:00
goldsimon
ea7bdb8e9e
Last change (reduce code size if not used) had a bug...
2007-03-06 19:37:32 +00:00
fbernon
7cda728469
Fix some "little" build problems, and a redundancy call to "lwip_stats.link.recv++;" in low_level_input() & ethernetif_input().
...
If LINK_STATS was defined, tcpip.c couldn't be build.
Even if IP_FRAG or IP_REASSEMBLY were set, ip_frag.c functions are not build.
2007-03-06 19:31:49 +00:00
fbernon
7fd37d4e87
Implement SO_RCVTIMEO on UDP sockets/netconn.
2007-03-06 16:41:02 +00:00
goldsimon
874bfe19d2
Reduce code size: don't include code in those files if IP_FRAG == 0 and IP_REASSEMBLY == 0
2007-03-06 15:27:58 +00:00
fbernon
ed07d481d6
opt.h, ip_frag.h, tcpip.h, tcpip.c, ethernetif.c: add new configuration option named ETHARP_TCPIP_ETHINPUT, which enable the new tcpip_ethinput. Allow to do ARP processing for incoming packets inside tcpip_thread (protecting ARP layer against concurrent access). You can also disable old code using tcp_input with new define ETHARP_TCPIP_INPUT set to 0. Older ports have to use tcpip_ethinput.
2007-03-06 14:18:02 +00:00
goldsimon
7115975212
fixed compiler warning "initialization dircards qualifiers from pointer target type"
2007-03-06 07:28:22 +00:00
fbernon
ddf0982d0f
opt.h, sockets.h: add new configuration options (LWIP_POSIX_SOCKETS_IO_NAMES, ETHARP_TRUST_IP_MAC, review SO_REUSE).
...
Also include directly tcp.h in sockets.h to improve application independancy from ip stack (avoid to include directly in application the "unknown" tcp.h if you need options like TCP_NODELAY and TCP_KEEPALIVE in application.
2007-03-05 14:43:11 +00:00
goldsimon
7b54ddd828
Corrected patch to bug #19168
2007-03-04 17:21:43 +00:00
fbernon
1ffd049833
api_msg.c: Remove some compiler warnings : parameter "pcb" was never referenced.
2007-03-04 16:25:04 +00:00
fbernon
12e0a2ef7d
api_lib.c: Fix "[patch #5764 ] api_lib.c cleanup: after patch #5687 " (from Dmitry Potapov).
...
The api_msg struct stay on the stack (not moved to netconn struct).
2007-03-04 14:49:46 +00:00
goldsimon
9da7afb345
Fixed buf #19168 based on patch by Dmitry Potapov
2007-03-04 12:45:58 +00:00
goldsimon
1f544e087b
Fix BUG#11400 - don't corrupt existing pbuf chain when enqueuing multiple pbufs to a pending ARP request
2007-03-04 12:12:42 +00:00
fbernon
e1b6a4cb21
udp.c: remove obsolete line "static struct udp_pcb *pcb_cache = NULL;"
...
Its is static, and never used in udp.c except udp_init().
2007-03-03 17:00:44 +00:00
goldsimon
bb8522b737
tcpip.c: Moved call to ip_init(), udp_init() and tcp_init() from tcpip_thread() to tcpip_init()
2007-03-03 16:22:38 +00:00
fbernon
e075581d76
no message
2007-03-02 19:35:15 +00:00
kieranm
527d18a526
2007-02-28 Kieran Mansley (based on patch from Simon Goldschmidt)
...
* api_lib.c, tcpip.c, memp.c, memp.h: make API msg structs allocated
on the stack and remove the API msg type from memp
2007-02-28 14:15:43 +00:00
kieranm
5ace5976a1
* pbuf.c: Fix BUG#17645 - ensure pbuf payload pointer is not moved
...
outside the region of the pbuf by pbuf_header()
2007-02-28 13:45:35 +00:00
kieranm
c52ac01fbc
sockets.c: Fix BUG#19161 - ensure milliseconds timeout is non-zero
...
when supplied timeout is also non-zero
2007-02-28 12:52:44 +00:00
jifl
f4f2bfe379
Ensure the size of each pbuf in the pool meets alignment constraints
2007-02-27 16:50:05 +00:00
jifl
75beb3bd35
Fix incorrect comparison in get_socket().
...
Spotted by Frederic Bernon.
2007-02-26 20:16:38 +00:00
jifl
1d22294974
* sockets.h, sockets.c: Move socket initialization to new
...
lwip_socket_init() function.
2007-02-26 20:01:04 +00:00
jifl
de665f7cf9
2007-02-26 Jonathan Larmour (based on patch from Simon Goldschmidt)
...
* api_lib.c: Use memcpy in netbuf_copy_partial.
2007-02-26 19:49:49 +00:00
christiaans
205520c620
Fix the fix for GETSHORT and GETLONG bug #19052 , needs to be tested by some PPP user.
2007-02-14 08:08:35 +00:00
likewise
3551b2a2a1
Release 1.2.0.
2006-12-05 10:09:17 +00:00
christiaans
11f2e8d1a6
Added MEM_LIBC_MALLOC option as workaround for failing mem_malloc().
2006-12-04 08:24:25 +00:00
christiaans
a91374a916
Added MEM_LIBC_MALLOC option as workaround for failing mem_malloc().
2006-12-01 15:38:56 +00:00
christiaans
36e6c26545
Included xid to some DEBUGFs.
2006-12-01 13:52:07 +00:00
christiaans
9a68f74857
Fixed false triggers of request_timeout.
2006-11-30 16:25:43 +00:00
christiaans
b96c15890c
Disabled alignment fix. Stepping back, #17922 fix fails on my target, DHCP won't start, I don't understand.
2006-11-28 13:29:05 +00:00
christiaans
5a6b26d69e
In netif_add() fixed clearing of ip_addr, netmask, gw and flags.
2006-11-28 13:12:15 +00:00
christiaans
a3d912a801
Fixed uninitalized variable warnings (using gcc 4.1.1)
2006-11-27 15:37:44 +00:00
christiaans
b4f1deaa46
Accepted patch #5493 IP frag/reass config item tweak.
2006-11-27 14:48:21 +00:00
christiaans
976bce4c7f
Changed heap to use naturally aligned start address and added near-fit case to #17922 fix.
2006-11-27 14:23:24 +00:00
christiaans
77e0f77850
Added snmp_send_trap() parameter, caller must pass enterprise id for enterprise secific traps.
2006-11-27 08:43:10 +00:00
christiaans
a885cbf8ed
Removed mem_dump() reference.
2006-11-22 09:56:39 +00:00
christiaans
b6af5d9bda
Initial attempt at fixing bug #17922 , calling for reviewers. This seems to work for me, more or less, but it looks like it breaks TCP.
2006-11-22 08:27:38 +00:00
christiaans
b72677c3ce
Added missing NULL return checks for snmp_mib_lrn_alloc() and trimmed whitespace at line ends.
2006-11-17 11:07:25 +00:00
christiaans
5e44122552
Trimmed whitespace at line ends.
2006-11-17 11:05:26 +00:00
christiaans
d4b6471d39
Replaced tabs with space.
2006-11-17 10:51:13 +00:00
christiaans
fe1bea9538
Added netif_set_up and call protection for NULL function pointers. Bug #16602 and #17777 .
2006-11-02 12:25:57 +00:00
christiaans
2f41e2b0ec
Made ip_id static again, fixing bug #18065 . This is required when outputting IP fragments.
2006-11-01 09:33:14 +00:00
christiaans
bd86f95512
Cold case #9191 fixes for NC30 compiler for the M16 mcu, reported by Bjorn Sundman.
2006-10-25 07:51:17 +00:00
christiaans
5fcf6418cf
Added warning about using mem_malloc in sys_arch.c, cold case bug #1913 .
2006-10-24 09:10:26 +00:00
christiaans
4e583dab2e
Again, fixed decoding of negative integers in snmp_asn1_dec_s32t(), tnx to though testing by Sander.
2006-10-13 13:45:06 +00:00
christiaans
bc182cab7c
Removed EXPERIMENTAL status.
2006-10-13 12:00:35 +00:00
christiaans
f6f6f11838
Fixed decoding of negative integers in snmp_asn1_dec_s32t(), removed EXPERIMENTAL status.
2006-10-13 11:59:45 +00:00
christiaans
b5f4672155
Partially accepted patch #5449 for ANSI C compatibility / build fixes. Fixed bug #17574 corrected UDP-Lite protocol identifier.
2006-10-11 12:04:04 +00:00
christiaans
729da3c873
Fixed Nagle algorithm as reported by Bob Grice.
2006-10-10 07:48:27 +00:00
christiaans
8a31c6f807
Only mentioning SNMP development additions instead of changes, since we're in pre-alpha.
2006-10-06 10:44:24 +00:00
christiaans
2539b5cf61
Fixed up mib_external_node support, snmpwalk works for external objects.
2006-10-06 08:41:24 +00:00
christiaans
f7881e58bb
Improved message parse robustness. Rejecting 'error requests'. Removed invalid genError return on varbindlist parse error, changed badValue into noSuchName error for non-writeable objects.
2006-10-04 09:15:23 +00:00
christiaans
25ed4e9d16
Fixed clearing of head and tail pointers in snmp_mib_node_delete().
2006-10-03 10:41:48 +00:00
christiaans
7eddf93b36
Added missing snmp_delete_arpidx_tree() in find_entry where entry state was set to ETHARP_STATE_EMPTY.
2006-10-03 10:39:37 +00:00
christiaans
cfb082a20b
Added external mibnode panic closure functions, tobe called for error responses.
2006-10-02 10:13:04 +00:00
christiaans
e440590c37
Fixed snmp_mib_node_insert() to return 2, for node present (not inserted). Also solves invalid rootnode count for this case.
2006-09-29 13:34:38 +00:00
christiaans
c851a19ab2
Added en->get_value_a() call for zero size get_value replies, e.g. for closing external transactions.
2006-09-28 11:46:24 +00:00
christiaans
c2f9d7dee0
Fixed encoding of object sub identifiers with trailing zero.
2006-09-28 11:43:49 +00:00
christiaans
473e567047
Added en->set_value_a() call for closing external transactions.
2006-09-27 15:11:30 +00:00
christiaans
64dab92c6b
Redesign of snmp_msg_event() fsm, added SNMP SET to fsm.
2006-09-27 07:25:16 +00:00
christiaans
f576755b13
Added snmp_msg_event_loop() prototype.
2006-09-22 08:09:08 +00:00
christiaans
d0f279ece4
Set TODO_SNMP_MSG_EVENT to 1. Moved some more code from snmp_recv() to snmp_event_service().
2006-09-22 08:05:17 +00:00
christiaans
a5532ffd4d
Added one strategic LWIP_DEBUGF to snmp_send_response().
2006-09-22 08:03:16 +00:00
christiaans
cb412134dd
Added newlines to LWIP_DEBUGFs.
2006-09-22 08:00:56 +00:00
christiaans
d079aae0e0
Fixed NULL dereferencing for zero length raw data.
2006-09-22 07:59:44 +00:00
christiaans
eabfb233b8
Moved SNMP_CONCURRENT_REQUESTS to opt.h, babysteps for external MIB nodes.
2006-09-20 13:33:50 +00:00
christiaans
960e724ad3
Improved mib node struct for external object access and moved get_object_def() calls to the message processing bit.
2006-09-14 15:08:54 +00:00
christiaans
82c46f957a
Fixed double iterator bug in send_trap(), multiple trap destinations work ok now.
2006-09-12 12:46:36 +00:00
christiaans
320ea29861
Added some lines for SET command.
2006-09-12 10:03:46 +00:00
christiaans
c5e99ada63
Fixed sysObjectID length to copy private IDs with unkown lengths properly.
2006-09-08 09:22:28 +00:00
christiaans
c5bd3f5e3b
Documented TRAP destination setup.
2006-09-07 14:46:41 +00:00
christiaans
a88d054d05
Improved TRAP interfacing. Varbinds maybe allocated at (external) trap source as wel. Added trap destination settings.
2006-09-07 14:17:03 +00:00
christiaans
6576802287
Fixed compilation for LWIP_SNMP 0.
2006-09-07 07:39:49 +00:00
christiaans
693316c83f
Corrected snmp_delete_arpidx_tree() to be called in the expired state, not only maxage.
2006-09-06 13:01:47 +00:00
christiaans
41ff80e5d3
First getnext succes, values are returned insead of NULLs, empty tables are skipped. Limitation: a single varbind per request, so 'snmptable' will fail.
2006-09-06 10:14:07 +00:00
christiaans
56c5fdbeaf
Added newlines in debug output, small optimalisations, more work on 'getnext', fixed 'get' on udp table.
2006-09-04 09:22:48 +00:00
christiaans
130d39cc03
Changed index structs to mib_list_node structs to place the table index trees directly in the mib tree.
2006-09-01 07:14:50 +00:00
christiaans
1485edf8e1
Added index tree node structs and functions, e.g. to be used for ARP table indexes.
2006-08-29 11:28:28 +00:00
christiaans
514ee867a6
Pacified GCC warnings and elaborated getnext to work on scalars, tables don't work yet.
2006-08-21 11:52:58 +00:00
christiaans
3cc7a406f4
Pacified GCC warnings and fixed double mem_free() while returning nosuchname err.
2006-08-21 11:51:19 +00:00
christiaans
c3f82acf7a
Pacified GCC warnings.
2006-08-21 11:50:03 +00:00
christiaans
cdb7557d88
Added SNMP counters.
2006-08-18 10:18:42 +00:00
christiaans
2dcbd016e6
Added tree expansion func protos for getnext.
2006-08-17 14:16:30 +00:00
christiaans
7d1728f05a
Started with getnext and ensure zero length identifiers are accepted.
2006-08-17 14:14:58 +00:00
christiaans
4b5c14470a
Fixed htons into htonl for trap desctination ip.
2006-08-17 14:11:45 +00:00
christiaans
f198b11f27
Accepting zero length identifiers e.g. for getnext operation. Uncommon but valid.
2006-08-17 14:09:57 +00:00
christiaans
7d16087789
Fixed bug #17200 , added check for broadcast destinations for PCBs bound to a unicast address.
2006-08-17 09:40:15 +00:00
christiaans
d734cd986c
Moved noleafs_get_object_def() and noleafs_get_value() protos from mib2.c to snmp_structs.h
2006-08-15 07:28:43 +00:00
christiaans
8559f3e583
MIB-2 object values near to completion, just committing for keeping the flame alive.
2006-08-11 14:16:36 +00:00
christiaans
d0b81d3b20
Corrected comment typo.
2006-08-11 14:13:39 +00:00
christiaans
43bf9a8e46
Added SNMP counters, moved some defines.
2006-08-11 14:12:05 +00:00
christiaans
19f57bf810
Exported udp_pcbs in udp.h (for SNMP agent).
2006-08-11 14:09:48 +00:00
christiaans
469012b544
Added etharp_find_addr(), finds eth/IP address pair by interface ptr and IP address.
2006-08-08 15:10:42 +00:00
christiaans
9b11c4670d
Corrected returned object id for interfaces.ifTable.ifEntry.ifSpecific to zeroDotZero (0.0).
2006-08-07 11:35:32 +00:00
christiaans
7eeaf8eaa5
Corrected object identifier codec for object ids not starting with .iso.dod (e.g. zeroDotZero (0.0)).
2006-08-07 11:32:44 +00:00
christiaans
a82e02ef15
Partial fix for bug #15926 , flushing TCP output in do_close().
2006-08-07 10:00:44 +00:00
christiaans
d8922d0410
Added minimalistic SNMP GET functionality.
2006-07-14 12:54:38 +00:00
christiaans
5c628d2a61
Added netif SNMP init.
2006-07-14 11:17:00 +00:00
christiaans
54bb20b486
Added SNMP statistics to struct netif and changed SNMP macro glue.
2006-07-14 09:58:02 +00:00
christiaans
57a6eaae7b
Added SNMP debug options.
2006-07-10 12:41:25 +00:00
christiaans
7a5cb21056
Fixed (experi)mental typo.
2006-07-07 11:33:36 +00:00
christiaans
333c3f18c0
Initial commit. Expirimental code, please note this is not yet fully functional.
2006-07-07 09:49:31 +00:00
christiaans
6b2979027e
Add preliminairy documentation for the SNMP agent.
2006-07-07 08:03:04 +00:00
christiaans
12f9adbdd3
Added ip_frag_init() prototype.
2006-07-04 08:24:55 +00:00
christiaans
a5cab96ff3
Added ip_frag_init() and some LWIP_DEBUGFs.
2006-07-04 08:24:17 +00:00
christiaans
dd060ceed3
Added ip_frag_init() to ip_init().
2006-07-04 08:23:33 +00:00
christiaans
c89b085e5b
Mentioned some recent cold case fixes.
2006-06-27 10:39:06 +00:00
christiaans
63140ca7f8
Applied patch for cold case bug #11135 .
2006-06-27 10:33:52 +00:00
christiaans
cbe83f32b6
Honoured Pedro Alves namespace request, following lwip style struct naming.
2006-06-22 11:22:47 +00:00
christiaans
3bffb0a181
Added struct obj_id and a few system group access funcs.
2006-06-22 09:33:10 +00:00
christiaans
09dc9c89a8
Added mib-2 snmp group statistics prototypes.
2006-06-19 13:04:11 +00:00
christiaans
09707a3e81
Prepared some SNMP options.
2006-06-19 13:03:09 +00:00
christiaans
d821277430
Fixed cold case bug #1748 , printing of mem_size_t and u16_t statistics.
2006-06-15 07:10:04 +00:00
christiaans
1f01634029
Applied patch #5146 to handle allocation failures in accept() by Kevin Lawson.
2006-06-14 08:02:35 +00:00
curtmcd
dd314e1bdf
Fix incorrect calculation of dhcp->dns_count.
...
Comment out unused static dhcp_get_option_short() to avoid warning.
2006-06-08 00:16:56 +00:00
curtmcd
1dae102359
Fix debug print, remove reference to TCP_COARSE_TIMEOUT
2006-05-31 21:23:26 +00:00
curtmcd
b306594cad
Remove unused mem_reallocm
2006-05-31 21:23:01 +00:00
curtmcd
b60b7cf8fe
Use isprint() instead of isascii() as it's more common
...
Change return type of inet_aton from s8_t to int (standard)
Touch up comments and white space
2006-05-30 19:09:41 +00:00
curtmcd
0148128881
Fix gcc warning per discussion on lwip-users 2006.04.25: dereferencing
...
type-punned pointer will break strict-aliasing rules. Use memcpy
instead of structure copy; code is not in critical path.
2006-05-26 19:05:41 +00:00
curtmcd
076a884651
Add comment about purpose of struct ip_addr2.
...
Improve white space formatting, add parens in IP4_ADDR().
2006-05-26 18:52:27 +00:00
christiaans
7026bbcdd4
Removed conn->sem creation and destruction from netconn_write() and added sys_sem_new to netconn_new_*
2006-05-26 07:39:39 +00:00
curtmcd
6158aa684b
udp_input() operated by removing the IP and UDP headers, putting back
...
the UDP header, then re-removing it. However, pbuf_header() can't add
back the UDP header on pbufs of type PBUF_REF, so these would all get
dropped for bad checksum. This change addresses the problem and
simplifies things by stripping each header just once.
2006-05-26 02:40:54 +00:00
curtmcd
047e3455f7
Improve formatting by fixing wrong indents and lines too long.
2006-05-26 01:36:16 +00:00
christiaans
9ca9649c1b
Disabled ARP table update on ingress IP packets.
2006-05-05 13:34:13 +00:00
likewise
9a23e9839b
Initial commit of FILES in doc/
2006-04-28 11:45:00 +00:00
christiaans
7fc966dced
Optimized for speed and size. Test against zero for both the inverted and non-inverted address. (old and new-style broadcasts)
2006-04-24 07:26:06 +00:00
curtmcd
680afa4229
memp_memory could be unaligned, causing one buffer in the memp pool to
...
be unaligned, resulting in nasty random data corruption on some CPUs.
Also, clean up the code a little and save a few bytes.
2006-04-12 21:07:44 +00:00
likewise
313743c833
Fix for out-of-sequence FIN handling, patch by Oleg Tychev.
2006-04-08 00:36:25 +00:00
likewise
6cb19d7e34
Dangling inseg.p pointer fix by Pedro Alves.
2006-04-08 00:13:49 +00:00
likewise
ef0575a26d
Remained indictator where new changes should go.
2006-04-07 22:31:09 +00:00
christiaans
c9db715bae
addr->addr test size and speed optimalisation (helping a dumb compiler)
2006-04-04 07:21:54 +00:00
christiaans
ed1e3899af
Added optimalization hints.
2006-03-31 09:26:42 +00:00
christiaans
7446e31fce
Address copy loops optimized for speed.
2006-03-29 13:16:40 +00:00
christiaans
94abf9d935
Added LWIP_PLATFORM_BYTESWAP optimalisation flag and macro glue.
2006-03-29 10:15:43 +00:00
christiaans
d9b4ab1658
Pbuf flag test size and speed optimalisation (helping a dumb compiler).
2006-03-28 15:06:33 +00:00
christiaans
39f8538776
Fixed compilation warning on sizeof(), reported by Beach at 20060320.
2006-03-21 08:28:15 +00:00
likewise
fef5c4c9a0
Added upcoming 1.1.1 release to Changelog.
2006-03-15 11:20:46 +00:00
christiaans
61dc2e7dd5
Added pbuf_alloc() return value checks in ip_frag().
2006-03-03 11:25:36 +00:00
christiaans
11a820458f
Increased ip_reassbitmap size with 1, added assertions to catch boundary cases.
...
Beautified indentation again.
2006-03-02 15:45:19 +00:00
likewise
9e7418090d
pbuf alignment fix.
2006-03-01 16:57:43 +00:00
likewise
0b3b713123
Removed 'even sndbuf' fix in TCP, this fix was a ugly hack for the incomplete checksum routine that does not work now that the checksum routine is fixed.
2006-03-01 16:53:41 +00:00
christiaans
00f8cf57cd
Added IP reassembly timer.
2006-03-01 14:51:58 +00:00
christiaans
c55c375b0a
Removed tabs, default LWIP_HAVE_LOOPIF to 0 to slim footprint.
2006-03-01 10:41:23 +00:00
likewise
db76ca248b
2006-02-27 Merged patch by Curt McDowell
...
pbuf.c: Fix alignment; pbuf_init() would not work unless pbuf_pool_memory[] is properly aligned.
2006-02-27 14:11:19 +00:00
christiaans
182e1909b2
Patch from Curt McDowell fixes err_to_errno macro.
2006-02-13 08:14:11 +00:00
christiaans
3aea7bc053
Removed timer dependency on sys.c (raw-API). Beautified indentation.
2006-02-13 08:12:07 +00:00
christiaans
39c35732de
Code style fix, C++ into C comments.
2006-02-13 08:09:01 +00:00
christiaans
6c8850698d
Small optimalization for udp_input().
2006-01-02 12:06:02 +00:00
christiaans
818a726679
History update and listing PPP problems as todo.
2005-12-20 11:52:44 +00:00
likewise
f8663a7129
Remove PCBs which stay in LAST_ACK state too long.
2005-12-20 11:03:18 +00:00
christiaans
7571fe5d13
Fixed unused variable warning.
2005-12-15 08:27:30 +00:00
christiaans
60dc1c22f7
Disabled the added summing routine to preserve code space, fixed some comments.
2005-12-15 08:26:00 +00:00
likewise
02b575e9e4
Added Curt McDowell's platform-independent optimized checksum routine.
2005-12-14 22:51:35 +00:00
likewise
6facaf8f05
Trailing dangling byte in checksum should be considered MSB.
2005-12-14 22:29:03 +00:00
likewise
319a972e75
Duplicate FIN ACK race condition fix by Kelvin Lawson.
2005-12-14 21:58:14 +00:00
christiaans
61cdbb30a6
Added some more fixes to the lwip_standard_chksum() comments.
2005-12-14 12:55:12 +00:00
likewise
5088a38b9f
README now points to savannah.txt instead of duplicating its nfo.
2005-12-12 09:35:34 +00:00
likewise
f5c6a6d075
Typo fix: tens of kilobytes instead of tenths of kilobytes.
2005-12-12 09:33:33 +00:00
likewise
b5340dd739
Updated CVS server host names and documentation about pserver anonymous, SSH non-anonymous access to it.
2005-12-12 09:32:47 +00:00
likewise
e1dcfcbb76
Updated comment on optimization and aim of this generic algorithm.
2005-12-12 09:32:05 +00:00
christiaans
43d448e73f
Fixed lwip_standard_chksum() for unaligned memory access. Verified to work on c16x and BSD on P4.
2005-12-09 08:59:08 +00:00
christiaans
33fbb06604
Fixed void ptr address increment bug reported by Bertrik Sikken.
2005-11-25 12:23:03 +00:00
christiaans
e1b215aa73
Introduced cc.h formatters and removed SO_REUSE from transport layers.
2005-11-25 12:03:38 +00:00
christiaans
6a17ef925d
Described initialization procedure.
2005-11-02 08:08:06 +00:00
christiaans
7599985a0a
Some build fixes for OpenBSD.
2005-10-10 07:27:31 +00:00
likewise
07c0bc288a
Mention of multiple pbuf fix in slipif and unaligned access fix in checksumming.
2005-07-17 15:33:16 +00:00
likewise
f05d392920
Unaligned 16-bit access fix for the standard checksum routine by Peter Jolasson.
2005-07-17 15:30:27 +00:00
likewise
e11d57c883
Fixes bug #13807 : slipif_input() garbles large (i.e. multiple pbufs) inbound datagrams.
2005-07-17 15:13:34 +00:00
likewise
baf377679a
2005-06-08 Leon Woestenberg <leon.woestenberg@gmx.net>
...
* tcp_in.c: Send reset on unexpected ACK in two cases. Fix submitted by olaf.peters@technolution.
2005-06-08 18:57:05 +00:00
likewise
f9355136d8
2005-06-08 Leon Woestenberg <leon.woestenberg@gmx.net>
...
* udp.c: Fixed memory leak; when ip_route() failed, a possibly allocated q was never de-allocated. Fixed by called ip_route() before allocating q.
2005-06-08 18:35:00 +00:00
likewise
bb76e69567
Mentioned unaligned access fix.
2005-02-04 13:45:55 +00:00
likewise
533fc217d4
4 February 2004, Leon Woestenberg <leon.woestenberg@gmx.net>
...
tcp_in.c: Applied fix patch for bug #2679 .
tcp_out.c: Applied fix patch for bug #2679 .
http://savannah.nongnu.org/bugs/?func=detailitem&item_id=2679
2005-02-04 13:43:13 +00:00
likewise
ac5c6695c1
4 February 2004, Leon Woestenberg <leon.woestenberg@gmx.net>
...
tcp_out.c: queue was not initialized to NULL, but was referenced in memerr cleanup code.
2005-02-04 13:31:29 +00:00
likewise
3160488352
queue was referenced before initialization in first goto memerr branch code. Replaced goto branch by its minimal equivalent error handling code.
2005-02-04 13:28:50 +00:00
likewise
8579e4144f
More robust DHCP ARP reply checking.
2005-01-24 23:02:29 +00:00
likewise
6880fa62f8
Added some missing string.h includes.
2005-01-24 21:05:47 +00:00
likewise
2cf4287197
Mention of missing semicolon, and pcb->recv() called even when NULL.
2005-01-04 12:22:44 +00:00
likewise
86c774443c
Fixed missing semicolon in LWIP_DEBUG statement.
2005-01-04 12:20:25 +00:00
likewise
3b715f4602
3 January 2004, Leon Woestenberg <leon.woestenberg@gmx>
...
udp.c: pcb->recv() callback was called even when it was NULL.
2005-01-03 17:54:21 +00:00
likewise
ec0c2bea6e
Changed behaviour into implementation.
2005-01-01 18:06:21 +00:00
likewise
1b3682cfa9
Updated CHANGELOG.
2004-12-30 01:28:16 +00:00
likewise
2a9ee35411
Removed assertion that always equaled true.
2004-12-27 14:50:03 +00:00
likewise
0e0a7d82de
Re-enabled ARP packet queueing. (Now that multi-packet queueing is disabled in etharp.c).
2004-12-27 14:45:12 +00:00
likewise
dfa96852f0
Disabled queueing more than 1 packet on a ARP entry, as I suspect this clashes with the TCP segment queueing.
2004-12-27 14:44:19 +00:00
likewise
a549ec0382
Added inline source documentation.
2004-12-27 14:42:02 +00:00
likewise
c61f01b206
tcp_write(): optimize order of valid states checks, most common first.
...
added assertion: when the queues are NULL, queuelen must be zero.
remove ACK flags from a PCB, only when we could succesfully sent
an empty ACK packet.
2004-12-26 01:36:37 +00:00
likewise
15257f4524
Update comment on ETHARP_QUEUEING. Defaulted to being disabled.
2004-12-24 21:58:53 +00:00
christiaans
089378ef87
christiaans: cosmetic change debug formatters as requested by Tom.
2004-12-07 08:16:27 +00:00
christiaans
805f495d84
christiaans: Fixed SO_REUSE default to 0. Actually we should fix udp so it won't depend on the socket layer.
2004-12-06 11:50:53 +00:00
likewise
928dd94ba6
etharp.c: Corrected DHCP_DOES_ARP_CHECK behaviour.
2004-11-30 17:22:18 +00:00
likewise
b429918b32
etharp.c: re-arranged code in find_entry(), supposedly making it more readable for all cases.
2004-11-29 11:01:20 +00:00
likewise
62a37a4876
Updates the FILES contents to better reflect the current state.
2004-11-29 09:39:51 +00:00
likewise
0e96ece6c6
Surround definition of tcp_timer_needed with #if !NO_SYS #endif. (see lwip-users 15-11-2004).
2004-11-28 18:23:00 +00:00
likewise
f1eca32536
Mentioned ARP race fix.
2004-11-28 18:06:47 +00:00
likewise
ed59dc1ada
Prevented a race condition between a new ARP request and the ARP timer.
...
Timeouts stay the same (halved the ARP timer, doubled the counts), but
ETHARP_MAX_PENDING should be at least 2 to prevent it from reaching 0 right away,
giving too little time for any ARP responses to be noted.
2004-11-28 18:00:20 +00:00
likewise
a5cd3fcafd
Added a missing "not" in the comment, the code was correct.
2004-11-25 14:04:45 +00:00
likewise
f3def542ee
Compile dammit
2004-11-25 14:03:31 +00:00
likewise
aa249922df
Removed redundant closing bracket.
2004-11-25 13:59:06 +00:00
likewise
37a0c57bed
2004-11-25 Leon Woestenberg <leon.woestenberg@gmx.net>
...
* ip.c: Exploit the fact that ip_addr_isbroadcast() now checks that the
given IP address actually belongs to the network of the given interface.
2004-11-25 13:57:05 +00:00
likewise
90b7e68b4e
Removed the Smurf.
2004-11-25 13:52:34 +00:00
likewise
1a0c497007
Mentioned Kieran's and my changes - Leon.
2004-11-25 13:33:57 +00:00
likewise
fd49ee3c8d
2004-11-25 Leon Woestenberg <leon.woestenberg@gmx.net>
...
* ipv4/ip_addr.h: Renamed ip_addr_maskcmp() to _netcmp() as we are
comparing network addresses (identifiers), not the network masks
themselves.
* ipv4/ip_addr.c: ip_addr_isbroadcast() now checks that the given
IP address actually belongs to the network of the given interface.
2004-11-25 13:33:07 +00:00
likewise
3488a5c3c4
2004-11-25 Leon Woestenberg <leon.woestenberg@gmx.net>
...
* etharp.c: ETHARP_CREATE is renamed to ETHARP_TRY_HARD.
Do not try hard to insert arbitrary packet's source address,
etharp_ip_input() now calls etharp_update() without ETHARP_TRY_HARD.
etharp_query() now always DOES call ETHARP_TRY_HARD so that users
querying an address will see it appear in the cache (DHCP could
suffer from this when a server invalidly gave an in-use address.)
2004-11-25 13:32:31 +00:00
likewise
ae4955f59e
Replaced erronous LWIP_ERRORF with LWIP_DEBUGF
2004-11-25 11:23:37 +00:00
likewise
fab107a9df
DECLINE message was unicast instead of broadcast
2004-11-25 11:10:53 +00:00
kieranm
bb87d19e84
Kieran Mansley - kjm25@cam.ac.uk - 24th Nov 2004
...
* Increase pcb->snd_buf by 1 when an ACK is received in SYN_SENT state to ensure correct operation
2004-11-24 17:05:41 +00:00
kieranm
4e309b7992
Kieran Mansley - kjm25@cam.ac.uk - 24th Nov 2004
...
* Changed pcb->rttest from u16_t to u32_t - comparisons with tcp_ticks (which is u32_t) were failing after 9 hours of operation
2004-11-24 17:04:34 +00:00
kieranm
64aa4c716d
Kieran Mansley - kjm25@cam.ac.uk - 24th Nov 2004
...
* Increased argument checking at start of pbuf_queue() and made resulting errors more verbose
2004-11-24 17:03:03 +00:00
jani
6b0852a21f
reduce msleep interval from 250 to 1 ms in ppp
2004-11-09 13:03:32 +00:00
jani
8afd3e882e
#if directive style fix
2004-11-09 11:44:06 +00:00
likewise
791fa28817
Removed static declaration of dhcp_release().
2004-11-04 19:19:29 +00:00
christiaans
3fab752640
Removed struct netif; forward decl. is already included from ip_addr.h.
...
Hit me if it breaks exsisting code.
2004-10-29 14:57:38 +00:00
christiaans
67dd939d83
Match update_arp_entry() to prototype.
2004-10-28 08:21:33 +00:00
likewise
ec9b447be1
17th October 2004 Leon Woestenberg <leon.woestenberg@gmx.net>
...
rawapi.txt: Explicitly name full nomenclature for two different API's.
2004-10-17 21:28:25 +00:00
likewise
99e3fe9ae1
17th October 2004 Leon Woestenberg <leon.woestenberg@gmx.net>
...
ethernetif.c: Fix lwip/stats.h support, reported by Andrew McGeachie.
2004-10-17 18:13:18 +00:00
likewise
eb99d21022
Mentioned adapted TCP behaviour; send ACK even if one was pending, iff rcv_wnd is above threshold.
2004-10-16 15:12:56 +00:00
likewise
793cbcdff8
Mentioned adapted TCP behaviour; send ACK even if one was pending, iff rcv_wnd is above threshold.
2004-10-16 15:07:26 +00:00
kieranm
751557bcbf
16th October 2004 - Kieran Mansley - kjm25@cam.ac.uk
...
- Add code to tcp_recved() to send an ACK (window update)
immediately, even if one is already pending, if the rcv_wnd is above a
threshold (currently TCP_WND/2)
- This avoids waiting for a timer to expire to send a delayed ACK in
order to open the window if the stack is only receiving data.
2004-10-16 12:57:52 +00:00
likewise
252dcd8626
Reverted back the TCP_BETWEEN macro. It does not work on all archs.
2004-10-14 12:24:52 +00:00
likewise
0ad7ea16d2
Bring interface up/down with netif_set_up/down(). Fixes bug 10547.
2004-10-14 11:57:53 +00:00
likewise
79842d4fdd
Mentioned TCP retransmit time-out changes contributed by Sam Jansen, committed Kieran Mansley.
2004-10-13 21:40:51 +00:00
kieranm
1e1f5d5462
Kieran Mansley - kjm25@cam.ac.uk - 20th September 2004
...
* Change the return type of ethernetif_init from void to err_t to avoid confusing porters.
2004-09-20 17:00:31 +00:00
kieranm
19d8ffe177
Kieran Mansley - kjm25@cam.ac.uk - 20th September 2004
...
* Check if the pbuf is NULL before freeing it, when draining the mbox as part of netconn_delete.
2004-09-20 16:58:01 +00:00
kieranm
4cb8192c1d
Kieran Mansley - kjm25@cam.ac.uk - 20th September 2004
...
* Corrected "out by one" error on one of the TCP_SEQ_BETWEEN macro calls introduced recently
2004-09-20 16:53:48 +00:00
kieranm
2ed5bc5195
Kieran Mansley - kjm25@cam.ac.uk - 12th September 2004
...
Applied patch from Sam Jansen as detailed in
http://lists.gnu.org/archive/html/lwip-users/2004-07/msg00106.html
to correctly handle retransmission after a retransmission timeout
2004-09-12 16:34:06 +00:00
kieranm
fae1397468
Rename lwip_chksum and add LWIP_CHKSUM macro so that ports can "override" the standard implementation with one of their own.
2004-09-12 16:17:58 +00:00
kieranm
e871548772
Fixed typo (missing "{") in previous checkin
2004-09-12 16:03:54 +00:00
kieranm
a3d27e30e0
Add TCP_SEQ_BETWEEN macro for comparing a range of sequence numbers
2004-09-12 15:56:12 +00:00
likewise
89abd1f58e
Do no longer try to free pbuf when TCP_EVENT_RECV() is called without a callback handler, and without packet.
...
The standard HTTP server failed on this (as reported by three users).
2004-09-08 22:33:46 +00:00
softins
fae709d9ea
Added my July and August updates.
2004-08-20 16:56:20 +00:00
softins
36df79b207
Make sure the first pbuf queued on an ARP entry is properly ref counted.
2004-08-20 09:17:52 +00:00
likewise
b9ebcd7738
Ingress TCP keep-alive with garbage byte support.
2004-08-17 09:32:31 +00:00
likewise
515fb5a3fd
First packet on queue generated assertion failure. Reported by David Haas on lwip-users on Friday 13th.
2004-08-17 08:39:43 +00:00
likewise
785f90d9fa
Updated the use of Savannah docs (merged from STABLE-0_7 branch).
2004-08-11 00:15:03 +00:00
likewise
22ac311496
Support for PACK_STRUCT_USE_INCLUDES was broken.
...
Added one missing PACK_STRUCT_END.
2004-08-10 14:50:44 +00:00
likewise
0e31ca73c0
Have PBUF_LINK_HLEN default to 14 bytes (for Ethernet).
2004-08-10 14:41:12 +00:00
likewise
98ba558fa5
Mentioned 1.0.0.
2004-07-29 11:28:27 +00:00
softins
c4ef1e5c19
Add (int) cast in LWIP_DEBUGF() to avoid compiler warnings about comparison.
2004-07-27 16:19:16 +00:00
softins
1fa0d66f15
Stop compiler complaining of empty if statement when LWIP_DEBUGF() empty.
2004-07-27 16:08:26 +00:00
softins
4680307a34
Stop compiler complaining of empty if statement when LWIP_DEBUGF() empty.
...
Close an unclosed comment.
2004-07-27 16:08:05 +00:00
softins
42a6fa972d
Corrected IPH_TOS() macro: returns a byte, so doesn't need htons().
2004-07-27 14:46:24 +00:00
softins
1da6c35a6d
Added a couple of casts to quiet the compiler.
...
No need to test isascii(c) before isdigit(c) or isxdigit(c).
2004-07-27 14:43:58 +00:00
likewise
7c427a4dce
Made some comments more explicit.
2004-07-25 23:41:01 +00:00
likewise
c2abae538b
pbuf_free() assert triggered by NULLified inseg.p. Reported by Karl Jeacle on 25-7-2004 on lwip-users.
2004-07-25 23:17:07 +00:00
kieranm
eb69032773
Kieran Mansley - kjm25@cam.ac.uk - 23rd July 2004
...
Now handle CLOSED state in tcp_close() explicitely, and free the pcb.
This is for the case that a pcb has been allocated but never used (so
is in the default "CLOSED" state) and needs to be freed.
2004-07-23 13:07:00 +00:00
likewise
fb5452910f
I hate it when it takes twice to fix a typo
2004-07-22 22:10:17 +00:00
likewise
a6d37fcb25
Removed copy-paste errors.
2004-07-22 22:07:00 +00:00
likewise
fb18e1f036
Removed obsolete debug define.
2004-07-22 21:56:31 +00:00
likewise
786cbee510
Support for learning DNS servers through DHCP.
2004-07-22 21:56:09 +00:00
softins
a4f5673ff3
Small corrections to some debugging statements, to pacify compiler.
2004-07-22 08:06:00 +00:00
softins
1121f2b7f7
Made data types consistent in inet_ntoa().
...
Added casts for return values of checksum routines, to pacify compiler.
2004-07-22 08:03:02 +00:00
softins
4d30218eb2
Updated low_level_output() to match prototype for netif->linkoutput
...
and changed low_level_input() similarly for consistency.
2004-07-21 09:31:03 +00:00
softins
d7699ca81d
Changed debug statements to use the tidier ip4_addrN() macros.
2004-07-21 09:23:11 +00:00
softins
afc3bc6b65
Added trivial (int) cast to keep compiler happier.
2004-07-21 08:57:05 +00:00
softins
6f066fca82
Changed recv_raw() from int to u8_t, to match prototype of raw_recv() in raw.h
...
and so avoid compiler error.
2004-07-21 08:55:26 +00:00
softins
5e24ae49a6
Removed spurious semicolon and added missing end-of-comment.
2004-07-21 08:36:15 +00:00
likewise
bf74ffe974
Outgoing packets caused ARP requests even when the destination IP was already cached.
...
Matched documentation.
2004-07-20 23:18:09 +00:00
likewise
2074861b57
Outgoing packets caused ARP requests even when the destination IP was already cached.
2004-07-20 23:07:54 +00:00
likewise
58b64d42f1
Additional fix for TCP retransmit fix (as discussed by Sam Jansen en Kieran Mansley on lwip-devel, July 13 2004).
2004-07-14 23:21:53 +00:00
likewise
a6ab0405ea
Disabled some code by #if 0 #endif rather than /* */.
2004-07-14 23:19:08 +00:00
kieranm
8273b54108
Kieran Mansley - 14th July 2004
...
* Only move a single segment from the unacked queue to the unsent queue when performing a retransmit
2004-07-14 09:48:27 +00:00
kieranm
c356f560e8
Kieran Mansley - 14th July 2004
...
* Fixed whitespace indenting in parts of tcp_in.c
* Changed adjustment of ssthresh in response to fast retransmit
* Commented out iteration of unsent list when new ACK received as we no longer put all unacked data on unsent list when retransmitting
2004-07-14 09:45:01 +00:00
likewise
8d052ecf24
Source documentation added.
2004-07-12 20:42:16 +00:00
likewise
45e36d9f56
Dependencies on C library memset() etc., so include <string.h>.
2004-07-05 00:00:21 +00:00
likewise
c222d8b672
Updated with latest changes.
2004-07-04 23:52:40 +00:00
likewise
efed3f1f0d
Mentioned placement of closing curly brace (block end).
2004-07-04 23:44:43 +00:00
likewise
7524893802
Dependencies on C library memset() etc., so include <string.h>.
2004-07-04 23:43:38 +00:00
likewise
25a0273b05
LWIP_TIMEVAL_PRIVATE must be defined in architecture cc.h file, either 1 or 0. Defaults to 1.
...
Dependencies on C library memset() etc., so include <string.h> and <errno.h>.
2004-07-04 23:43:02 +00:00
likewise
ce0410b205
LWIP_TIMEVAL_PRIVATE must be defined in architecture cc.h file, either 1 or 0. Defaults to 1.
2004-07-04 23:42:14 +00:00
likewise
efe5ce5c78
Made loop counters unsigned where possible.
2004-07-04 23:40:44 +00:00
likewise
07f52b4b96
Fixed compile errors.
2004-06-30 22:14:03 +00:00
likewise
0be3598990
Style fixes.
2004-06-30 18:42:54 +00:00
likewise
c3284c30cd
Make restarting() DHCP on on interface more robust by cleaning old state information.
2004-06-30 18:42:33 +00:00
likewise
2d94bf4998
Bug fix: etharp_output() should not free pbufs.
...
Bug was introduced in 1.60 and reported by Tim Newsham on 30-Jun-2004 on lwip-users.
2004-06-30 18:41:39 +00:00
likewise
31c1e72b8c
ip_forward() returns netif on which packet was forwarded.
2004-06-30 18:39:17 +00:00
likewise
d11fcafad8
Added netif up/down basics.
2004-06-30 18:38:07 +00:00
kieranm
27c6d299cf
Kieran Mansley - kjm25@cam.ac.uk - 30th May 2004
...
* Fixed bug #9160 after discussion on mailing list
- alters use of MEM_ALIGN_SIZE in pbuf_alloc when calling mem_malloc for a PBUF_RAM pbuf
2004-05-30 14:04:30 +00:00
kieranm
450dd65165
Kieran Mansley - kjm25@cam.ac.uk - 26th May 2004
...
* Fixed bug 9076 (changes to pbuf tot_len and seg dataptr when trimming front edge of a received packet)
2004-05-26 10:04:15 +00:00
likewise
26819e6c39
Fixed documentation for internal function.
2004-05-13 00:28:38 +00:00
likewise
6587efb3e8
Fixed #if ETHARP_QUEUEING to #if ARP_QUEUEING.
2004-05-07 01:20:28 +00:00
likewise
8d2200f29b
Optimized search loop a bit. Conditional code for ETHARP_QUEUEING option.
2004-05-07 01:06:56 +00:00
likewise
e4295396ac
Re-instantiated the pack directives. Nested structs do break individual field natural alignment on arm-gcc.
2004-05-06 03:27:13 +00:00
likewise
5c7a70df28
Fixed wrong argument to find_entry() in etharp_query().
2004-05-06 02:55:53 +00:00
likewise
16a7a8258f
Fixed ETH_EMPTY into ETHARP_STABLE_EMPTY.
2004-05-06 02:54:06 +00:00
likewise
fb1f61b212
Do not empty entries unless allowed to in find_entry().
2004-05-06 02:51:15 +00:00
likewise
c3137df39c
More fixes.
2004-05-06 02:49:10 +00:00
likewise
2df9cd7262
Exported etharp_request().
2004-05-06 02:43:47 +00:00
likewise
a23f6afbee
Fixed typos.
2004-05-06 02:38:42 +00:00
likewise
e37f7fafc1
Optimized through re-use of common code. Results in 50 lines less and more modular code.
...
Work towards timed out and retries of ARP requests. Currently, one timed out ARP request.
2004-05-06 02:35:27 +00:00
likewise
7b803465ad
Simplified update_arp_entry().
2004-05-06 00:14:39 +00:00
likewise
273612b251
Prevent non-unicast addresses from polluting the ARP cache.
2004-05-05 23:47:33 +00:00
likewise
e2bc8e86e2
Removed a closing bracket, left over after removing pack directives.
2004-05-05 23:04:17 +00:00
likewise
79110ba469
Removed all structure packing directives. Protocol header fields are naturally aligned by design.
...
(Earlier, the 14-byte ethernet header screwed this up, this had already been fixed by adding two pad bytes.)
Assumption is that compilers do not align with larger-than-sizeof(type) boundaries.
Pre-tag PRE_PACK_REMOVE. Post-tag POST_TAG_REMOVE.
2004-05-05 19:16:51 +00:00