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

3147 Commits

Author SHA1 Message Date
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
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
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