[ip6] clean up return values for otIp6Send() (#3751)

- Return OT_ERROR_PARSE when encountering mal-formatted headers.
- Return OT_ERROR_NO_ROUTE when there is no route to host.
- Document possible return values for `otIp6Send()`.
This commit is contained in:
Jonathan Hui
2019-04-12 08:48:35 -07:00
committed by GitHub
parent b7b085c9f9
commit bd517c9bf2
7 changed files with 44 additions and 25 deletions
+9
View File
@@ -409,9 +409,18 @@ void otIp6SetReceiveFilterEnabled(otInstance *aInstance, bool aEnabled);
/**
* This function sends an IPv6 datagram via the Thread interface.
*
* The caller transfers ownership of @p aMessage when making this call. OpenThread will free @p aMessage when
* processing is complete, including when a value other than `OT_ERROR_NONE` is returned.
*
* @param[in] aInstance A pointer to an OpenThread instance.
* @param[in] aMessage A pointer to the message buffer containing the IPv6 datagram.
*
* @retval OT_ERROR_NONE Successfully processed the message.
* @retval OT_ERROR_DROP Message was well-formed but not fully processed due to packet processing rules.
* @retval OT_ERROR_NO_BUFS Could not allocate necessary message buffers when processing the datagram.
* @retval OT_ERROR_NO_ROUTE No route to host.
* @retval OT_ERROR_PARSE Encountered a malformed header when processing the message.
*
*/
otError otIp6Send(otInstance *aInstance, otMessage *aMessage);