mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2024-12-29 04:50:03 +01:00
gnrc_udp: send ICMPv6 error messages where appropriate
This commit is contained in:
parent
db2da19ea4
commit
e801829c7a
@ -27,6 +27,7 @@
|
|||||||
#include "net/ipv6/hdr.h"
|
#include "net/ipv6/hdr.h"
|
||||||
#include "net/gnrc/udp.h"
|
#include "net/gnrc/udp.h"
|
||||||
#include "net/gnrc.h"
|
#include "net/gnrc.h"
|
||||||
|
#include "net/gnrc/icmpv6/error.h"
|
||||||
#include "net/inet_csum.h"
|
#include "net/inet_csum.h"
|
||||||
|
|
||||||
|
|
||||||
@ -157,6 +158,8 @@ static void _receive(gnrc_pktsnip_t *pkt)
|
|||||||
/* send payload to receivers */
|
/* send payload to receivers */
|
||||||
if (!gnrc_netapi_dispatch_receive(GNRC_NETTYPE_UDP, port, pkt)) {
|
if (!gnrc_netapi_dispatch_receive(GNRC_NETTYPE_UDP, port, pkt)) {
|
||||||
DEBUG("udp: unable to forward packet as no one is interested in it\n");
|
DEBUG("udp: unable to forward packet as no one is interested in it\n");
|
||||||
|
/* TODO determine if IPv6 packet, when IPv4 is implemented */
|
||||||
|
gnrc_icmpv6_error_dst_unr_send(ICMPV6_ERROR_DST_UNR_PORT, pkt);
|
||||||
gnrc_pktbuf_release(pkt);
|
gnrc_pktbuf_release(pkt);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user