Skip to content

Commit

Permalink
Merge branch 'icmpv6/enh/listed-payload' into HEAD
Browse files Browse the repository at this point in the history
  • Loading branch information
miri64 committed May 11, 2015
2 parents ff14ccc + ed6764f commit bf9ccbf
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
3 changes: 2 additions & 1 deletion sys/include/net/ng_icmpv6.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ void ng_icmpv6_demux(kernel_pid_t iface, ng_pktsnip_t *pkt);
/**
* @brief Builds an ICMPv6 message for sending.
*
* @param[in] next Next packet snip in the new packet.
* @param[in] type Type for the ICMPv6 message.
* @param[in] code Code for the ICMPv6 message.
* @param[in] size Size of the ICMPv6 message (needs do be >
Expand All @@ -74,7 +75,7 @@ void ng_icmpv6_demux(kernel_pid_t iface, ng_pktsnip_t *pkt);
* @return The ICMPv6 message on success
* @return NULL, on failure
*/
ng_pktsnip_t *ng_icmpv6_build(uint8_t type, uint8_t code, size_t size);
ng_pktsnip_t *ng_icmpv6_build(ng_pktsnip_t *next, uint8_t type, uint8_t code, size_t size);

/* TODO: build error messages */

Expand Down
2 changes: 1 addition & 1 deletion sys/net/network_layer/ng_icmpv6/echo/ng_icmpv6_echo.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ ng_pktsnip_t *ng_icmpv6_echo_build(uint8_t type, uint16_t id, uint16_t seq,
ng_pktsnip_t *pkt;
ng_icmpv6_echo_t *echo;

if ((pkt = ng_icmpv6_build(type, 0, data_len + sizeof(ng_icmpv6_echo_t))) == NULL) {
if ((pkt = ng_icmpv6_build(NULL, type, 0, data_len + sizeof(ng_icmpv6_echo_t))) == NULL) {
return NULL;
}

Expand Down
5 changes: 3 additions & 2 deletions sys/net/network_layer/ng_icmpv6/ng_icmpv6.c
Original file line number Diff line number Diff line change
Expand Up @@ -126,12 +126,13 @@ void ng_icmpv6_demux(kernel_pid_t iface, ng_pktsnip_t *pkt)
}
}

ng_pktsnip_t *ng_icmpv6_build(uint8_t type, uint8_t code, size_t size)
ng_pktsnip_t *ng_icmpv6_build(ng_pktsnip_t *next, uint8_t type, uint8_t code,
size_t size)
{
ng_pktsnip_t *pkt;
ng_icmpv6_hdr_t *icmpv6;

pkt = ng_pktbuf_add(NULL, NULL, size, NG_NETTYPE_ICMPV6);
pkt = ng_pktbuf_add(next, NULL, size, NG_NETTYPE_ICMPV6);

if (pkt == NULL) {
DEBUG("icmpv6_echo: no space left in packet buffer\n");
Expand Down

0 comments on commit bf9ccbf

Please # to comment.