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