Commit Graph

6278 Commits

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