Date: Mon, 29 Nov 2021 13:35:11 +0000 From: bugzilla-noreply@freebsd.org To: bugs@FreeBSD.org Subject: [Bug 260116] [sctp] POLLOUT/EVFILT_WRITE is always true for poll/kqueue Message-ID: <bug-260116-227@https.bugs.freebsd.org/bugzilla/>
next in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D260116 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: bugs@FreeBSD.org Reporter: albin.hellqvist@gmail.com 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 tha= t 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 =3D sbspace(&so->so_snd); I have tested to replace that line with: kn->kn_data =3D (so->so_snd.sb_hiwat - so->so_snd.sb_acc); Which seems to do the trick, but I expect this to have side effects. --=20 You are receiving this mail because: You are the assignee for the bug.=
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-260116-227>