1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00
Commit Graph

3227 Commits

Author SHA1 Message Date
Martine Lenders
a279228663 gnrc_rpl_srh: don't send error message on multicast error
A node is not supposed to send an ICMPv6 error message when the
destination or one of the addresses in the source route is multicast
but is supposed to be silently discarded (see [RFC4443] and [RFC6554]).
If we leave the `err_ptr` unset, the [node will not send an error
message][err_ptr set].

[RFC 4443]: https://tools.ietf.org/html/rfc4443#section-2.4
[RFC 6554]: https://tools.ietf.org/html/rfc6554#section-4.2
[err_ptr set]: https://github.com/RIOT-OS/RIOT/blob/9bc600a/sys/net/gnrc/network_layer/ipv6/ext/rh/gnrc_ipv6_ext_rh.c#L100-L105
2019-10-14 11:25:53 +02:00
Martine Lenders
c94de51e03
Merge pull request #12414 from miri64/gnrc_ipv6_ext_frag/fix/n-th-with-full-rbuf
gnrc_ipv6_ext_frag: fix release on rbuf creation for n-th fragment
2019-10-13 15:10:50 +02:00
Martine S. Lenders
e98f3e48f4 gnrc_ipv6_nib: use rmutex instead of mutex for locking 2019-10-11 12:24:37 +02:00
Martine S. Lenders
01351206d5 gnrc_ipv6_nib: make mutex private 2019-10-11 12:18:52 +02:00
Martine S. Lenders
a14e834ad8 gnrc_ipv6_nib: use mutex wrapper function instead of mutex functions 2019-10-11 12:17:05 +02:00
Martine S. Lenders
1ce19e26b4 gnrc_ipv6_nib: wrap mutex lock/unlock in function 2019-10-11 12:13:32 +02:00
Jose Alamos
8fd0c2b60f gnrc_netif: adapt to new netif_t abstraction 2019-10-11 10:59:14 +02:00
Jose Alamos
77a7aed6e6 netif: introduce descriptor based netif 2019-10-11 10:59:14 +02:00
Martine S. Lenders
095e966b73 gnrc_ipv6_ext_frag: fix release on rbuf creation for n-th fragment
The IPv6 (extension) headers of the first fragment received are re-used
for the reassembled packet, so when receiving a subsequent packet we
need to distinguish, if we just want to release the payload or all of
the packet after the packet data was added to the reassembly buffer.
2019-10-10 16:41:51 +02:00
Martine S. Lenders
ada7c0b7db gnrc_netif: avoid deprecated addresses, don't prefer them! 2019-10-09 15:18:14 +02:00
Martine S. Lenders
f6686e92f1 gnrc_sixlowpan_frag_vrb: add gnrc_sixlowpan_frag_vrb_from_route()
This adds a new VRB function that receives a header with forwarding
information and creates a VRB entry from it. Currently, only IPv6 is
supported.
2019-10-07 18:16:47 +02:00
Martine S. Lenders
c6781af281 gnrc_sixlowpan_frag_vrb: rename addr_str variable 2019-10-07 17:52:09 +02:00
Martine Lenders
9d0faa9e5f
Merge pull request #11957 from miri64/emcute/fix/payload-copy-error
emcute: fix payload copy error for emcute_pub
2019-10-07 17:17:44 +02:00
Martine Lenders
999a7714b0
Merge pull request #12382 from nmeum/pr/asymcute_continue
emcute: never return from receive loop
2019-10-07 16:28:09 +02:00
Sören Tempel
74e19d451c emcute: never return from receive loop
Without this change an attacker would be able to stop the emcute server
by sending a crafted packet triggering this branch. The solution is
using `continue` instead of `return`.
2019-10-07 15:12:20 +02:00
Martine Lenders
9ab67a6d89
Merge pull request #12379 from brummer-simon/gnrc_tcp-no_reopen_recv_window_on_closed_conn
gnrc_tcp: do not reopen recv window on closed connection
2019-10-06 17:32:49 +02:00
Simon Brummer
4fbc0252e1 gnrc_tcp: do not reopen recv window on closed connection 2019-10-06 12:13:37 +02:00
Martine Lenders
b99ec92e6a
Merge pull request #12368 from miri64/gnrc_tcp/fix/check-option-length
gnrc_tcp: check if option has valid length set
2019-10-05 15:11:38 +02:00
Francisco
7d7596ea6c
Merge pull request #11057 from kb2ma/coap/block_optimization
net/coap: Block optimizations
2019-10-04 09:41:05 +02:00
Ken Bannister
2dc4209c0e net/nanocoap: optimize determination of exponent for block szx 2019-10-03 13:17:09 -04:00
Martine Lenders
66e5f7230f gnrc_tcp: check if option has valid length set 2019-10-03 18:30:40 +02:00
Simon Brummer
07210ee571 gnrc_tcp: fix debug message 2019-10-03 15:54:36 +02:00
Ken Bannister
e22d4729e1 net/nanocoap: initialize offset attribute 2019-10-02 05:51:59 -04:00
Ken Bannister
2abcbc0d20 net/coap: add generic get block function 2019-10-02 05:51:59 -04:00
Ken Bannister
5eaa51e426 net/nanocoap: remove unused function 2019-10-02 05:51:59 -04:00
Ken Bannister
efb75c5c4c net/coap: improve slicer to block helper 2019-10-02 05:51:59 -04:00
Ken Bannister
dae9c4ab89 net/nanocoap: use coap_opt_add_uint() and remove unused 2019-10-02 05:51:59 -04:00
Ken Bannister
233dd31e17 net/nanocoap: add generic uint block option 2019-10-02 05:51:59 -04:00
Martine Lenders
aab312e8df
Merge pull request #11958 from miri64/emcute/fix/length-calculation
emcute: fix length field calculation
2019-10-01 09:29:58 +02:00
Martine Lenders
04f59d6609 gnrc_sixlowpan_frag_vrb: re-use now unused super::dst for out_dst 2019-09-30 12:46:15 +02:00
Martine Lenders
45f7966364 gnrc_sixlowpan_frag_vrb: fix for draft update
Due to some changes to the minimal forwarding draft and in preparation
for Selective Fragment Recovery some changes to the VRB API were
needed. Now the index of a VRB entry is only (L2 src, tag) not as
before (L2 src, L2 dst, length, tag).

I know that the current `rbuf_base` causes waste, as all the fields not
used by the new index are effectively not used by the VRB. I'd like to
fix that however in a later change, since that also requires some
modifications of the classic reassembly buffer, and thus would
complicate the review and testing of the change.

Sources for the index change:
- https://tools.ietf.org/html/draft-ietf-6lo-minimal-fragment-04#section-1
- https://mailarchive.ietf.org/arch/browse/6lo/?gbt=1&index=DLCTxC2X4bRNtYPHhtEkavMWlz4
2019-09-29 18:31:43 +02:00
Martine Lenders
e9ff46b2ea gnrc_sixlowpan_frag_rb: unify naming scheme 2019-09-28 12:11:54 +02:00
Martine Lenders
178f4af108 gnrc_sixlowpan_frag_rb: remove legacy defines 2019-09-28 12:07:24 +02:00
Martine Lenders
972e4938bc gnrc_sixlowpan_frag_rb: use existing name scheme for private functions 2019-09-28 11:51:18 +02:00
Martine S. Lenders
49bd8678ed gnrc_sixlowpan_frag_rb: remove public around former private functions 2019-09-28 11:51:18 +02:00
Martine S. Lenders
ec495528fe gnrc_sixlowpan_frag: move private RB functions to RB module 2019-09-28 11:51:18 +02:00
Martine S. Lenders
b5545fe334 gnrc_sixlowpan: include reassembly buffer only where needed 2019-09-27 21:11:36 +02:00
Martine S. Lenders
1f7770da5c gnrc_sixlowpan_frag: move public rbuf functions to their own module 2019-09-27 19:09:52 +02:00
9e65405a68
Merge pull request #12309 from haukepetersen/fix_skald_develhelpbuild
ble/skald: remove broken assert in init()
2019-09-26 22:44:55 +02:00
Martine Lenders
062bc732ea
Merge pull request #11299 from llueder/ndp_cpp_compliant
net/ndp: make addr array ptr c++ compliant
2019-09-26 22:34:45 +02:00
Lasse Lueder
8a86ea4a4b use ndp_opt_rdnss_impl_t to access addresses 2019-09-26 22:08:49 +02:00
Hauke Petersen
1871c0cb85 ble/skald: remove broken assert in init() 2019-09-26 22:07:23 +02:00
benpicco
e942f86837
Merge pull request #11056 from kb2ma/coap/pkt_api_block_write
net/gcoap: add/use Packet API Block implementation
2019-09-24 21:43:33 +02:00
Simon Brummer
fdda22c200 gnrc_tcp: allow unknown options 2019-09-24 20:01:40 +02:00
Sören Tempel
30e4823e94 asymcute: don't make the assumption that req->arg is non-NULL
This fixes a denial of service where an attacker would be able to cause
a NULL pointer dereference by sending a spoofed packet. This attack only
requires knowledge about pending message ids.
2019-09-24 12:00:12 +02:00
Martine Lenders
3a4d1f9bb1
Merge pull request #12281 from aabadie/pr/ci/coccinelle_fix_remaining
tools/ci: fix remaining errors reported by coccinelle static check
2019-09-20 14:22:09 +02:00
Martine Lenders
440b2614b5
Merge pull request #12274 from miri64/gnrc_ipv6/fix/scan-build
gnrc_ipv6: fix scan-build errors
2019-09-20 09:35:40 +02:00
caf48cfb2d
sys/net/lwmac: remove not needed pkt pointer check 2019-09-20 09:01:08 +02:00
Martine S. Lenders
66fa240e9a gnrc_ipv6: fix scan-build errors 2019-09-20 08:59:55 +02:00
benpicco
7a818f0433
Merge pull request #12249 from nmeum/pr/gnrc_tcp_option_length_access
gnrc_tcp: check if option length field is present before accessing it
2019-09-17 23:22:53 +02:00
Martine Lenders
51ef1c997d gnrc_ipv6: use fragmentation if available 2019-09-17 18:55:18 +02:00
Martine Lenders
c2c3216c16 gnrc_ipv6_ext_frag: Initial import of IPv6 fragmentation 2019-09-17 18:55:18 +02:00
Sören Tempel
e5503d62bf gnrc_tcp: check if option length field is present before accessing it
TCP options have up to three fields (kind, length, value). The
current code only checks for the presence of the first field. Before
accessing the second field (length) the code must ensure that a length
field is even present.
2019-09-16 21:13:51 +02:00
benpicco
018c15ae0c
Merge pull request #12253 from nmeum/pr/gnrc_tcp_option_length_check
gnrc_tcp: Always ensure that option->length doesn't exceed opt_left
2019-09-16 21:02:52 +02:00
Martine Lenders
4905a1ad49 gnrc_ipv6_ext: use fragment reassembly if available 2019-09-16 19:13:18 +02:00
Martine Lenders
f4b8ba32f3 gnrc_ipv6_ext_frag: Initial import of IPv6 reassembly 2019-09-16 19:13:18 +02:00
Sören Tempel
463c1212c2 gnrc_tcp: Always ensure that option->length doesn't exceed opt_left 2019-09-16 17:52:25 +02:00
Martine S. Lenders
1ca05f0c08 gnrc_netif_ethernet: fix debug output for received packet
A received packet is outputted in DEBUG _after_ it was already parsed,
but with a reference to the already parsed header. The result is that
there can be some garbage in the output and the packet is not dumped in
total. As without parsing we do not have access to the header yet, we
use the `gnrc_netif_addr_to_str()` helper function instead of parsing
the destination address by hand.
2019-09-16 14:01:16 +02:00
Martine Lenders
1dcf88efb2
Merge pull request #12245 from nmeum/pr/gnrc_tcp_unknown_option
gnrc_tcp: abort on unknown option
2019-09-16 13:01:01 +02:00
Martine Lenders
56e6887a95
Merge pull request #12079 from nmeum/pr/gnrc_tcp_gnrc_pktbuf_add
gnrc_tcp: Fix invocation of gnrc_pktbuf_add
2019-09-16 12:41:57 +02:00
Sören Tempel
9764697a3b gnrc_tcp: abort on unknown option 2019-09-16 12:18:24 +02:00
benpicco
bf2aaa1a5d
Merge pull request #12049 from Sizurka/fix-asymcute-reconnect
asymcute: Reset keepalive counter on connection ACK
2019-09-12 15:55:11 +02:00
Ken Bannister
1621cc1d39
Merge pull request #12075 from kb2ma/coap/options_get_opaque
net/nanocoap: get option bytes
2019-09-12 09:00:27 -04:00
Martine Lenders
8911c514fd
Merge pull request #10951 from miri64/gnrc_ipv6_nib/enh/abr-helpers
shell/sc_gnrc_ipv6_nib: extend for ABR
2019-09-12 07:34:09 +02:00
Martine Lenders
b77e08652e gnrc_ipv6_nib: provide ABR iteration and print function 2019-09-11 23:51:20 +02:00
Kevin "Tristate Tom" Weiss
d6af98b5b7
Merge pull request #11835 from miri64/gnrc_sixlowpan_frag/new/stats
gnrc_sixlowpan_frag_stats: initial import of frag statistics
2019-09-11 12:01:22 +02:00
Ken Bannister
39eddce078 net/nanocoap: add function to retrieve opaque option 2019-09-11 05:40:14 -04:00
Martine Lenders
dca3408167 gnrc_sixlowpan_frag_stats: initial import of frag statistics 2019-09-11 10:30:29 +02:00
Marian Buschsieweke
b87ab96d17
Merge pull request #10661 from miri64/gnrc_netif_hdr/enh/netif_setter
gnrc_netif_hdr: add setter for netif
2019-09-10 16:14:28 +02:00
Martine S. Lenders
cee1b7296d gnrc_icmpv6_echo: use gnrc_netif_hdr_set_netif() also for loopback 2019-09-10 12:37:32 +02:00
Sebastian Meiling
9f5951d216
Merge pull request #10214 from bergzand/pr/nanocoap/flags_uint32t
nanocoap: change method flag type to uint16_t
2019-09-09 12:33:17 +03:00
Martine Lenders
58d621611f
Merge pull request #12175 from shr70/icmpv6_error_fix
[gnrc_icmpv6_error] Fixed multicast detection
2019-09-09 11:32:31 +02:00
Sebastian Meiling
c78ae0e33c
Merge pull request #12074 from kb2ma/coap/options_iterate
net/nanocoap: iterate options
2019-09-09 10:51:23 +03:00
bde253cca3
gcoap: use coap_method_flags_t 2019-09-09 09:40:14 +02:00
4d399bf444
nanocoap: change method flag type to uint32_t 2019-09-09 09:40:14 +02:00
steffen
485dbd1fda [gnrc_icmpv6_error] Fixed multicast detection
before this commit the src address was checked for multicast, but the dst address should be checked. Therefore udp multicast packets would be flooded back to the src as ICMPv6 error, as not all nodes had a UDP receiver registered.
2019-09-05 19:22:43 +02:00
Simon Brummer
351220e884 gnrc_tcp - Release pakets on failed gnrc_netapi_send() 2019-08-31 11:16:55 +02:00
benpicco
837f99e757
Merge pull request #12084 from nmeum/pr/gnrc_tcp_minlen
gnrc_tcp: add minimum length check to _receive
2019-08-30 17:37:20 +02:00
benpicco
7d3f20b1a8
Merge pull request #12088 from nmeum/pr/gnrc_tcp_option_overflow
gnrc_tcp: fix integer underflow in option parser
2019-08-30 17:34:39 +02:00
Martine Lenders
3671f69a43
gnrc_rpl: use gnrc_netif_hdr_set_netif() 2019-08-29 14:51:46 +02:00
Martine Lenders
685f7f6b38
gnrc_lwmac: use gnrc_netif_hdr_set_netif() 2019-08-29 14:51:46 +02:00
Martine Lenders
3c105d8b33
gnrc_gomach: use gnrc_netif_hdr_set_netif() 2019-08-29 14:51:45 +02:00
Hauke Petersen
7f7993f1d6 bluetil/addr: fix byte ordering in addr_from_str() 2019-08-28 16:48:42 +02:00
Hauke Petersen
b7b5791930 sys/bluetil/addr: fix byte ordering in print funcs 2019-08-28 16:48:42 +02:00
Hauke Petersen
218b547b3c net/bluetil/addr: add addr swapped copy function 2019-08-28 16:48:41 +02:00
Hauke Petersen
9df583457f net/l2util: fix addr conversion for BLE 2019-08-28 16:48:41 +02:00
Hauke Petersen
504acc5097 net/l2util: add nimble opt for addr resolution 2019-08-28 16:48:03 +02:00
Juan I Carrano
a6e26597c7
Merge pull request #11987 from miri64/nhdp/doc/deprecate
nhdp: deprecate module
2019-08-28 15:45:00 +02:00
Martine S. Lenders
056bd35e6c nhdp: deprecate module 2019-08-28 06:22:14 +02:00
Sören Tempel
7f3415e91d gnrc_tcp: Fix invocation of gnrc_pktbuf_add
The size parameter should specify the length of the given data.
2019-08-27 10:19:40 +02:00
Sören Tempel
c9358b9217 gnrc_tcp: fix integer underflow in option parser 2019-08-27 10:18:15 +02:00
Sören Tempel
0fff1b35ec gnrc_tcp: add minimum length check to _receive 2019-08-26 16:45:46 +02:00
Ken Bannister
4e89741b79 net/nanocoap: add function to iterate over options 2019-08-24 06:51:29 -04:00
Ken Bannister
6c8e646b83 net/nanocoap: check for payload marker when parse option 2019-08-24 06:51:29 -04:00
Derek Hageman
18910cf4e2 asymcute: Reset keepalive counter on connection ACK
When a keepalive timeout occurs keepalive_retry_cnt remains zero,
so when the connection is re-established _on_keepalive_evt will
immediately disconnect instead of actually sending a keepalive ping.

The sequence looks like:
  1. _on_connack: start con->keepalive_timer
  2. Server does not respond to keepalive pings
  3. _on_keepalive_evt: con->keepalive_retry_cnt reaches zero
  4. Connection torn down and ASYMCUTE_DISCONNECTED sent to application
  5. Application starts reconnection
  6. _on_connack: start con->keepalive_timer again
  7. First _on_keepalive_evt: con->keepalive_retry_cnt is still zero
  8. Repeat from 4.

So this simply resets keepalive_retry_cnt in _on_connack when
the keepalive timer is restarted.  It's a new connection, so
resetting the keepalive retry counter make senses regardless.

Signed-off-by: Derek Hageman <hageman@inthat.cloud>
2019-08-20 17:23:05 -06:00
benpicco
20dec77e39
Merge pull request #11999 from nmeum/pr/gnrc_tcp_mark_update
net/gnrc/tcp: fix invalid read
2019-08-20 15:37:17 +02:00
benpicco
f483988ae9
Merge pull request #12001 from nmeum/pr/gnrc_tcp_memory_leak
gnrc_tcp: Fix memory leak, potential DOS
2019-08-19 14:42:13 +02:00
Sebastian Meiling
226ace7bb6
Merge pull request #9852 from bergzand/pr/rpl/fix_debug_hdrs
gnrc_rpl: remove DEBUG from header files
2019-08-16 11:27:48 +02:00
b33ee93d22
gnrc_rpl: remove DEBUG from header files
This conflicts with the DEBUG setting in C files that include these
headers making it impossible to enable the DEBUG setting in these C
files.
2019-08-16 10:11:41 +02:00
Sören Tempel
c6df2064af gnrc_tcp: Fix memory leak 2019-08-12 23:14:15 +02:00
Sören Tempel
9e91d21625 net/gnrc/tcp: fix uninitialized memory access
From the gnrc_pktbuf_mark documentation:

	    It's not guaranteed that `result->data` points to the
	    same address as the original `pkt->data.

Thus it should be necessary to update the `hdr` pointer.
2019-08-12 22:04:35 +02:00
Francisco
fde50372c3
Merge pull request #11837 from miri64/gnrc_netif/enh/inter-tx-wait
gnrc_netif: allow for wait of minimum time between sends
2019-08-09 10:53:26 +02:00
Martine Lenders
488c47cbf3 gnrc_netif: allow for wait of minimum time between sends 2019-08-09 10:21:42 +02:00
Kevin "Bear Puncher" Weiss
10a2794c8e
Merge pull request #11970 from miri64/gnrc_ipv6/fix/check-source-for-send
gnrc_ipv6: check validity of preconfigured source on send
2019-08-08 13:39:47 +02:00
Martine S. Lenders
7f2cc4f0b3 gnrc_ipv6: check validity of preconfigured source on send
If an address was pre-configured by the upper layer its validity is
currently ignored. It is neither checked if the address is on the
interface at all nor is it checked if it is valid.

This change provides a fix for that by checking both facts.
2019-08-08 13:16:28 +02:00
Hauke Petersen
02df6ab13f
Merge pull request #11000 from miri64/gnrc_sixlowpan_frag/new/vrb
gnrc_sixlowpan_frag: initial import of the VRB
2019-08-07 17:33:01 +02:00
Martine Lenders
1f1ff16e3c gnrc_sixlowpan_frag: include VRB in normal GC 2019-08-07 16:19:36 +02:00
Martine Lenders
26a526eaee gnrc_sixlowpan_frag: initial import of the VRB
VRB = virtual reassembly buffer
2019-08-07 16:18:19 +02:00
Benjamin Valentin
e8dc1119b8 sys: make use of ARRAY_SIZE macro 2019-08-06 19:43:54 +02:00
e352b54a9b
net/gnrc/tcp: remove duplicate net_gnrc_tcp group definitions 2019-08-05 16:57:37 +02:00
f922df8c99
net/gnrc/sock: remove duplicate net_gnrc_sock group definition 2019-08-05 16:57:37 +02:00
Martine S. Lenders
89afc378a9 emcute: fix length field calculation
The length field in an MQTT packet carries the _total_ length of the
packet. If it is below 256 (i.e. fits in one byte) only one byte is
used for the length field. If it is larger than that 3 bytes are used,
with the first byte having the value `0x01` and the remaining bytes
representing the length in as a 2 byte unsigned integer in network byte
order. Resulting from that it can be assessed that the check in
`emcutes`'s `set_len()` function is wrong as it needs to be checked if
`len` is lesser or equal to `0xff - 1`. `len <= (0xff - 1)` can be
simplified to `len < 0xff`. For some larger packages this safes 2 bytes
of wasted packet space.
2019-08-05 13:08:20 +02:00
Martine S. Lenders
10a3f3e8ed emcute: fix payload copy error for emcute_pub
`len` is used with the `memcpy()` to copy the payload to `tbuf`. With a
payload provided that is just long enough to fill `tbuf`, `len += 6`
leads to the `memcpy()` overriding data after `tbuf` (e.g. the
`mutex` that is unlocked right after) and thus resulting in potential
segmentation faults.
Additionally `+ 6` can only be applied if the total packet length is
below 256 (see spec), so `len + pos` is what needs to be provided to the
corresponding send functions instead (`pos` adapts to the header length
of the PUBLISH message).
2019-08-05 13:07:15 +02:00
Ken Bannister
513ddfd79c net/nanocoap: add Packet API block write functions 2019-08-02 09:46:24 -04:00
Ken Bannister
c8e87e7854
Merge pull request #11787 from miri64/gcoap/enh/backoff-config
gcoap: allow for retransmission backoff to be turned off
2019-08-02 06:40:07 -04:00
Ken Bannister
28317019fc
Merge pull request #11784 from miri64/gcoap/fix/ack-variance-0
gcoap: don't call random_uint32_range() when COAP_ACK_VARIANCE=0
2019-08-02 05:10:45 -04:00
Ken Bannister
b5200e96a7
Merge pull request #11024 from kb2ma/coap/add_block_helpers
net/nanocoap: Buffer API Block helper functions
2019-07-31 12:41:25 -04:00
Marian Buschsieweke
d4d5f27b72
Merge pull request #11916 from miri64/gnrc_icmpv6_echo/enh/use-netif_hdr-setter
gnrc_icmpv6_echo: use gnrc_netif_hdr_set_netif()
2019-07-30 19:48:43 +02:00
Ken Bannister
64b4e0ad2d net/nanocoap: add block slicer init function 2019-07-30 13:10:10 -04:00
Ken Bannister
a6f919ef3e net/nanocoap: refactor block2_finish() 2019-07-30 13:10:10 -04:00
Ken Bannister
86edea81be net/nanocoap: use block init helper internally 2019-07-30 13:10:10 -04:00
Ken Bannister
69efaa1d56 net/nanocoap: add block init helper function 2019-07-30 13:10:10 -04:00
Ken Bannister
f4df9d79e9
Merge pull request #11002 from kb2ma/coap/block_finish_proto
net/nanocoap: Buffer API Block implementation
2019-07-30 12:49:12 -04:00
Leandro Lanzieri
a9ab9d37e2
Merge pull request #11765 from kb2ma/coap/encode_resources
net/gcoap: add/publish link format attributes for a resource
2019-07-27 22:36:33 +02:00
Ken Bannister
d481ca9da7 net/gcoap: add selectable function to write a link 2019-07-27 07:09:40 -04:00
Martine Lenders
44410a4aeb
Merge pull request #11918 from miri64/gnrc_ipv6/enh/use-netif_hdr-setter
gnrc_ipv6: use gnrc_netif_hdr_get/set_netif()
2019-07-26 12:00:39 +02:00
Martine S. Lenders
e865f4e34c gnrc_icmpv6_error: use gnrc_netif_hdr_get/set_netif() 2019-07-25 15:52:14 +02:00
Martine S. Lenders
4231b7cd38 gnrc_ndp: use gnrc_netif_hdr_set_netif() 2019-07-25 15:48:14 +02:00
Martine S. Lenders
2afa6795ef gnrc_ipv6: use gnrc_netif_hdr_get_netif() 2019-07-25 15:48:14 +02:00
Martine S. Lenders
7b43a8f9d5 gnrc_ipv6: use gnrc_netif_hdr_set_netif() 2019-07-25 15:45:44 +02:00
Martine S. Lenders
47fdebc938 gnrc_icmpv6_echo: use gnrc_netif_hdr_set_netif() 2019-07-25 15:20:26 +02:00
Martine S. Lenders
4a38dabc70 gnrc_netif_ieee802154: use gnrc_netif_hdr_set_netif() 2019-07-25 14:56:47 +02:00
Martine S. Lenders
006f10c2af gnrc_netif_ethernet: use gnrc_netif_hdr_set_netif() 2019-07-25 14:15:37 +02:00
Ken Bannister
9dce54b54b net/nanocoap: refactor block option control use 2019-07-22 05:42:08 -04:00
Ken Bannister
4311f17e81 net/nanocoap: refactor block option put 2019-07-22 05:42:08 -04:00
Aiman Ismail
a1a6dcd5ae sys/net: add credman (D)TLS credential manager 2019-07-19 13:56:21 +02:00
36f533e7ae
Merge pull request #11839 from kb2ma/nanocoap/option_func_doc
net/nanocoap: document internal option functions
2019-07-18 23:06:54 +02:00
Ken Bannister
64ba8e4ea9 net/nanocoap: document internal option functions 2019-07-18 05:21:40 -04:00
Martine Lenders
60c26648fe
Merge pull request #11766 from nmeum/pr/gnrc_tftp_min_len
gnrc_tftp: Add minimum packet length check
2019-07-16 14:39:48 +02:00
6c02521591 nanocoap: make coap_get_block2() actually fill struct 2019-07-05 15:29:58 +02:00
de244e6679 gnrc/pktbuf: remove obsolete sys/uio.h include
This was previously used by gnrc_pktbuf_get_iovec() for the definitions
of "struct iovec", which has been removed a while ago.
2019-07-04 16:12:57 +02:00
Hauke Petersen
eb50d4704a net/emcute: make cli ID conform to standard 2019-07-04 11:04:22 +02:00
Hauke Petersen
785f59fb7f net/asymcute: make cli ID len conform to standard 2019-07-04 11:03:37 +02:00
Kevin "Bear Puncher" Weiss
6176878153
Merge pull request #11786 from miri64/gnrc_tftp/fix/set-dst-port-on-server-init
gnrc_tftp: set port on server init
2019-07-04 08:49:31 +02:00
Martine Lenders
16f0751102
Merge pull request #11745 from miri64/gnrc_ipv6/fix/rm-dangerous-dup
gnrc_ipv6: remove obsolete and harmful reception code
2019-07-03 23:50:06 +02:00
Martine Lenders
0cc4c50919
Merge pull request #11780 from miri64/gnrc_pktbuf/cleanup/rm-duplicate_upto
gnrc_pktbuf: remove gnrc_pktbuf_duplicate_upto
2019-07-03 17:44:08 +02:00
Martine S. Lenders
1c946a1af4 gnrc_tftp: set port on server init 2019-07-03 16:49:43 +02:00
Martine S. Lenders
c31c9ed216 gcoap: allow for retransmission backoff to be turned off 2019-07-03 16:35:48 +02:00
Martine S. Lenders
1bde141697 gcoap: don't call random_uint32_range() when COAP_ACK_VARIANCE=0
`COAP_ACK_VARIANCE` is a configurable macro, so when it is 0, the
[precondition for `random_uint32_range()`][1] is not held.

[1]: https://doc.riot-os.org/group__sys__random.html#gab6ee09e1e56df3cc78acd1fbf97bfb24
2019-07-03 15:45:45 +02:00
Martine S. Lenders
b83430aa62 gnrc_pktbuf: remove gnrc_pktbuf_duplicate_upto
The removal of this function was already announced for the 2019.04
release. So it is safe to remove it.
2019-07-03 15:09:18 +02:00
Martine S. Lenders
7e70bf3ac1 cord_epsim: replace gcoap_req_send2() 2019-07-03 15:02:22 +02:00
Martine S. Lenders
0579ef952e cord_ep: replace gcoap_req_send2() 2019-07-03 15:02:15 +02:00
Martine S. Lenders
c9179a26c8 gcoap: replace internal references to gcoap_req_send2()
`gcoap_req_send2()` is deprecated and was replaced with
`gcoap_req_send()`.
2019-07-03 15:00:06 +02:00
Martine S. Lenders
ea449f3f9e gnrc_ipv6: remove obsolete and harmful reception code
When reworking the reception of IPv6 packets I reset a previously set
`ipv6` snip as follows  when the IPv6 extension handler returns a
packet (see first hunk of this commit):

```C
ipv6 = pkt->next->next
```

With `gnrc_ipv6_ext` this makes *somewhat* sense, `pkt->next` was
previously equal to `ipv6` and after the function call `pkt->next`
is the marked extension header, while `pkt->next->next` is the IPv6
header. However, since `ipv6` is already write-protected i.e.
`ipv6->users == 1` (see ll. 665-675), any additional call of
`gnrc_pktbuf_start_write()` [won't][start-write-doc] duplicate the
packet. In fact, the only `gnrc_pktbuf_start_write()` in
`gnrc_ipv6_ext` is used to send the *result* to the subscribers of that
extension header type, leaving the original packet unchanged for the
caller. As such `ipv6` remains the pointer to the IPv6 header whether
we set it in the line above or not. So we actually don't need that
line.

However, the extension header handling also returns a packet when
`gnrc_ipv6_ext` is not compiled in. In that case it is just a dummy
define that returns the packet you give provide it which means that
this still holds true: `pkt->next == ipv6`.
So setting `ipv6` in this case is actually harmful, as `ipv6` now
points to the NETIF header [following the IPv6 header][pkt-structure]
in the packet and this causes the `user` counter of that NETIF header
`hdr` to be decremented if `hdr->users > 1` in the write-protection I
removed in hunk 2 of this commit:

```C
/* pkt might not be writable yet, if header was given above */
ipv6 = gnrc_pktbuf_start_write(ipv6);
if (ipv6 == NULL) {
    DEBUG("ipv6: unable to get write access to packet: dropping it\n");
    gnrc_pktbuf_release(pkt);
    return;
}
```

But as we already established, `ipv6->users` is already 1, so we don't
actually need the write protection here either.

Since the packet stays unchanged after the `ipv6` snip, we also don't
need to re-search for `netif_hdr` after the other two lines are
removed.

[start-write-doc]: https://doc.riot-os.org/group__net__gnrc__pktbuf.html#ga640418467294ae3d408c109ab27bd617
[pkt-structure]: https://doc.riot-os.org/group__net__gnrc__pkt.html#ga278e783e56a5ee6f1bd7b81077ed82a7
2019-07-03 14:44:03 +02:00
Martine S. Lenders
7ba928faa3 gnrc_tftp: make it working again with link-local addresses 2019-07-03 14:04:26 +02:00
Martine Lenders
2fce0950bf gnrc_tftp: set dst_port when duplicated data received 2019-07-03 12:51:10 +02:00
Martine Lenders
3d9c7ee5de gnrc_tftp: set source port for server 2019-07-01 22:56:42 +02:00
Martine Lenders
5ec0b1609a gnrc_tftp: initialize unititialized 'tftp_context_t' values to 0 2019-07-01 22:55:31 +02:00
Sören Tempel
e8d0fb7685 gnrc_tftp: Add minimum packet length check
Fixes #10927
2019-07-01 13:49:25 +02:00
Sebastian Meiling
57361470dd
Merge pull request #11737 from nmeum/pr/gnrc_tftp_mode_compare
gnrc_tftp: Fix out-of-bounds memory access when comparing modes
2019-07-01 09:26:03 +02:00
Jose Alamos
ca8c78116f drivers/sx127x: add NETOPT_RX_SYMBOL_TIMEOUT setter 2019-06-27 15:43:50 +02:00
Jose Alamos
268e6df950 drivers/sx127x: add NETOPT_RANDOM option handling 2019-06-27 15:43:50 +02:00
Jose Alamos
77162b8c6f drivers/sx127x: add NETOPT_SYNCWORD option handling 2019-06-27 15:43:50 +02:00
Sören Tempel
a26942632a gnrc_tftp: Fix out-of-bounds memory access when comparing modes 2019-06-27 10:21:42 +02:00
7b8612b38d
sys/net: add netopt options for lorawan 2019-06-25 13:53:25 +02:00
Martine Lenders
3ee75c3ca9 gnrc_sixlowpan_iphc: assure ctx != NULL for dst compression
For the source address compression it was already done the same way in
12bcc46f15
2019-06-20 16:18:23 +02:00
Martine Lenders
3edb52de0c gnrc_rpl_dodag: remove new_best assignment at initialization
The variable is without usage reassigned with `dodag->parent` below.
2019-06-20 16:18:23 +02:00
Martine Lenders
fa95cc8090 gnrc_ipv6_nib: assure netif != NULL in route info callback 2019-06-20 16:18:23 +02:00
Martine Sophie Lenders
a09072c93d gnrc_ipv6_nib: add address from netif to address validation timer
The `addr` parameter of the NIB's `_handle_dad()` function can come
from anywhere (e.g. in the fallback to classic SLAAC the destination
address of the IP header is used), so putting that pointer in a timer
is not a good idea. Instead we use the version of the address that is
stored within the interface.
2019-06-18 12:05:07 +02:00
Martine Sophie Lenders
f5f8261b1c gnrc_ipv6_nib: add debug messages for DAD + 6Lo 2019-06-18 11:48:04 +02:00
Martine Sophie Lenders
484526533d gnrc_ipv6_nib/SLAAC: add debug message for address validation 2019-06-18 11:47:47 +02:00
Leandro Lanzieri
b9c1146e90 sys/net/sock_util: Accept null pointers in urlsplit 2019-06-12 10:03:11 +02:00
Martine Lenders
7e7e17c33f
Merge pull request #11640 from haukepetersen/add_bluetil_addrfromstr
sys/bluetil: add bluetil_addr_from_str()
2019-06-06 12:09:12 +02:00
Hauke Petersen
665b1d6528 sys/bluetil: add bluetil_addr_from_str() 2019-06-06 11:42:55 +02:00
Martine Lenders
731ef19970 gnrc_ipv6_ext: fix packet snip type
The `pkt->type` of an extension header should be
`GNRC_NETTYPE_IPV6_EXT` so it can be parsed properly as an extension
after building.
2019-06-04 10:47:02 +02:00
Cenk Gündoğan
e34a133428
Merge pull request #11560 from benpicco/rpl/of-api-update
RPL: API update suggestions
2019-05-29 15:44:39 +02:00
42c1da8171 gnrc_rpl: update OF API
- dodag->parents already points to the preferred parent, so give dodag to calc_rank directly
 - remove unused which_parent function
2019-05-29 15:11:18 +02:00
Cenk Gündoğan
3f4259af07
Merge pull request #11061 from miri64/gnrc_sixlowpan_frag/new/hint
gnrc_sixlowpan_frag: Initial import of a fragment size hint feature
2019-05-28 23:09:15 +02:00
Martine Lenders
2534cfb3fa gnrc_sixlowpan_frag: Initial import of a fragment size hint feature
This allows for sending of fragments smaller than the restrictions set
by the link-layer PDU. E.g. to put some slack for IPHC into the first
fragment (see https://tools.ietf.org/html/draft-ietf-6lo-fragment-recovery-02#section-4.1).
2019-05-28 21:03:51 +02:00
Martine Lenders
a8c81debf8 gnrc_sixlowpan_frag: use rbuf base class whenever possible 2019-05-28 18:07:42 +02:00
Martine Lenders
5e7803d506 gnrc_sixlowpan_frag: add datagram size to base type 2019-05-28 18:07:42 +02:00
Martine Lenders
52e4247798 gnrc_sixlowpan_frag: introduce reassembly buffer base class 2019-05-28 18:07:42 +02:00
Martine Lenders
495eaa36a6 gnrc_sixlowpan_frag: remove unnecessary type indirection
The members of `rbuf_t` and `gnrc_sixlowpan_rbuf_t` are now identical
so we can remove the internal type.
2019-05-28 18:07:42 +02:00
Martine Lenders
8cc5d94956 gnrc_sixlowpan_frag: add arrival time to public type
The arrival time is also needed for the VRB's garbage collection.
2019-05-28 18:07:42 +02:00
Martine Lenders
b84e496563 gnrc_sixlowpan_frag: add intervals to public type
The fragment intervals are also required by the VRB, so make them part
of the public representation of a reassembly buffer.
2019-05-28 18:07:42 +02:00
Martine Lenders
a3061ab2cc gnrc_sixlowpan_frag: expose fragment interval type
For the [VRB] I also need to track which the intervals of the fragments
already received (mostly for finding out when I am able to get rid of a
VRB entry, see [this conversation][VRB entry removal]), so to be able to
incorporate it into the common type for both reassembly buffer and VRB I
need to expose that type first.

[VRB]: https://tools.ietf.org/html/draft-ietf-lwig-6lowpan-virtual-reassembly-00
[VRB entry removal]: https://mailarchive.ietf.org/arch/msg/6lo/bTm2REo4PpVcMFH04mF_SlPvS_M
2019-05-28 18:07:41 +02:00
Martine Lenders
8fe12bc82c
Merge pull request #11021 from miri64/gnrc_sixlowpan_frag/enh/multiple-send
gnrc_sixlowpan_frag: allow send of multiple datagrams simultaneously
2019-05-27 11:54:26 +02:00
Martine Lenders
93050d29c0 gnrc_sixlowpan_frag: unify common operations 2019-05-27 10:35:31 +02:00
Martine Lenders
04472d3fbe gnrc_sixlowpan_frag: reorder stack variables for better stack usage 2019-05-27 10:35:31 +02:00
Martine Lenders
b6f19c0bcb gnrc_sixlowpan_frag: allow send of multiple datagrams simultaneously 2019-05-27 10:35:31 +02:00
4d052a6921
Merge pull request #11580 from miri64/gnrc_ipv6_ext/fix/nh-after-change
gnrc_ipv6_ext: don't read from `pkt->data` after `_demux()`
2019-05-26 00:40:37 +02:00
Martine Lenders
ea1708b402 gnrc_ipv6_ext: don't read from pkt->data after _demux()
`_demux()` might change `pkt->data` in all kind of ways (moving it due
to `gnrc_pktbuf_mark()`, though unlikely; releasing it, because e.g. it
starts with a fragment header that marks a fragmented packet containing
only one fragment, etc.) so accessing the pointer *after* calling
`_demux()` is somewhat playing with fire. This change avoids this by
storing the value of `ext_hdr->nh` (all we are interested in here) in a
temporary variable that then is used to set the out-parameter `nh`.

`protnum` needs to be unchanged before the call to `_demux()` as it was
set by the previous iteration and determines what extension header
actually is handled.
2019-05-24 22:11:22 +02:00
Martine Lenders
7e26a22723 gnrc_sixlowpan_frag: fix timeout config macro name 2019-05-24 17:39:35 +02:00
Cenk Gündoğan
650ee83e90
Merge pull request #11442 from miri64/gnrc_sixlowpan_frag/enh/aggressive-config
gnrc_sixlowpan_frag: make aggresive override configurable
2019-05-24 17:25:20 +02:00
Martine Lenders
7833141af1 gnrc_mac: rename directory in line with other modules 2019-05-09 14:46:35 +02:00
Ken Bannister
8aa5258ba7
Merge pull request #11445 from miri64/gcoap/fix/rm-deprecated
gcoap: remove deprecated function gcoap_req_send()
2019-05-03 13:44:02 -04:00
0ec9c57b2b add copyrights from IOTPUSH project 2019-05-02 12:09:37 +02:00
Martine Lenders
a11f817604 gcoap: rename gcoap_req_send2() to gcoap_req_send() 2019-04-25 13:40:32 +02:00
Martine Lenders
affd115405 gcoap: remove deprecated function gcoap_req_send() 2019-04-25 13:39:50 +02:00
Martine Lenders
1cac697a62 gnrc_sixlowpan_frag: make aggresive override configurable 2019-04-25 09:37:34 +02:00