Skip to content

Commit 5f28eb6

Browse files
RIOT: update submodule to 2020.04
1 parent e48c20a commit 5f28eb6

4 files changed

Lines changed: 14 additions & 10 deletions

File tree

RIOT

Submodule RIOT updated 6761 files

task-08/main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020

2121
#include <stdio.h>
2222

23-
#include "tlsf-malloc.h"
23+
#include "tlsf.h"
2424
#include "msg.h"
2525
#include "shell.h"
2626
#include "ccn-lite-riot.h"

task-09/main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ static void *_ipv6_fwd_eventloop(void *arg)
6161
gnrc_pktsnip_t *pkt = msg.content.ptr;
6262
if(msg.type == GNRC_NETAPI_MSG_TYPE_SND) {
6363
gnrc_pktsnip_t *ipv6 = gnrc_pktsnip_search_type(pkt, GNRC_NETTYPE_IPV6);
64-
ipv6_addr_t addrs[GNRC_NETIF_IPV6_ADDRS_NUMOF];
64+
ipv6_addr_t addrs[CONFIG_GNRC_NETIF_IPV6_ADDRS_NUMOF];
6565
int res;
6666
ipv6 = ipv6->data;
6767

task-09/udp.c

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -39,14 +39,18 @@ static gnrc_netreg_entry_t server = GNRC_NETREG_ENTRY_INIT_PID(GNRC_NETREG_DEMUX
3939
static void send(char *addr_str, char *port_str, char *data, unsigned int num,
4040
unsigned int delay)
4141
{
42-
int iface;
42+
char *iface;
43+
gnrc_netif_t *netif = NULL;
4344
uint16_t port;
4445
ipv6_addr_t addr;
4546

4647
/* get interface, if available */
4748
iface = ipv6_addr_split_iface(addr_str);
48-
if ((iface < 0) && (gnrc_netif_numof() == 1)) {
49-
iface = gnrc_netif_iter(NULL)->pid;
49+
if ((!iface) && (gnrc_netif_numof() == 1)) {
50+
netif = gnrc_netif_iter(NULL);
51+
}
52+
else if (iface) {
53+
netif = gnrc_netif_get_by_pid(atoi(iface));
5054
}
5155
/* parse destination address */
5256
if (ipv6_addr_from_str(&addr, addr_str) == NULL) {
@@ -86,11 +90,11 @@ static void send(char *addr_str, char *port_str, char *data, unsigned int num,
8690
return;
8791
}
8892
/* add netif header, if interface was given */
89-
if (iface > 0) {
90-
gnrc_pktsnip_t *netif = gnrc_netif_hdr_build(NULL, 0, NULL, 0);
93+
if (netif) {
94+
gnrc_pktsnip_t *netif_hdr = gnrc_netif_hdr_build(NULL, 0, NULL, 0);
9195

92-
((gnrc_netif_hdr_t *)netif->data)->if_pid = (kernel_pid_t)iface;
93-
LL_PREPEND(ip, netif);
96+
((gnrc_netif_hdr_t *)netif_hdr->data)->if_pid = netif->pid;
97+
LL_PREPEND(ip, netif_hdr);
9498
}
9599
/* send packet */
96100
if (!gnrc_netapi_dispatch_send(GNRC_NETTYPE_UDP, GNRC_NETREG_DEMUX_CTX_ALL, ip)) {

0 commit comments

Comments
 (0)