Page MenuHomeFreeBSD

rtsock: fix socket closure.
ClosedPublic

Authored by melifaro on Jan 15 2023, 1:40 PM.
Tags
None
Referenced Files
F102950669: D38059.diff
Tue, Nov 19, 3:00 AM
Unknown Object (File)
Sun, Nov 10, 4:54 PM
Unknown Object (File)
Wed, Nov 6, 10:39 AM
Unknown Object (File)
Sat, Nov 2, 12:18 AM
Unknown Object (File)
Sat, Oct 26, 3:11 PM
Unknown Object (File)
Oct 1 2024, 11:28 AM
Unknown Object (File)
Sep 30 2024, 11:26 PM
Unknown Object (File)
Sep 16 2024, 6:10 PM
Subscribers

Details

Summary

Currently close(2) erroneously return EOPNOTSUPP for PF_ROUTE sockets. It happened after making rtsock socket implementation self-contained.

Current 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.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

Alexander, thanks a lot for quick fix of my mistake!

This revision is now accepted and ready to land.Jan 15 2023, 6:34 PM
This revision was automatically updated to reflect the committed changes.