Skip to content

platform/netlink: use nm_random_get_bytes() for initial seq value

Jan Vaclav requested to merge jvaclav/NetworkManager:jv/netlink-random-init into main

Summary

This MR changes the initial value for s_seq_expect to be purely random instead of sourced from the current time.

Purpose

Coverity warns when a time_t is cast to 32-bits - however, we do not need to use the time here at all, since it is only used as an initializing value that is not expected to be a timestamp.

Checklist

Please read https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/blob/main/CONTRIBUTING.md before opening the merge request. In particular, check that:

  • the subject for all commits is concise and explicative
  • the message for all commits explains the reason for the change
  • the source is properly formatted
  • any relevant documentation is up to date
  • you have added unit tests if applicable
  • the NEWS file is updated when the change deserves to be mentioned, for example for new features, behavior changes, API deprecations, etc.

Merge request reports