Skip to content

Commit

Permalink
net: icmpv4: Set the ICMPv4 header correctly
Browse files Browse the repository at this point in the history
The code did not check if the icmpv4 header struct is already
pointing to net_buf or not. This meant that the code did not
set the ICMPv4 options and types correctly.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
  • Loading branch information
jukkar committed Jul 5, 2018
1 parent 8c94b53 commit 4880202
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion subsys/net/ip/icmpv4.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ struct net_icmp_hdr *net_icmpv4_set_hdr(struct net_pkt *pkt,
u16_t pos;

icmp_hdr = net_pkt_icmp_data(pkt);
if (net_icmp_header_fits(pkt, icmp_hdr)) {
if (net_icmp_header_fits(pkt, icmp_hdr) && (hdr == icmp_hdr)) {
return icmp_hdr;
}

Expand Down

0 comments on commit 4880202

Please sign in to comment.