https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=260116

            Bug ID: 260116
           Summary: [sctp] POLLOUT/EVFILT_WRITE is always true for
                    poll/kqueue
           Product: Base System
           Version: 13.0-RELEASE
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Some People
          Priority: ---
         Component: kern
          Assignee: [email protected]
          Reporter: [email protected]

It seems like POLLOUT/EVFILT_WRITE always is true for SCTP sockets even if the
socket send buffer is full.

Besides this, it should also account for SO_SNDLOWAT but it is possible that we
will get this for "free" since it looks like the functionality already is
there.

Based on some experiments (which might be faulty), SCTP sockets doesn't use
struct sockbuf in the same way as TCP uses it. A lot of the fields in that
struct are 0 for SCTP sockets since it also has its own structs.

This seems to affect filt_sowrite() in
(https://github.com/freebsd/freebsd-src/blob/main/sys/kern/uipc_socket.c). More
specifically, this line:
kn->kn_data = sbspace(&so->so_snd);

I have tested to replace that line with:
kn->kn_data = (so->so_snd.sb_hiwat - so->so_snd.sb_acc);

Which seems to do the trick, but I expect this to have side effects.

-- 
You are receiving this mail because:
You are the assignee for the bug.

Reply via email to