mirror of
https://github.com/opnsense/src.git
synced 2026-06-09 00:32:25 -04:00
sockets: inherit SO_ACCEPTFILTER from listener to child
This is crucial for operation of accept_filter(9). See added comment.
Fixes: d29b95ecc0
This commit is contained in:
parent
91bdebc958
commit
a8acc2bf56
1 changed files with 6 additions and 2 deletions
|
|
@ -761,9 +761,13 @@ solisten_clone(struct socket *head)
|
|||
* including those completely irrelevant to a new born socket. For
|
||||
* compatibility with older versions we will inherit a list of
|
||||
* meaningful options.
|
||||
* The crucial bit to inherit is SO_ACCEPTFILTER. We need it present
|
||||
* in the child socket for soisconnected() promoting socket from the
|
||||
* incomplete queue to complete. It will be cleared before the child
|
||||
* gets available to accept(2).
|
||||
*/
|
||||
so->so_options = head->so_options & (SO_KEEPALIVE | SO_DONTROUTE |
|
||||
SO_LINGER | SO_OOBINLINE | SO_NOSIGPIPE);
|
||||
so->so_options = head->so_options & (SO_ACCEPTFILTER | SO_KEEPALIVE |
|
||||
SO_DONTROUTE | SO_LINGER | SO_OOBINLINE | SO_NOSIGPIPE);
|
||||
so->so_linger = head->so_linger;
|
||||
so->so_state = head->so_state;
|
||||
so->so_fibnum = head->so_fibnum;
|
||||
|
|
|
|||
Loading…
Reference in a new issue