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

3444 Commits

Author SHA1 Message Date
Leandro Lanzieri
449da7602d gnrc/lorawan: Express timer drift in per mille instead of percentage 2019-12-20 14:12:43 +01:00
José Alamos
7d4082a6a3
Merge pull request #12922 from leandrolanzieri/pr/kconfig_migrate/gnrc/ipv6_blacklisting
Kconfig: Expose gnrc/ipv6/blacklist configurations
2019-12-20 11:32:46 +01:00
Martine S. Lenders
e1ae44b536
gnrc_sixlowpan_frag_stats: actualize pseudo-module
Having the definitions sit in the `net/gnrc/sixlowpan/frag.h` header
does not make much sense, when using Selective Fragment Forwarding
(and the fragmentation buffer already includes a
`net/gnrc/sixlowpan/frag/stats.h` header), so they are moved to their
own header. Since with this change it makes more sense to have the
statistics stored in their own sub-module, the pseudo-module is also
actualized.
2019-12-18 15:45:03 +01:00
Leandro Lanzieri
047c87d67f Kconfig: Expose net/sock/util configurations 2019-12-13 12:22:36 +01:00
Leandro Lanzieri
c74fa5367c net/sock/util: Move configuration macros to 'CONFIG_' namespace
Macros that changed:
SOCK_SCHEME_MAXLEN -> CONFIG_SOCK_SCHEME_MAXLEN
SOCK_HOSTPORT_MAXLEN -> CONFIG_SOCK_HOSTPORT_MAXLEN
SOCK_URLPATH_MAXLEN -> CONFIG_SOCK_URLPATH_MAXLEN
2019-12-13 12:04:54 +01:00
Leandro Lanzieri
3383bae8fe Kconfig: Expose gnrc/ipv6/blacklist configurations 2019-12-11 10:51:04 +01:00
Leandro Lanzieri
56e61dac47 net/gnrc/ipv6_blacklist: Move config macros to 'CONFIG_' namespace
Macros that changed:
GNRC_IPV6_BLACKLIST_SIZE -> CONFIG_GNRC_IPV6_BLACKLIST_SIZE
2019-12-11 10:39:16 +01:00
Martine Lenders
d926810e0b
Merge pull request #12893 from leandrolanzieri/pr/kconfig_migrate/gnrc/ipv6_whitelisting
Kconfig: Expose gnrc/ipv6/whitelist configurations
2019-12-10 18:32:34 +01:00
Benjamin Valentin
00ff291f2e gnrc_lwmac: use uintptr_t to get value of pointer
A pointer is not 32 bit on all platforms.
Since gnrc_lwmac only stores 16 bit in the pointer variable it is
still save to cast like this even on AVR, but cast to uintptr_t
instead of uint32_t.

fixes #12869
2019-12-10 17:18:30 +01:00
Martine S. Lenders
3bf426e6fc
gnrc_sixlowpan_iphc: factor-out IPv6 header decoding into own function 2019-12-10 15:46:51 +01:00
Martine S. Lenders
8ce3c745c8
gnrc_sixlowpan_iphc: add extension header encoding 2019-12-10 15:31:56 +01:00
Martine S. Lenders
a0a334a491
gnrc_sixlowpan_iphc: factor-out IPv6 header encoding into own function 2019-12-10 15:29:06 +01:00
Martine Lenders
f38f974d86
Merge pull request #12629 from miri64/gnrc_sixlowpan_iphc/enh/vrb-creation
gnrc_sixlowpan_iphc: add fragment forwarding stubs
2019-12-10 14:58:01 +01:00
Martine S. Lenders
3273602f24
tests: provide test application for IPHC+VRB behavior 2019-12-10 13:59:41 +01:00
Martine Lenders
a689f51e9a
gnrc_sixlowpan_iphc: add rudimentary forwarding routine 2019-12-10 13:56:33 +01:00
Martine S. Lenders
e31394536b
gnrc_sixlowpan_iphc: factor encoding out of sending function 2019-12-10 13:56:05 +01:00
Martine S. Lenders
556d71a7da
gnrc_sixlowpan_iphc: create VRB entry from uncompressed header
... when VRB is available
2019-12-10 13:56:02 +01:00
José Alamos
2027efa9f4
Merge pull request #12894 from leandrolanzieri/pr/gnrc_doc_config_group
net/gnrc: Group compile configuration Doxygen groups and add GNRC LoRaWAN
2019-12-09 18:20:35 +01:00
Martine Lenders
7b13781cd2
Merge pull request #12625 from miri64/gnrc_sock/enh/async-support
gnrc_sock: provide asynchronous event implementation
2019-12-09 12:39:58 +01:00
Leandro Lanzieri
9a0a514fdd Kconfig: Expose gnrc/ipv6/whitelist configurations 2019-12-06 15:04:14 +01:00
Leandro Lanzieri
a626fec016 Kconfig: Add net/gnrc file and menu 2019-12-06 14:31:00 +01:00
Leandro Lanzieri
37624f4eed Kconfig: Add 'Networking' file and menu 2019-12-06 14:23:39 +01:00
Leandro Lanzieri
de2fbeb112 net/gnrc/ipv6_whitelist: Move config macros to 'CONFIG_' namespace
Macros that changed:
GNRC_IPV6_WHITELIST_SIZE -> CONFIG_GNRC_IPV6_WHITELIST_SIZE
2019-12-06 13:57:52 +01:00
Leandro Lanzieri
47981b96c1 sys/net/gnrc: Add GNRC configuration Doxygen group 2019-12-06 12:18:03 +01:00
Martine Lenders
159accff37 gnrc_ipv6: fix source check for loopback address
When the destination address is the loopback address (`::1`) in GNRC
the selected network interface typically is `NULL`, as with GNRC no
loopback interface de facto exists. So the assertion when checking if
the source address is valid if `netif != NULL` fails on that check.
This change fixes that issue by checking if the destination address is
the loopback address, before checking the validity of the source
address.
2019-12-05 23:38:53 +01:00
Jose Alamos
8999528390 net/gnrc_lorawan: add MIB for setting RX2 datarate 2019-12-03 14:48:29 +01:00
Jose Alamos
1e9bb7c175 net/gnrc_lorawan: add MIB for setting L2 address 2019-12-03 14:27:56 +01:00
Jose Alamos
99dbcecc3a net/gnrc_lorawan: remove netdev SAP interface 2019-12-03 14:08:35 +01:00
Martine Lenders
09c46e273d
Merge pull request #12845 from miri64/gnrc_sixlowpan_frag_rb/fix/rm-by-datagram-pkt-release
gnrc_sixlowpan_frag_rb: fix memory-leak in _rm_by_datagram()
2019-12-02 19:20:55 +01:00
benpicco
900c6994af
Merge pull request #12855 from miri64/gnrc_gomach/fix/i12853
gnrc_gomac: don't use constant as argument for RTT callback
2019-12-02 15:10:40 +01:00
Martine Lenders
e1f81f02fd gnrc_gomac: don't use constant as argument for RTT callback
The RTT callback for a super-frame cycle uses the `arg` pointer to set
the message value that then is handed to the GoMacH thread. However,
in both instances the timer is scheduled the constant
`GNRC_GOMACH_EVENT_RTT_NEW_CYCLE` is provided. This means the argument
is not really necessary.
2019-12-02 08:14:55 +01:00
Martine S. Lenders
0251d6585e
gnrc_sixlowpan_frag_rb: error when interval buffer is full 2019-11-29 18:00:54 +01:00
Martine S. Lenders
3fe1bf59a4
gnrc_sixlowpan_frag_rb: fix memory-leak in _rm_by_datagram()
This fits with the semantics of this function which doesn't provide or
uses any state of the reassembly buffer provided by the user, but finds
the entry itself and then removes it. This gives the user no chance to
remove the packet in the reassembly buffer entry, so
`gnrc_sixlowpan_frag_rb_rm_by_datagram()` has to release the packet
(other than `gnrc_sixlowpan_frag_rb_remove()` where not releasing the
packet is desired as it might be handed up to an upper layer).
2019-11-29 15:38:13 +01:00
Leandro Lanzieri
8aa66e94ea net/gnrc/netif: Remove 'if' prefix from interface names 2019-11-29 10:22:00 +01:00
Hauke Petersen
3a7b60e4d4 net/cord_epsim: adapt to gcoap API changes 2019-11-28 12:50:24 +01:00
Hauke Petersen
7b1217a529 net/cord_ep: adapt to gcoap API changes 2019-11-28 12:50:24 +01:00
Hauke Petersen
3fd8357071 net/gcoap: allow to pass user context to requests 2019-11-28 12:50:24 +01:00
Hauke Petersen
383f395af3 net/gcoap: pass memo to resp_handler directly 2019-11-28 12:48:37 +01:00
MichelRottleuthner
bf676d4728
Merge pull request #11022 from jia200x/pr/gnrc_lorawan
gnrc_lorawan: add support for GNRC based LoRaWAN stack
2019-11-27 09:25:20 +01:00
Jose Alamos
43b7164796 gnrc_pktdump: add NETTYPE_LORAWAN 2019-11-26 21:52:06 +01:00
Jose Alamos
2edaead13e gnrc_netif: add gnrc_lorawan adaption layer 2019-11-26 21:52:06 +01:00
Jose Alamos
39951b8f70 gnrc_lorawan: add initial support for LoRaWAN stack 2019-11-26 21:52:06 +01:00
Jose Alamos
a70b1858c4 netopt: add NETOPTs required for gnrc_lorawan 2019-11-26 21:52:05 +01:00
Hauke Petersen
17b1b19fda net/gcoap: do not allocate RX buf on stack 2019-11-26 15:00:03 +01:00
d4f3747705 sys/net: fix typos 2019-11-23 22:39:38 +01:00
Francois Berder
4a31f94cfc many typo fixes
Signed-off-by: Francois Berder <18538310+francois-berder@users.noreply.github.com>
2019-11-23 22:39:07 +01:00
Francisco Molina
ab16222c8b sys/net/routing/nhdp: fix cpp.check unitialized variable 2019-11-21 11:58:07 +01:00
Francisco Molina
bf3c722abc sys/net/network_layer: fix cpp.check unitialized variable 2019-11-21 11:58:07 +01:00
Martine S. Lenders
f2d1e661d1
gnrc_netapi: report errors on dispatch 2019-11-21 10:51:13 +01:00
Leandro Lanzieri
3c89597c83 net/gnrc/tcp: Adapt to change in ipv6_addr_split_iface 2019-11-15 14:02:50 +01:00
Leandro Lanzieri
4d4f6ae1d6 net/ipv6: Return string pointer when splitting IPv6 interface.
Right now 'ipv6_addr_split_iface' assumes that the interface specifier
will always be a number (based on GNRC way of identifying interfaces),
but this may not be always the case.In order to be able to use the
Network Interface API, interfaces should be referred by their name.

This changes 'ipv6_addr_split_iface' so it returns a pointer to the
string that specifies the interface.
2019-11-15 14:02:50 +01:00
Martine Lenders
02295ce5c7
Merge pull request #12593 from miri64/gnrc_sixlowpan_frag_rb/enh/deletion-timer
gnrc_sixlowpan_frag_rb: allow for deletion timer after completion
2019-11-12 17:54:15 +01:00
Martine S. Lenders
11669d9bdc gnrc_sixlowpan_frag_rb: add missing \n at end of DEBUG line 2019-11-12 17:06:52 +01:00
Martine S. Lenders
40138fdce8 gnrc_sixlowpan_frag_rb: allow for deletion timer after completion
This allows to set a timer between the completion of a datagram in the
reassembly buffer and the deletion of the corresponding reassembly
buffer entry. This allows to ignore potentially late incoming link-layer
duplicates of fragments of the datagram that then will have the
reassembly buffer entry be blocked.

This was noted in this [discussion] for classic 6LoWPAN reassembly (and
minimal fragment forwarding) and is recommended in the current
[selective fragment recovery draft][SFR draft].

[discussion]: https://mailarchive.ietf.org/arch/msg/6lo/Ez0tzZDqawVn6AFhYzAFWUOtJns
[SFR draft]: https://tools.ietf.org/html/draft-ietf-6lo-fragment-recovery-07#section-6
2019-11-12 17:06:52 +01:00
Martine Lenders
918a4ac04d
Merge pull request #12682 from miri64/gnrc_sock/fix/consider-all-snips-for-error
gnrc_sock: consider all pktsnip for gnrc_neterr reporting
2019-11-12 11:45:50 +01:00
Martine Lenders
8992dce4da gnrc_sock: consider all pktsnip for gnrc_neterr reporting
As analyzed in #12678 there are cases where different reports can be
generated for the different snips of the packet send via the `sock`.

To catch all errors generated by the stack, the sock has to subscribe
for all snips of the packet sent. If any of the snips reports an error
distinct from `GNRC_NETERR_SUCCESS` or the previous one, we report that
status instead of just the first we receive. This way we are ensured to
have the first error reported by the stack for the given packet.
2019-11-11 16:40:32 +01:00
Marian Buschsieweke
bd8c4b36aa
sys/net/gnrc: Flag cc110x as 6LN
In gnrc_netif_init_6ln() the flag GNRC_NETIF_FLAGS_6LN is accidentally not set
for cc110x devices. This commit fixes this.
2019-11-11 09:24:01 +01:00
Martine Lenders
f092c27356 gnrc_ipv6: add missing new-line to debug message 2019-11-10 13:50:56 +01:00
José Alamos
20ea18637f
Merge pull request #10485 from miri64/gnrc_netif/enh/default-init
gnrc_netif: assume `netif->ops->init()` to be set to at least a default
2019-11-07 11:41:05 +01:00
Martine Lenders
6493a9e69f gnrc_netif: assume netif->ops->init() to be set 2019-11-07 11:00:36 +01:00
Martine Lenders
14a2f6bc18 gnrc: use gnrc_netif_default_init() for all implementations 2019-11-07 11:00:36 +01:00
Martine Lenders
09b5db28f1 gnrc_netif: expose common init function as default 2019-11-06 18:45:16 +01:00
Martine Lenders
4b82a56c89 gnrc_netif: introduce common init function 2019-11-06 18:45:15 +01:00
Martine Lenders
ca37cde142 gnrc_sixlowpan_frag_fb: introduce function to get entry by tag 2019-11-04 20:04:39 +01:00
Martine Lenders
8c3dc66ad8 gnrc_sixlowpan_frag: factor-out and rename fragmentation buffer
The name `fragment_msg` or `frag_msg`/`msg_frag` always to me was a bit
misplaced, as it basically implements an asynchronous fragmentation
buffer and doesn't necessarily have anything to do with messages.
This change

1. changes the name to `fb` (for fragmentation buffer)
2. factors its code out to its own sub-module so it can be re-used by
   other 6LoWPAN fragmentation schemes like [Selective Fragment
   Recovery]

[Selective Fragment Recovery]: https://tools.ietf.org/html/draft-ietf-6lo-fragment-recovery-05
2019-11-04 20:04:37 +01:00
Martine Lenders
79c8fc5405
Merge pull request #12599 from miri64/gnrc_sixlowpan_frag/enh/remove-code-dup
gnrc_sixlowpan_frag: various optimizations and clean-ups on sending
2019-11-04 19:54:33 +01:00
Martine Lenders
2a1e002d6d
Merge pull request #12627 from miri64/gnrc_sixlowpan_iphc_nhc/enh/frag+iphc-payload_len
gnrc_sixlowpan_iphc_nhc: determine UDP hdr length from RB
2019-11-01 19:47:08 +01:00
Martine S. Lenders
f33111a9c2 gnrc_sixlowpan_iphc: remove duplicate gnrc_netif_hdr_get_netif()
The interface is already fetched in the beginning of the function and
doesn't change during its run, so getting the interface again at this
point is just redundant.
2019-11-01 18:29:44 +01:00
Martine S. Lenders
806f33fce4 gnrc_sixlowpan_iphc_nhc: determine UDP hdr length from RB
When decoding IPHC in a fragmented datagram, relying on the size of the
allocated space for the decoded packet is wrong when fragments are
forwarded and decoded on an intermediate node (for which the reassembly
buffer's space is used): Using the full datagram size for allocation in
this case would be wasteful, so the allocated space is only marginally
larger than the fragment's compressed form.
This in turn results in the wrong UDP payload size being chosen and
even worse being forwarded to the subsequent nodes.

This change uses the (virtual) reassembly buffer's `datagram_size`
instead of relying on the allocated space for the encoded
datagram/fragment.
2019-11-01 13:18:00 +01:00
Martine S. Lenders
b713413c52 gnrc_sock: provide asynchronous event implementation 2019-11-01 00:21:04 +01:00
Martine Lenders
5d11cf26f0 gnrc_netif: use 6LoENC only when 6Lo flag is set 2019-10-30 17:10:34 +01:00
Martine Lenders
e04a190511 gnrc_netif_ethernet: make 6LO configurable for 6LoEnc 2019-10-30 17:10:34 +01:00
8b06560c02
sys/net/nanocoap: correctly initialize array 2019-10-30 17:03:06 +01:00
95da51bd7f
sys/net/nanocoap: fix potential use of uinitialized variable 2019-10-30 17:03:06 +01:00
5d1480a4b8
sys/net/nanocoap: fail when start data cannot be parsed 2019-10-30 17:03:06 +01:00
1aa1e2c8cc
sys/net/nanocoap: return ENOENT if parsing option failed
This fixes a potential use of uninitialized len in subsequent function calls.

This was reported by scan-build
2019-10-30 17:03:06 +01:00
Martine Lenders
bf5b53392c
Merge pull request #12603 from jia200x/pr/link_up
netopt: redefine NETOPT_LINK_CONNECTED
2019-10-30 15:19:07 +01:00
Jose Alamos
43a5fdc870 netopt: rename NETOPT_LINK_CONNECTED 2019-10-30 12:13:36 +01:00
Martine S. Lenders
dba2f9e5ea gnrc_sixlowpan_frag: remove code duplication on fragment creation 2019-10-29 15:34:24 +01:00
Martine S. Lenders
d5e21f35c3 gnrc_sixlowpan_frag: copy netif header directly 2019-10-29 15:34:24 +01:00
Martine Lenders
05d338169d
Merge pull request #12367 from brummer-simon/gnrc_tcp-fix_recv_conn_closed
gnrc_tcp: return immediatly on gnrc_tcp_recv if a connection is closing
2019-10-29 09:54:43 +01:00
benpicco
456982f595
Merge pull request #12595 from aabadie/pr/net/sock_util_scan_build
sys/net/sock_util: fix dead initialization warning
2019-10-28 17:24:50 +01:00
2b0b591c85
sys/net/sock_util: fix dead initialization warning
This was reported by LLVM scan build. The value assigned at initialization is never used, so could be removed
2019-10-28 16:35:18 +01:00
a9399810d5
sys/net/uhcp: remove unused returned value in uhcp_client 2019-10-28 15:14:40 +01:00
aaadaccc3f
sys/net/nanocoap: fix dead assignment in nanocoap server 2019-10-27 10:49:41 +01:00
Francisco
0364c39694
Merge pull request #12408 from miri64/gnrc_netif/fix/src-addr-selection
gnrc_netif: only use prefix matching as tie-breaker in source selection
2019-10-24 17:14:17 +02:00
Martine S. Lenders
e9d75f5655 gnrc_netif: remove filter parameter from _match_to_idx()
`_match_to_idx()` was removed from source address selection (which was
the only one setting the filter parameter to a non-NULL value), so it
is the parameter is not needed anymore.
2019-10-24 16:04:41 +02:00
Martine S. Lenders
e787f6b60d gnrc_netif: only use prefix matching as tie-breaker in source selection
When source address selection is done, both RFC and comments in the code
state, that a longest prefix match should *only* be used as a
tie-breaker between more than one viable candidate. If there is only one
address, there is

a) no need for a tie-breaker
b) in the case of either the destination address or the single remaining
   address being ULAs ([which are considered to be of global scope]
   [RFC4193]) possibly not matching, as `fd00::/7` and e.g. `2001::/8`
   do not have a common prefix.

(b) in fact causes the match function to return -1, causing the source
address selection to return -1, causing the outer function to return the
first address it found (which most often is the link-local address),
causing e.g. a ping to an ULA to fail, even is there is a global
address.

[RFC4193]: https://tools.ietf.org/html/rfc4193
2019-10-24 16:04:41 +02:00
Cenk Gündoğan
e0ab8776f3
Merge pull request #12547 from miri64/gnrc_netif/enh/warn-no-ARSM
gnrc_netif: warn when not joining solicited-nodes from non-6LN netif
2019-10-24 13:46:38 +02:00
Martine Lenders
796d6a3167 gnrc_sixlowpan: move garbage collect msg type to reassembly buffer 2019-10-24 12:41:29 +02:00
Martine Lenders
41708d9f03 gnrc_pktbuf_static: unify NULL pointer output for stats
Different platforms evaluate `printf()` for NULL pointers differently,
resulting tests checking for a certain output to fail. This unifies that
(debug) output for the static packet buffer statistics.
2019-10-23 14:56:29 +02:00
Martine Lenders
88090bc0f6 gnrc_netif: warn when not joining solicited-nodes from non-6LN netif
Similar as with #12513, when the NIB is compiled in 6LN mode (but not
6LR mode), the address-resolution state-machine (ARSM) functionality is
disabled in favor of the more simpler address resolution proposed in RFC
6775.

However, if a non-6LN interface is also compiled in (without making it
a router or border router) it will never join the solicited-nodes
multicast address of addresses added to it, resulting in address
resolution to that interface to fail.

If the interface is not a 6LN (which in case 6LN mode is disabled is
always false), a warning is now printed, encouraging the user to
activate the ARSM functionality if needed.
2019-10-22 22:14:03 +02:00
Simon Brummer
1eb2969986 gnrc_tcp_recv: immediatly return on closed connection 2019-10-22 20:12:38 +02:00
Martine S. Lenders
2458a612b6 gnrc_netif: reduce code duplication 2019-10-21 16:09:37 +02:00
Martine S. Lenders
e96faca739 gnrc_netif: add code comments on source candidate set selection 2019-10-21 16:09:37 +02:00
f8de22a985 gnrc/netif: _match_to_idx(): don't treat link local differently
Cherry-picked from 811c1ee70e (#12404)
2019-10-21 16:09:37 +02:00
Martine Lenders
1bdfbeaaa0
Merge pull request #12425 from miri64/gnrc_ipv6_nib/enh/mutex
gnrc_ipv6_nib: use recursive mutex instead of mutex for locking
2019-10-21 16:08:07 +02:00
Martine Lenders
05bcdba02e
Merge pull request #10499 from miri64/gnrc_netif/enh/split-6lo-6ln
gnrc_netif: introduce distinction if an interface supports 6Lo or if it performs ND according to RFC 6775
2019-10-21 11:47:30 +02:00
Martine Lenders
8b2f697f8c
Merge pull request #12512 from miri64/gnrc_ipv6/fix/i11980
gnrc_ipv6: fix SEGFAULT when multicasting with multiple interfaces
2019-10-21 09:44:44 +02:00
Martine Lenders
7cba2fb63d gnrc_ipv6_nib: don't auto-configure IPv6 w/o SLAAC on non-6LN interface
When the NIB is compiled for 6LN mode (but not a 6LBR), the Stateless
Address Autoconfiguration (SLAAC) functionality is disabled, as it is
typically not required; see `sys/include/net/gnrc/ipv6/nib/conf.h`, ll.
46 and 55. However, if a non-6LN interface is also compiled in (still
without making the node a border router) an auto-configured address will
be assigned in accordance with [RFC 6775] to the interface, just
assuming the interface is a 6LN interface. As it then only performs
duplicate address detection RFC-6775-style then, the address then never
becomes valid, as the duplicate address detection according to [RFC
4862] (part of the SLAAC functionality) is never performed.

As auto-configuring an address without SLAAC doesn't make sense, this
fix makes the interface skip it completely, but provides a warning to
the user, so they know what to do.

[RFC 6775]: https://tools.ietf.org/html/rfc6775#section-5.2
[RFC 4862]: https://tools.ietf.org/html/rfc4862#section-5.4
2019-10-21 00:17:12 +02:00
Martine Lenders
6ad62b01a4 gnrc_netif: distinct is_6lo() and is_6ln()
The functions now are semantic distinct:

- gnrc_netif_is_6lo(): the interface is a 6Lo interface
- gnrc_netif_is_6ln(): the interface is using Neighbor Discovery
  according to RFC 6775
2019-10-20 15:38:14 +02:00
Martine Lenders
363afa62ee gnrc_netif: introduce 6LN flag
This makes it dynamically configurable if an interface actually want's
to use 6Lo ND (according to RFC 6775) or not.
2019-10-20 15:38:13 +02:00
Martine Lenders
fb0e9559a1 gnrc_ipv6: use is_6lo() instead of is_6ln()
We want to check if the interface is an interface requiring the 6Lo
adaptation layer, not if it is a 6LN according to RFC 6775 [[1]].

[1]: https://tools.ietf.org/html/rfc6775#section-2
2019-10-20 15:38:13 +02:00
Martine Lenders
8bcce5615e gnrc_netif: use is_6lo() instead of is_6ln() 2019-10-20 15:38:13 +02:00
Martine Lenders
ce14ee1f77 gnrc_ipv6: fix SEGFAULT when multicasting with multiple interfaces
When writing to the IPv6 header the implementation currently doesn't
take the packet with the (potentially) duplicated header, but the
packet with the original one, which leads to the packet sent and then
released in `gnrc_netif_ethernet.c` first and then accessed again in
further iterations of the "writing to the IPv6 header" loop, which
causes access to an invalid pointer, causing a crash.

Fixes #11980
2019-10-20 14:25:40 +02:00
Martine Lenders
f228dedcf4 gnrc_sixlowpan_frag_rb: fix comment typo 2019-10-19 16:30:45 +02:00
Martine S. Lenders
5bf9892bb3 gnrc_sixlowpan_frag_rb: add new functions for SFR 2019-10-19 16:30:45 +02:00
Martine Lenders
78f04c9fd1
Merge pull request #12441 from miri64/gnrc_icmpv6_error/fix/not-send
gnrc_icmpv6_error: consider originator's destination address correctly
2019-10-19 15:18:50 +02:00
Martine Lenders
c32f1076f6 gnrc_icmpv6_error: consider originator's destination address correctly
While 485dbd1fda (from #12175) was right
in assuming that the for most ICMPv6 error messages the originating
packet's destination address must not be a multicast, this is not the
case for _all_ ICMPv6 error messages (see [RFC 4443], section 2.4(e.3)).
Additionally, 485dbd1fda removed the
check for the source address ([RFC 4443], section 2.4(e.6)), which this
PR re-adds.

[RFC 4443]: https://tools.ietf.org/html/rfc4443#section-2.4
2019-10-19 14:39:45 +02:00
Martine S. Lenders
184e91780a gnrc_sixlowpan_frag_rb: explain second _rbuf_add() call more detailed 2019-10-18 11:14:13 +02:00
Martine S. Lenders
f8d75d7add gnrc_sixlowpan_frag_rb: behavioral change to add()
Rather than dispatching the packet automatically once it is complete,
`gnrc_sixlowpan_frag_rb_add()` now only returns success, and leaves it
to the caller to dispatch the packet.
2019-10-18 09:02:32 +02:00
Martine S. Lenders
a229755abe gnrc_sixlowpan_frag_rb: return status on dispatch_when_complete() 2019-10-18 09:02:32 +02:00
Martine S. Lenders
b086453347 gnrc_sixlowpan_frag_rb: return pointer to entry on add() 2019-10-18 09:02:32 +02:00
Martine S. Lenders
3a4ebe98c3 gnrc_sixlowpan_frag_rb: get index instead of pointer with _rbuf_get() 2019-10-18 09:02:31 +02:00
Cenk Gündoğan
eb981fe8dd
Merge pull request #12444 from miri64/gnrc_sixlowpan_frag_rb/enh/factor-frag-out
gnrc_sixlowpan_frag_rb: seperate out classic frag specific code
2019-10-15 17:41:29 +02:00
Martine Lenders
2a74d32ea9 gnrc_sixlowpan_frag_rb: seperate out classic frag specific code 2019-10-15 10:40:50 +02:00
Martine Lenders
b5b52c74e8 gnrc_ipv6: only discard invalid source when assigned to interface
While it is correct to not use an invalid address as a source address,
it is incorrect to assume that addresses not assigned to the interface
(`idx == -1` in the respective piece of code) are invalid: Other than
classic forwarding via a FIB, forwarded packets utilizing a IPv6
routing header will pass this check, like any other packet sent by this
node. The source address for these is not on the given node, so e.g.
source routing is not possible at the moment.
2019-10-14 15:43:07 +02:00
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