Commit Graph

4080 Commits

Author SHA1 Message Date
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