1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2025-01-18 12:52:44 +01:00

Revert "shell: set NULL pointer for data pakets with zero-length payload"

This reverts commit 1ae7bc23d8.
This commit is contained in:
Martine Lenders 2016-07-26 18:37:31 +02:00
parent b5cb68bd66
commit 3feb38611b

View File

@ -1041,7 +1041,7 @@ int _netif_send(int argc, char **argv)
{
kernel_pid_t dev;
uint8_t addr[MAX_ADDR_LEN];
size_t addr_len, data_len;
size_t addr_len;
gnrc_pktsnip_t *pkt, *hdr;
gnrc_netif_hdr_t *nethdr;
uint8_t flags = 0x00;
@ -1073,16 +1073,10 @@ int _netif_send(int argc, char **argv)
}
/* put packet together */
data_len = strlen(argv[3]);
if (data_len == 0) {
pkt = NULL;
}
else {
pkt = gnrc_pktbuf_add(NULL, argv[3], data_len, GNRC_NETTYPE_UNDEF);
if (pkt == NULL) {
puts("error: packet buffer full");
return 1;
}
pkt = gnrc_pktbuf_add(NULL, argv[3], strlen(argv[3]), GNRC_NETTYPE_UNDEF);
if (pkt == NULL) {
puts("error: packet buffer full");
return 1;
}
hdr = gnrc_netif_hdr_build(NULL, 0, addr, addr_len);
if (hdr == NULL) {