Benjamin Valentin
39951a948e
net/netif: move gnrc_netif_addr_to/from_str() to netif
...
These functions are independent from GNRC and can be used by stack-agnistoc
code.
Avoid pulling in a GNRC dependency by moving those two helper functions to
`netif`.
The old function names are kept as `static inline` wrapper functions to avoid
breaking API users.
2020-08-16 23:52:32 +02:00
Marian Buschsieweke
030e0af985
sys/unaligned: Add 64 bit version
...
Add helper function to access `uint64_t` values with possibly unaligned
pointers.
2020-08-14 12:21:24 +02:00
Leandro Lanzieri
e76387911c
sys/pm_layered: Add module to Kconfig
2020-08-12 12:22:41 +02:00
Leandro Lanzieri
4f2494fa1a
sys/stdio: add module to Kconfig
2020-08-12 12:22:41 +02:00
Leandro Lanzieri
67b2519a7d
sys: add newlib modules to Kconfig
2020-08-12 12:22:40 +02:00
Leandro Lanzieri
4ad2180f81
kconfig: Add default modules' symbols
2020-08-12 12:22:38 +02:00
Benjamin Valentin
d4aa8aad10
nanocoap: validate input with NDEBUG
...
A malformed or malicious CoAP request may contain invalid field lengths.
`nanocoap` protects with this by using `assert()`, which safely crashes
the application in debug mode.
In release mode the check is removed.
Instead of allowing arbitrary memory writes, return 0 on invalid inputs.
Discovered by [Coverity](https://scan3.coverity.com/reports.htm#v46910/p10250/fileInstanceId=38357789&defectInstanceId=9793779&mergedDefectId=297306 )
2020-08-11 15:54:23 +02:00
benpicco
1887e55962
Merge pull request #14743 from benpicco/gnrc_sixlowpan_iphc_coverty
...
gnrc_sixlowpan_iphc: fix issues found by Coverity scan
2020-08-11 14:38:57 +02:00
Benjamin Valentin
2ed7f66d33
gnrc_sixlowpan_iphc: fix last byte of iphc_hdr always being 0
...
Coverty scan found this:
> CID 298295 (#1 of 1): Operands don't affect result (CONSTANT_EXPRESSION_RESULT) result_independent_of_operands:
> (ipv6_hdr_get_fl(ipv6_hdr) & 255) >> 8 is 0 regardless of the values of its operands.
Looking at the code, this appears to be a copy & paste error from the previous line.
2020-08-11 14:09:28 +02:00
Benjamin Valentin
a9a0671232
gnrc_sixlowpan_iphc: fix Out-of-bounds read
...
Coverty scan found this:
> CID 298279 (#1 of 1): Out-of-bounds read (OVERRUN)
> 21. overrun-local: Overrunning array of 16 bytes at byte offset 64 by dereferencing pointer
The original intention was probably to advance the destination pointer by 4 bytes, not
4 * the destination type size.
2020-08-11 13:31:22 +02:00
Marian Buschsieweke
2fb7d84ae5
Merge pull request #14627 from fjmolinas/ps-robust-array-lookup
...
sys/ps: Improve robustness against string table errors.
2020-08-11 10:54:24 +02:00
benpicco
09085e7684
Merge pull request #14730 from maribu/sys-makefile-sort
...
sys: Sort Makefile
2020-08-07 18:13:18 +02:00
Marian Buschsieweke
c2b32430b1
sys: Sort Makefile
2020-08-07 16:42:39 +02:00
95ae77dd4b
Merge pull request #14695 from maribu/event_cleanup
2020-08-06 22:15:51 +02:00
Jannes
7f0a099256
net: Add the possibility to use custom ethertype
2020-08-06 13:04:58 +02:00
e4bb06227f
sys/newlib_syscalls_default: don't use static msp430 heap size
2020-08-05 14:32:58 +02:00
acd47f0c1f
gnrc_tcp: abs() -> labs() for int32_t
...
Fixes compilation on msp430 and probably avr.
2020-08-05 14:32:58 +02:00
e09383d343
sys/newlib_syscalls_default: mark _exit as used
2020-08-05 14:32:58 +02:00
23efdcc786
sys/newlib: explicitly define heap for msp430
2020-08-05 14:29:07 +02:00
83f13b8b22
sys/newlib: provide msp430 specific linker symbol names
2020-08-05 14:29:07 +02:00
30cf61dd35
cpu/msp430: remove obsolete msp430 specific headers
2020-08-05 14:29:07 +02:00
Marian Buschsieweke
a5c4692806
sys/event: Add multi-queue initializers
...
Add a set of helper functions to initialize / claim an array of queues and use
this in `tests/events`.
2020-08-05 11:59:40 +02:00
Marian Buschsieweke
2c03dfca13
sys/event: Made trivial functions static inline
...
When the expected ROM overhead of a function is bigger than the actual function,
it is better to provide the function as static inline function in the header.
2020-08-05 11:45:53 +02:00
Marian Buschsieweke
649486f5cd
sys/event: Remove incorrect comment
...
The value of `queue->waiter` at the time the event was queued (with IRQs
disabled) was backed up to the stack-variable `waiter`. Thus, the test later on
for `waiter` checks if the queue was already claimed at the time the event
was queued. Therefore, there is no race.
2020-08-05 11:44:25 +02:00
7b05b85135
Merge pull request #14682 from maribu/event_wait_prio
2020-08-05 11:38:55 +02:00
Marian Buschsieweke
8bda9fac1b
sys/event: Add support for multiple queues
...
Added `event_wait_multi()` that takes an array of event queues rather than
a single event queues. The queue with the lowest index will have the highest
priority.
2020-08-04 13:30:25 +02:00
Leandro Lanzieri
7f1f8ae576
Merge pull request #14652 from akshaim/Kconfig_netif
...
net/netif : Expose configurations to Kconfig
2020-08-03 20:03:33 +02:00
Martine Lenders
b043e1fa64
Merge pull request #14683 from miri64/gnrc_sixlowpan_frag_vrb/fix/cppcheck-warning
...
gnrc_sixlowpan_frag_vrb: fix cppcheck warning
2020-08-03 13:15:52 +02:00
Akshai M
e557fa8ef6
net/netif : Update documentation
2020-08-03 16:10:15 +05:30
Akshai M
1a844b3df6
net/netif : Expose configurations to Kconfig
...
Co-authored-by: Leandro Lanzieri <leandro.lanzieri@haw-hamburg.de>
2020-08-03 16:10:00 +05:30
Akshai M
b52e3e1587
net/netif : Move 'NETIF_NAMELENMAX' to 'CONFIG_'
2020-08-03 16:09:21 +05:30
Martine S. Lenders
5885293e9e
gnrc_sixlowpan_frag_vrb: fix cppcheck warning
...
... which wasn't a false positive after all.
2020-08-03 12:29:06 +02:00
Benjamin Valentin
6af92ee113
gnrc/nib: fix _idx_dsts() calculation
...
Using pointer difference already gives us the number of elements of
size of what the pointer is pointing to.
Dividing by size will lead to the wrong (always 0) result.
2020-08-03 11:35:54 +02:00
Francisco Molina
1a66ce3d23
sys/ps/ps: use same order as tcb for lookup table
2020-07-29 17:13:11 +02:00
Juan Carrano
d167cb3af8
sys/ps: Improve robustness against string table errors.
...
The mapping from thread state codes to a human readable string in the
PS modules has to be maintained manually. There is a very real possibility
for it to get out of sync with the actual defined states, which would cause
a crash when a lookup with an out of bounds index is performed. Also, because
of the way the array is defined, there could be gaps (which will be filled by
nulls).
This patch replaces the array looukup by a function that checks bounds and
also triggers an assertion so that the issue can be caught during development.
2020-07-29 17:12:40 +02:00
Leandro Lanzieri
224e2c977d
Merge pull request #14509 from jia200x/pr/lora_implicit_mode
...
sx127x: add support for implicit header mode
2020-07-29 12:52:00 +02:00
Jose Alamos
f3bdf7232d
netopt: add NETOPT_PDU_SIZE
2020-07-29 11:57:52 +02:00
Martine Lenders
05b13f5029
Merge pull request #14488 from PeterKietzmann/pr_add_sha256prng
...
sys/random: add SHA256 mode to SHA1PRNG & tests
2020-07-29 11:20:55 +02:00
benpicco
2d4d29367e
Merge pull request #14642 from maribu/fix-byteorder-big-endian
...
core/byteorder: Fix be byte buffer conversion on big endian systems
2020-07-29 01:25:03 +02:00
Marian Buschsieweke
4f391007f0
sys/unaligned: Add 32 bit version
2020-07-28 22:34:25 +02:00
Martine Lenders
91c23511d1
Merge pull request #14639 from kaspar030/sys_benchmark_extended_xtimer_workaround
...
sys/benchmark: don't disable interrupts
2020-07-28 22:12:28 +02:00
Martine Lenders
6e8006240b
Merge pull request #14628 from cgundogan/pr/sys/shell/ping_alias
...
sys: shell: deduplicate help text for ping command
2020-07-28 19:48:32 +02:00
Martine Lenders
0e3aa2fff5
Merge pull request #14632 from benpicco/netif_single
...
gnrc_netif: replace GNRC_NETIF_SINGLE with gnrc_netif_single pseudo-module
2020-07-28 17:56:51 +02:00
f60980b163
sys/benchmark: don't disable interrupts
...
the function uses xtimer, which breaks with disabled interrupts.
2020-07-28 16:03:00 +02:00
Leandro Lanzieri
cfdf30409a
Merge pull request #14599 from akshaim/Kconfig_dhcpv6
...
net/dhcpv6 : Expose configurations to Kconfig
2020-07-28 15:46:17 +02:00
Benjamin Valentin
0c06694f72
gnrc_netif: replace GNRC_NETIF_SINGLE with gnrc_netif_single pseudo-module
2020-07-28 13:59:20 +02:00
benpicco
403b6b15c6
Merge pull request #14481 from maribu/cpp-fix-linking
...
Makefile.{base,include}: Fix linking for C++ code in external modules
2020-07-28 12:42:14 +02:00
Akshai M
a9e0a110d7
net/dhcpv6 : Remove unused macro
...
Remove unused macro 'DHCPV6_CLIENT_SERVER_MAX'
2020-07-28 15:02:48 +05:30
Cenk Gündoğan
891b8e37d7
sys: shell: deduplicate help text for ping command
2020-07-28 10:49:17 +02:00
Akshai M
6be6300075
net/dhcpv6 : Update documentation
...
Add configuration 'CONFIG_DHCPV6_CLIENT_PFX_LEASE_MAX' to
configuration group
2020-07-24 00:23:08 +05:30