logo

Rust crates reviews

Cryptographically verifiable, distributed dependency reviews

crate: neli

https://lib.rs/crates/neli/

Add the last reviewed version to Cargo.toml / [dependencies]:

neli = "0.6.1"

Filter reviews clicking on the numbers in the summary.

Full column names in tooltip hints: rating Negative, rating Neutral, rating Positive, rating Strong, thoroughness, understanding, reviews count.

Neg
Neu
Pos
Str
tho
und
rev
1
1
crate version
rating
date
reviewer
thoroughness, understanding
neli 0.6.1
positive
2022-06-30
low, medium

Safety

unsafe limited to interaction with the Netlink socket.

Uses of unsafe

  • All uses of unsafe are warranted and blocks span the
    minimum necessary amount of code.

  • unsafe blocks wrap syscalls on the socket descriptor
    (fcntl, socket, setsockopt, getsockopt,
    send, recv, close). Arguments in general don’t
    depend on dynamically sized objects, and where they do, it is
    safe buffer types whose lengths are handled correctly.

    • line 65: socket(), args: only integer values, return
      ok.

    • line 82: fcntl() (two calls), args: integer values,
      return ok.

    • line 96: fcntl() (two calls), args: integer values,
      return ok.

    • line 110: fcntl(), args: integer values, return ok.

    • line 121: mem::zeroed(), ok because a sockaddr_nl
      can be safely zero initialized.

    • line 125: bind(), args: integer and pointer values,
      correct size supplied for struct sockaddr pointer arg,
      return ok.

    • line 144: setsockopt(), args: integer values, arg size
      ok, return ok.

    • line 163: setsockopt(), args: integer values, arg size
      ok, return ok.

    • line 183, 197: getsockopt(), args: integer and pointer
      values, out-pointer arg is zero initialized Vec, arg
      size ok, return ok.

    • line 220: send(), args: integer and pointer values, arg
      size ok, return ok.

    • line 238: recv(), args: integer and pointer values, arg
      size ok, return ok.

    • line 282: close(), arg: integer value, return discarded
      but is harmless in Drop impl.

    • line 851: NlSocket::from_raw_fd(), arg: dummy value,
      ok for unit test.

  • unsafe fn in trait impls for FromRawFd. → Nothing
    actually unsafe going on in there; wrapped assigment is plain
    Copy data only except for heap allocation via safe
    interface.

Pros

  • Comprehensive wrapper for talking Netlink and various dialects
    thereof (rtnetlink, generic netlink, …) to the Kernel.

  • Active development.

  • Typed APIs allow for intuitive use of Netlink APIs that is
    superior to the everything-is-an-int C analogues (libnl*,
    libmnl),

  • Provides macros for defining idiomatic wrappers of other
    Netlink based interfaces.

Cons

  • v0.x versioned, frequent API breakage.

  • Depends itself on various zerover crates.

© bestia.dev 2023, MIT License, Version: 2023.608.1636

Open source repository for this web app: https://github.com/bestia-dev/cargo_crev_web/