net: ptp: fix infinite loop in pkt frag
There was wrong implementation in pkt frag removing and inserting. This was causing infinite loop in either net_buf_frag_last or net_pkt_get_len. This happened only when the pkt frag removing and inserting was executed too fast after sending pkt before ethernet_send calling net_pkt_get_len. Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
This commit is contained in:
parent
566b3c0002
commit
1ee51232de
1 changed files with 1 additions and 0 deletions
|
@ -275,6 +275,7 @@ struct ptp_msg *ptp_msg_from_pkt(struct net_pkt *pkt)
|
|||
/* remove packet temporarily. */
|
||||
buf = pkt->buffer;
|
||||
pkt->buffer = buf->frags;
|
||||
buf->frags = NULL;
|
||||
|
||||
hdr = net_udp_get_hdr(pkt, NULL);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue