Commit d2df61d2 authored by Max Verevkin's avatar Max Verevkin
Browse files

Socket::connect(): remove unnecessary socket connection

parent be59549b
......@@ -23,9 +23,8 @@ pub struct Socket {
impl Socket {
/// Create a new nl80211 socket with netlink
pub fn connect() -> Result<Self, NlError<GenlId, Genlmsghdr<CtrlCmd, CtrlAttr>>> {
let family_id =
NlSocketHandle::new(NlFamily::Generic)?.resolve_genl_family(NL_80211_GENL_NAME)?;
let sock = NlSocketHandle::connect(NlFamily::Generic, None, &[])?;
let mut sock = NlSocketHandle::connect(NlFamily::Generic, None, &[])?;
let family_id = sock.resolve_genl_family(NL_80211_GENL_NAME)?;
Ok(Self { sock, family_id })
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment