diff --git a/sys/include/net/ng_udp.h b/sys/include/net/ng_udp.h index 5908cb7e616008e7f2587bbfa1c8f015a9cd5351..0caa8352eea44a7926dd3f61893a996697773c50 100644 --- a/sys/include/net/ng_udp.h +++ b/sys/include/net/ng_udp.h @@ -70,9 +70,9 @@ typedef struct __attribute__((packed)) { * @param[in] pseudo_hdr Pointer to the network layer header * * @return 0 on success - * @return -EBADMSG if @p pkt is not of type NG_NETTYPE_UDP - * @return -EFAULT if @p pkt or @p pseudo_hdr is NULL - * @return -ENOENT if @p pseudo_hdr_type is not known + * @return -EBADMSG if @p hdr is not of type NG_NETTYPE_UDP + * @return -EFAULT if @p hdr or @p pseudo_hdr is NULL + * @return -ENOENT if ng_pktsnip_t::type of @p pseudo_hdr is not known */ int ng_udp_calc_csum(ng_pktsnip_t *hdr, ng_pktsnip_t *pseudo_hdr); @@ -86,7 +86,8 @@ int ng_udp_calc_csum(ng_pktsnip_t *hdr, ng_pktsnip_t *pseudo_hdr); * @param[in] dst_len Length of @p dst, must be 2 * * @return pointer to the newly created (and allocated) header - * @return NULL on error + * @return NULL on `src == NULL`, `dst == NULL`, `src_len != 2`, `dst_len != 2` + * or on allocation error */ ng_pktsnip_t *ng_udp_hdr_build(ng_pktsnip_t *payload, uint8_t *src, size_t src_len, diff --git a/sys/net/transport_layer/ng_udp/ng_udp.c b/sys/net/transport_layer/ng_udp/ng_udp.c index 917fb33e8fa7f3baaacc3a2386123343027133dc..6787d9bd0c7bb4bc192722c2058194bd1a27e914 100644 --- a/sys/net/transport_layer/ng_udp/ng_udp.c +++ b/sys/net/transport_layer/ng_udp/ng_udp.c @@ -208,7 +208,7 @@ int ng_udp_calc_csum(ng_pktsnip_t *hdr, ng_pktsnip_t *pseudo_hdr) { uint16_t csum; - if (hdr == NULL || hdr->next == NULL) { + if ((hdr == NULL) || (pseudo_hdr == NULL)) { return -EFAULT; } if (hdr->type != NG_NETTYPE_UDP) {