You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add trait to reduce duplicated code between socket address types, implement netlink addresses (#1004)
* Add SocketAddrArg trait to reduce code duplicated across address types
* Move `SocketAddrStorage` to `crate::net::addr`
* Replace SocketAddrAny enum with a safe wrapper for SocketAddrStorage
To support extensibility over address types, use sockaddr_storage and
Into / TryInto conversions.
* Remove address type variants of `bind`, `connect`, `sendmsg`, `sendto`
Removes:
* `bind_any`, `bind_unix`, `bind_v4`, `bind_v6`, `bind_xdp` in favor of `bind`,
* `connect_any`, `connect_unix`, `connect_v4`, `connect_v6` in favor of `connect` (leaving address-less `connect_unspec`)
* `sendmsg_v4`, `sendmsg_v6`, `sendmsg_unix`, `sendmsg_xdp`, `sendmsg_any` in favor of `sendmsg_addr` (leaving address-less `sendmsg`)
* `sendto_any`, `sendto_v4`, `sendto_v6`, `sendto_unix`, `sendto_xdp` in favor of `sendto`
* Add support for Netlink socket addresses
* Introduce a `SocketAddrLen` type and use it for `SocketAddrOpaque` sizes.
* Fix `bind(&s, &"127.0.0.1:0".parse().unwrap())` in tests.
---------
Co-authored-by: Dan Gohman <[email protected]>
0 commit comments