gnrc_sixlowpan_frag: remove redundant PID member
The interface ID is actually also provided in `pkt` so providing it in the `gnrc_sixlowpan_msg_frag_t` struct is redundant.
This commit is contained in:
parent
3fd13b9a85
commit
b27f12bc1f
@ -92,7 +92,6 @@ typedef struct {
|
|||||||
size_t datagram_size; /**< Length of just the (uncompressed) IPv6 packet to be fragmented */
|
size_t datagram_size; /**< Length of just the (uncompressed) IPv6 packet to be fragmented */
|
||||||
uint16_t offset; /**< Offset of the Nth fragment from the beginning of the
|
uint16_t offset; /**< Offset of the Nth fragment from the beginning of the
|
||||||
* payload datagram */
|
* payload datagram */
|
||||||
kernel_pid_t pid; /**< PID of the interface */
|
|
||||||
} gnrc_sixlowpan_msg_frag_t;
|
} gnrc_sixlowpan_msg_frag_t;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -31,9 +31,7 @@
|
|||||||
#define ENABLE_DEBUG (0)
|
#define ENABLE_DEBUG (0)
|
||||||
#include "debug.h"
|
#include "debug.h"
|
||||||
|
|
||||||
static gnrc_sixlowpan_msg_frag_t _fragment_msg = {
|
static gnrc_sixlowpan_msg_frag_t _fragment_msg;
|
||||||
NULL, 0, 0, KERNEL_PID_UNDEF
|
|
||||||
};
|
|
||||||
|
|
||||||
#if ENABLE_DEBUG
|
#if ENABLE_DEBUG
|
||||||
/* For PRIu16 etc. */
|
/* For PRIu16 etc. */
|
||||||
@ -238,7 +236,7 @@ void gnrc_sixlowpan_frag_send(gnrc_pktsnip_t *pkt, void *ctx, unsigned page)
|
|||||||
{
|
{
|
||||||
assert(ctx != NULL);
|
assert(ctx != NULL);
|
||||||
gnrc_sixlowpan_msg_frag_t *fragment_msg = ctx;
|
gnrc_sixlowpan_msg_frag_t *fragment_msg = ctx;
|
||||||
gnrc_netif_t *iface = gnrc_netif_get_by_pid(fragment_msg->pid);
|
gnrc_netif_t *iface;
|
||||||
uint16_t res;
|
uint16_t res;
|
||||||
/* payload_len: actual size of the packet vs
|
/* payload_len: actual size of the packet vs
|
||||||
* datagram_size: size of the uncompressed IPv6 packet */
|
* datagram_size: size of the uncompressed IPv6 packet */
|
||||||
@ -248,6 +246,7 @@ void gnrc_sixlowpan_frag_send(gnrc_pktsnip_t *pkt, void *ctx, unsigned page)
|
|||||||
assert((fragment_msg->pkt == pkt) || (pkt == NULL));
|
assert((fragment_msg->pkt == pkt) || (pkt == NULL));
|
||||||
(void)page;
|
(void)page;
|
||||||
(void)pkt;
|
(void)pkt;
|
||||||
|
iface = gnrc_netif_hdr_get_netif(fragment_msg->pkt->data);
|
||||||
#if defined(DEVELHELP) && ENABLE_DEBUG
|
#if defined(DEVELHELP) && ENABLE_DEBUG
|
||||||
if (iface == NULL) {
|
if (iface == NULL) {
|
||||||
DEBUG("6lo frag: iface == NULL, expect segmentation fault.\n");
|
DEBUG("6lo frag: iface == NULL, expect segmentation fault.\n");
|
||||||
|
|||||||
@ -129,7 +129,6 @@ void gnrc_sixlowpan_multiplex_by_size(gnrc_pktsnip_t *pkt,
|
|||||||
gnrc_pktbuf_release_error(pkt, ENOMEM);
|
gnrc_pktbuf_release_error(pkt, ENOMEM);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
fragment_msg->pid = netif->pid;
|
|
||||||
fragment_msg->pkt = pkt;
|
fragment_msg->pkt = pkt;
|
||||||
fragment_msg->datagram_size = orig_datagram_size;
|
fragment_msg->datagram_size = orig_datagram_size;
|
||||||
/* Sending the first fragment has an offset==0 */
|
/* Sending the first fragment has an offset==0 */
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user