Skip to content

Commit 1ee5123

Browse files
yangbolu1991henrikbrixandersen
authored andcommitted
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 <[email protected]>
1 parent 566b3c0 commit 1ee5123

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

subsys/net/lib/ptp/msg.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -275,6 +275,7 @@ struct ptp_msg *ptp_msg_from_pkt(struct net_pkt *pkt)
275275
/* remove packet temporarily. */
276276
buf = pkt->buffer;
277277
pkt->buffer = buf->frags;
278+
buf->frags = NULL;
278279

279280
hdr = net_udp_get_hdr(pkt, NULL);
280281

0 commit comments

Comments
 (0)