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
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
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
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
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
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
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
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
Dirk Ziegelmeier
51369854b5
Fix bug #52911 : SNMPv3 time window check is not the same as RFC3414
2018-01-16 13:30:31 +01:00
goldsimon
2fd83c9d2e
lwiperf: fix double-free of pbufs on recv error
2018-01-16 06:54:28 +01:00
goldsimon
28c8693683
mqtt: fix documentation error (remove ':' after param name)
2018-01-13 16:09:17 +01:00
goldsimon
eb51b683ed
fix copy & paste error in comment
2018-01-12 20:29:12 +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
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
6b2ef1a89b
httpd: fix typo "kepalive" -> "keepalive"
2018-01-04 06:35:00 +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
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
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
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
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
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
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
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
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
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
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
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
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
0853d1e7d1
sntp: revert 2 -Wconversion changes (see bug #51538 )
2017-11-17 21:39:23 +01:00
Dirk Ziegelmeier
1e0501c31a
Improve HTTPD documentation
2017-11-17 10:08:35 +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
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
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
1a1478551e
Fix bug #52345 : MQTT buffer length check seems wrong
...
(for empty payload in publish message)
2017-11-13 22:29:25 +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
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
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
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
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
0c2d94a283
sntp: allow SNTP_UPDATE_DELAY to be a function
2017-09-22 06:26:53 +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
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
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
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
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
8b1a4ef711
altcp_tls_mbedtls: fix log messages by include a \n
2017-08-08 12:59:44 +02:00
Dirk Ziegelmeier
0eb8d19e82
Move several port number #defines to iana.h
2017-08-08 11:37:08 +02:00
Dirk Ziegelmeier
42fd01547d
Fix bug #51681 : mqtt: cannot free client
...
Add free function
2017-08-07 20:43:25 +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
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
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
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
goldsimon
4c13c32473
fix bug #51578 (SNMP failed to decode some values on non 32bit platforms)
2017-07-26 08:41:13 +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
goldsimon
f3c860958f
-Wconversion (still far from finished) and other minor compilation fixes...
2017-07-06 22:47:11 +02:00
goldsimon
44f7a3cb0d
work on -Wconversion...
2017-07-05 22:31:58 +02:00
Dirk Ziegelmeier
5a27e97baf
smtp.c: Fix detecting overlength server names
...
Thanks to Axel Lin
2017-06-14 22:06:37 +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
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
a92e838687
httpd: include hooks header file so that redefined defines/functions can be defined there
2017-06-13 21:13:45 +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
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
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
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
Daniel Elstner
ccf10a5023
SNTP: Avoid warning if debugging is disabled
2017-05-03 16:40:11 +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
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
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
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
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
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
97f4033a8a
bridgeif: improve documentation
2017-04-04 21:54:52 +02:00
Dirk Ziegelmeier
6559ffd848
Fix C++ style comment in altcp_tls_mbedtls.c
2017-03-31 13:05:04 +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
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
goldsimon
720f9b3a0b
fix compiling altcp_tls_mbedtls sources/headers if mbedtls is not available
2017-03-29 23:02:16 +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
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
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
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
881ab3011e
mqtt: pass client_user/client_pass to server if != NULL
2017-03-27 22:25:26 +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
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
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
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
1e26652d2e
renamed altcp_mbedtls files to altcp_tls_mbedtls
2017-03-23 08:34:02 +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
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
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
ee5021deb1
tftp_server: fix bogus comment lines in file header
2017-03-22 21:14:36 +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
1f1f2e1c46
Try to fix line endings of tftp_server.c in git rep
2017-03-14 09:12:25 +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
Dirk Ziegelmeier
1371400c2b
mdns_domain_add_label_base should be static
2017-03-11 10:41:47 +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
Dirk Ziegelmeier
e15e504217
Some minor SNMPv3 related cleanups
2017-03-06 09:38:58 +01: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
593b211d1b
A few more SNMPv3 cleanups
2017-03-02 11:20:02 +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
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
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
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