Skip to content

Commit

Permalink
gnrc_ipv6:fix UDP issue when a pck passes through another node
Browse files Browse the repository at this point in the history
  • Loading branch information
Mattia Antonini committed Jul 4, 2016
1 parent 4d7664c commit 6c09442
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions sys/net/gnrc/network_layer/ipv6/gnrc_ipv6.c
Original file line number Diff line number Diff line change
Expand Up @@ -852,7 +852,6 @@ static void _receive(gnrc_pktsnip_t *pkt)
ipv6 = gnrc_pktbuf_mark(pkt, sizeof(ipv6_hdr_t), GNRC_NETTYPE_IPV6);

first_ext = pkt;
pkt->type = GNRC_NETTYPE_UNDEF; /* snip is no longer IPv6 */

if (ipv6 == NULL) {
DEBUG("ipv6: error marking IPv6 header, dropping packet\n");
Expand Down Expand Up @@ -886,10 +885,10 @@ static void _receive(gnrc_pktsnip_t *pkt)
gnrc_pktbuf_realloc_data(pkt, byteorder_ntohs(hdr->len));
}
else if (byteorder_ntohs(hdr->len) >
(gnrc_pkt_len_upto(pkt, GNRC_NETTYPE_IPV6) - sizeof(ipv6_hdr_t))) {
gnrc_pkt_len_upto(pkt, GNRC_NETTYPE_IPV6)) {
DEBUG("ipv6: invalid payload length: %d, actual: %d, dropping packet\n",
(int) byteorder_ntohs(hdr->len),
(int) (gnrc_pkt_len_upto(pkt, GNRC_NETTYPE_IPV6) - sizeof(ipv6_hdr_t)));
(int) gnrc_pkt_len_upto(pkt, GNRC_NETTYPE_IPV6) );
gnrc_pktbuf_release(pkt);
return;
}
Expand Down

0 comments on commit 6c09442

Please sign in to comment.