CVSROOT:        /cvs
Module name:    src
Changes by:     [email protected]   2026/02/22 14:30:58

Modified files:
        sys/kern       : uipc_socket.c 

Log message:
Prevent false ELOOP error in socket splicing.

To avoid endless splicing loops, the mbuf's lifetime is limited by
the ph_loopcnt counter.  Each time somove() runs, it compares the
value to a maximum and increments.
In the unlikely case that the drain buffer is full, the mbuf stays
in the source buffer after incrementing.  When more data arrives
and somove() is called, the counter at the same mbuf is incremented
again.  Eventually the maxium could be reached and splicing dissolves
with ELOOP.  This is not intended for mbufs which are never moved,
we want to count the moves.
Fix the race and increment just before sending the mbuf out to the
drain buffer.

OK mvs@

Reply via email to