Page MenuHomeFreeBSD

rtsock: fix socket closure.
ClosedPublic

Authored by melifaro on Jan 15 2023, 1:40 PM.
Tags
None
Referenced Files
F97720622: D38059.id115180.diff
Mon, Sep 30, 11:26 PM
Unknown Object (File)
Mon, Sep 16, 6:10 PM
Unknown Object (File)
Sun, Sep 15, 3:16 AM
Unknown Object (File)
Aug 15 2024, 1:24 AM
Unknown Object (File)
Jul 28 2024, 5:22 PM
Unknown Object (File)
Jul 26 2024, 4:58 PM
Unknown Object (File)
Jun 21 2024, 3:19 PM
Unknown Object (File)
Jun 17 2024, 6:38 AM
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.