polachok / pnetlink

netlink library for rust
42 stars 13 forks source link

get_link_by_name should probably accept OsString not str #19

Open ArcaneNibble opened 7 years ago

ArcaneNibble commented 7 years ago

It is possible to create network device names that are invalid UTF-8 that this crate will not be able to refer to.

sp3d commented 5 years ago

Arguably the most correct type to accept is a std::ffi::Cstr, which doesn't have Windows-induced recalcitrance around yielding bytes and which should enforce the no-internal-NULs invariant that I believe is present here.