mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2024-12-29 04:50:03 +01:00
sixlowpan: minor fixes for non-ipv6 usage
This commit is contained in:
parent
09461f1457
commit
79de5ae6e6
@ -67,7 +67,7 @@ void gnrc_sixlowpan_dispatch_recv(gnrc_pktsnip_t *pkt, void *context,
|
||||
|
||||
(void)context;
|
||||
(void)page;
|
||||
#ifdef MODULE_CCNLITE
|
||||
#ifndef MODULE_GNRC_IPV6
|
||||
type = GNRC_NETTYPE_UNDEF;
|
||||
for (gnrc_pktsnip_t *ptr = pkt; (ptr || (type == GNRC_NETTYPE_UNDEF));
|
||||
ptr = ptr->next) {
|
||||
@ -75,11 +75,10 @@ void gnrc_sixlowpan_dispatch_recv(gnrc_pktsnip_t *pkt, void *context,
|
||||
type = ptr->type;
|
||||
}
|
||||
}
|
||||
assert(network_snip);
|
||||
#else /* MODULE_CCNLITE */
|
||||
#else /* MODULE_GNRC_IPV6 */
|
||||
/* just assume normal IPv6 traffic */
|
||||
type = GNRC_NETTYPE_IPV6;
|
||||
#endif /* MODULE_CCNLITE */
|
||||
#endif /* MODULE_GNRC_IPV6 */
|
||||
if (!gnrc_netapi_dispatch_receive(type,
|
||||
GNRC_NETREG_DEMUX_CTX_ALL, pkt)) {
|
||||
DEBUG("6lo: No receivers for this packet found\n");
|
||||
@ -200,7 +199,13 @@ static void _receive(gnrc_pktsnip_t *pkt)
|
||||
}
|
||||
|
||||
pkt = gnrc_pktbuf_remove_snip(pkt, sixlowpan);
|
||||
#if defined(MODULE_CCN_LITE)
|
||||
payload->type = GNRC_NETTYPE_CCN;
|
||||
#elif defined(MODULE_GNRC_IPV6)
|
||||
payload->type = GNRC_NETTYPE_IPV6;
|
||||
#else
|
||||
payload->type = GNRC_NETTYPE_UNDEF;
|
||||
#endif
|
||||
}
|
||||
#ifdef MODULE_GNRC_SIXLOWPAN_FRAG
|
||||
else if (sixlowpan_frag_is((sixlowpan_frag_t *)dispatch)) {
|
||||
@ -257,11 +262,13 @@ static void _send(gnrc_pktsnip_t *pkt)
|
||||
return;
|
||||
}
|
||||
|
||||
#ifdef MODULE_GNRC_IPV6
|
||||
if ((pkt->next == NULL) || (pkt->next->type != GNRC_NETTYPE_IPV6)) {
|
||||
DEBUG("6lo: Sending packet has no IPv6 header\n");
|
||||
gnrc_pktbuf_release(pkt);
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
tmp = gnrc_pktbuf_start_write(pkt);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user