Minor: nd6_packet_send_check() -> nd6_get_next_hop_addr_or_queue() (too long, but a little more self-explaining); cosmetics...
diff --git a/src/core/ipv6/ethip6.c b/src/core/ipv6/ethip6.c
index 32d0edf..8f9a91b 100644
--- a/src/core/ipv6/ethip6.c
+++ b/src/core/ipv6/ethip6.c
@@ -73,7 +73,7 @@
* @param ip6addr The IP address of the packet destination.
*
* @return
- * - ERR_OK or the return value of nd6_packet_send_check.
+ * - ERR_OK or the return value of @ref nd6_get_next_hop_addr_or_queue.
*/
err_t
ethip6_output(struct netif *netif, struct pbuf *q, const ip6_addr_t *ip6addr)
@@ -93,14 +93,14 @@
dest.addr[5] = ((const u8_t *)(&(ip6addr->addr[3])))[3];
/* Send out. */
- return ethernet_output(netif, q, (struct eth_addr*)(netif->hwaddr), &dest, ETHTYPE_IPV6);
+ return ethernet_output(netif, q, (const struct eth_addr*)(netif->hwaddr), &dest, ETHTYPE_IPV6);
}
/* We have a unicast destination IP address */
/* @todo anycast? */
/* Ask ND6 what to do with the packet. */
- result = nd6_packet_send_check(netif, q, ip6addr, &hwaddr);
+ result = nd6_get_next_hop_addr_or_queue(netif, q, ip6addr, &hwaddr);
if (result != ERR_OK) {
return result;
}
@@ -112,7 +112,7 @@
/* Send out the packet using the returned hardware address. */
SMEMCPY(dest.addr, hwaddr, 6);
- return ethernet_output(netif, q, (struct eth_addr*)(netif->hwaddr), &dest, ETHTYPE_IPV6);
+ return ethernet_output(netif, q, (const struct eth_addr*)(netif->hwaddr), &dest, ETHTYPE_IPV6);
}
#endif /* LWIP_IPV6 && LWIP_ETHERNET */
diff --git a/src/core/ipv6/ip6.c b/src/core/ipv6/ip6.c
index 2c2bd09..f17b6c8 100644
--- a/src/core/ipv6/ip6.c
+++ b/src/core/ipv6/ip6.c
@@ -145,7 +145,7 @@
/* Get the netif for a suitable router. */
netif = nd6_find_route(dest);
- if (netif != NULL && netif_is_up(netif) && netif_is_link_up(netif)) {
+ if ((netif != NULL) && netif_is_up(netif) && netif_is_link_up(netif)) {
return netif;
}
diff --git a/src/core/ipv6/nd6.c b/src/core/ipv6/nd6.c
index 8bb337f..689e132 100644
--- a/src/core/ipv6/nd6.c
+++ b/src/core/ipv6/nd6.c
@@ -1305,7 +1305,7 @@
void
nd6_clear_destination_cache(void)
{
- s8_t i;
+ int i;
for (i = 0; i < LWIP_ND6_NUM_DESTINATIONS; i++) {
ip6_addr_set_any(&destination_cache[i].destination_addr);
@@ -1879,13 +1879,14 @@
* @param netif The lwIP network interface on which the IP packet will be sent.
* @param q The pbuf(s) containing the IP packet to be sent.
* @param ip6addr The destination IPv6 address of the packet.
- * @param hwaddrp On success, filled with a pointer to a HW address or NULL.
+ * @param hwaddrp On success, filled with a pointer to a HW address or NULL (meaning
+ * the packet has been queued).
* @return
* - ERR_OK on success, ERR_RTE if no route was found for the packet,
* or ERR_MEM if low memory conditions prohibit sending the packet at all.
*/
err_t
-nd6_packet_send_check(struct netif *netif, struct pbuf *q, const ip6_addr_t *ip6addr, const u8_t **hwaddrp)
+nd6_get_next_hop_addr_or_queue(struct netif *netif, struct pbuf *q, const ip6_addr_t *ip6addr, const u8_t **hwaddrp)
{
s8_t i;
diff --git a/src/include/lwip/nd6.h b/src/include/lwip/nd6.h
index 97df6b0..69a059b 100644
--- a/src/include/lwip/nd6.h
+++ b/src/include/lwip/nd6.h
@@ -143,7 +143,7 @@
void nd6_input(struct pbuf *p, struct netif *inp);
void nd6_clear_destination_cache(void);
struct netif *nd6_find_route(const ip6_addr_t *ip6addr);
-err_t nd6_packet_send_check(struct netif *netif, struct pbuf *q, const ip6_addr_t *ip6addr, const u8_t **hwaddrp);
+err_t nd6_get_next_hop_addr_or_queue(struct netif *netif, struct pbuf *q, const ip6_addr_t *ip6addr, const u8_t **hwaddrp);
u16_t nd6_get_destination_mtu(const ip6_addr_t *ip6addr, struct netif *netif);
#if LWIP_ND6_TCP_REACHABILITY_HINTS
void nd6_reachability_hint(const ip6_addr_t *ip6addr);
diff --git a/src/netif/lowpan6.c b/src/netif/lowpan6.c
index 36c041a..9a84cbc 100644
--- a/src/netif/lowpan6.c
+++ b/src/netif/lowpan6.c
@@ -665,7 +665,7 @@
#endif /* LWIP_6LOWPAN_INFER_SHORT_ADDRESS */
/* Ask ND6 what to do with the packet. */
- result = nd6_packet_send_check(netif, q, ip6addr, &hwaddr);
+ result = nd6_get_next_hop_addr_or_queue(netif, q, ip6addr, &hwaddr);
if (result != ERR_OK) {
MIB2_STATS_NETIF_INC(netif, ifoutdiscards);
return result;