Skip to content

Commit

Permalink
fixup! gnrc_ipv6: check validity of preconfigured source on send
Browse files Browse the repository at this point in the history
Only check for ND message with 6Lo-ND.
  • Loading branch information
miri64 committed Aug 7, 2019
1 parent 2a0bcda commit 659b0eb
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions sys/net/gnrc/network_layer/ipv6/gnrc_ipv6.c
Original file line number Diff line number Diff line change
Expand Up @@ -360,6 +360,7 @@ static int _fill_ipv6_hdr(gnrc_netif_t *netif, gnrc_pktsnip_t *ipv6)
(gnrc_netif_ipv6_addr_get_state(netif, idx) != GNRC_NETIF_IPV6_ADDRS_FLAGS_STATE_VALID);
gnrc_netif_release(netif);
if (invalid_src) {
#if GNRC_IPV6_NIB_CONF_6LN
gnrc_pktsnip_t *icmpv6 = gnrc_pktsnip_search_type(ipv6,
GNRC_NETTYPE_ICMPV6);
icmpv6_hdr_t *icmpv6_hdr;
Expand All @@ -374,6 +375,11 @@ static int _fill_ipv6_hdr(gnrc_netif_t *netif, gnrc_pktsnip_t *ipv6)
ipv6_addr_to_str(addr_str, &hdr->src, sizeof(addr_str)));
return -EADDRNOTAVAIL;
}
#else /* GNRC_IPV6_NIB_CONF_6LN */
printf("ipv6: preset packet source address %s is invalid\n",
ipv6_addr_to_str(addr_str, &hdr->src, sizeof(addr_str)));
return -EADDRNOTAVAIL;
#endif /* GNRC_IPV6_NIB_CONF_6LN */
}
}

Expand Down

0 comments on commit 659b0eb

Please sign in to comment.