net: icmpv4 : calculate ipv4 header chksum
In icmpv4, after calling setup_ipv4_header() function, only calculate ICMP chksum, not calculate ipv4 header chksum, ipv4 header chksum still 0, the other side will drop this pack. Change-Id: I1550a4c8c7ab63132d70ba6ce19a7caf78ad84e6 Signed-off-by: li zj <279939902@qq.com>
This commit is contained in:
parent
0fc1d808a3
commit
9a87e403ac
1 changed files with 3 additions and 0 deletions
|
@ -94,6 +94,9 @@ static inline void setup_ipv4_header(struct net_buf *buf, uint8_t extra_len,
|
|||
|
||||
net_nbuf_set_ip_hdr_len(buf, sizeof(struct net_ipv4_hdr));
|
||||
|
||||
NET_IPV4_BUF(buf)->chksum = 0;
|
||||
NET_IPV4_BUF(buf)->chksum = ~net_calc_chksum_ipv4(buf);
|
||||
|
||||
NET_ICMP_BUF(buf)->type = icmp_type;
|
||||
NET_ICMP_BUF(buf)->code = icmp_code;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue