net: Set a flag when checksum has been computed
Set checksum flag on the net_pkt, when checksum is calculated in software. Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
This commit is contained in:
parent
98b46340f2
commit
eadd933607
|
@ -67,6 +67,7 @@ int net_icmpv4_finalize(struct net_pkt *pkt)
|
|||
icmp_hdr->chksum = 0U;
|
||||
if (net_if_need_calc_tx_checksum(net_pkt_iface(pkt))) {
|
||||
icmp_hdr->chksum = net_calc_chksum_icmpv4(pkt);
|
||||
net_pkt_set_chksum_done(pkt, true);
|
||||
}
|
||||
|
||||
return net_pkt_set_data(pkt, &icmpv4_access);
|
||||
|
|
|
@ -71,6 +71,7 @@ int net_icmpv6_finalize(struct net_pkt *pkt)
|
|||
icmp_hdr->chksum = 0U;
|
||||
if (net_if_need_calc_tx_checksum(net_pkt_iface(pkt))) {
|
||||
icmp_hdr->chksum = net_calc_chksum_icmpv6(pkt);
|
||||
net_pkt_set_chksum_done(pkt, true);
|
||||
}
|
||||
|
||||
return net_pkt_set_data(pkt, &icmp_access);
|
||||
|
|
|
@ -3597,6 +3597,7 @@ int net_tcp_finalize(struct net_pkt *pkt)
|
|||
|
||||
if (net_if_need_calc_tx_checksum(net_pkt_iface(pkt))) {
|
||||
tcp_hdr->chksum = net_calc_chksum_tcp(pkt);
|
||||
net_pkt_set_chksum_done(pkt, true);
|
||||
}
|
||||
|
||||
return net_pkt_set_data(pkt, &tcp_access);
|
||||
|
|
|
@ -53,6 +53,7 @@ int net_udp_finalize(struct net_pkt *pkt)
|
|||
|
||||
if (net_if_need_calc_tx_checksum(net_pkt_iface(pkt))) {
|
||||
udp_hdr->chksum = net_calc_chksum_udp(pkt);
|
||||
net_pkt_set_chksum_done(pkt, true);
|
||||
}
|
||||
|
||||
return net_pkt_set_data(pkt, &udp_access);
|
||||
|
|
Loading…
Reference in a new issue