HomeFreeBSD

rtsock: fix socket closure.

Description

rtsock: fix socket closure.

Currently close(2) erroneously return EOPNOTSUPP for PF_ROUTE sockets.
It happened after making rtsock socket implementation self-contained (
36b10ac2cd18 ). Rtsock code marks socket as connected in rts_attach().
soclose() tries to disconnect such socket using .pr_disconnect callback.
Rtsock does not implement this callback, resulting in the default method being
substituted. This default method returns ENOTSUPP, failing soclose() logic.

This diff restores the previous behaviour by adding custom pr_disconnect()
returning ENOTCONN.

Reviewed by: glebius
Differential Revision: https://reviews.freebsd.org/D38059

Details

Provenance
melifaroAuthored on Jan 15 2023, 1:40 PM
Reviewer
glebius
Differential Revision
D38059: rtsock: fix socket closure.
Parents
rGddcdb534b766: pf tests: properly destroy renamed interfaces
Branches
Unknown
Tags
Unknown