Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Register
  • Sign in
  • NetworkManager NetworkManager
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 170
    • Issues 170
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 20
    • Merge requests 20
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Container Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar

Due to an influx of spam, we have had to impose restrictions on new accounts. Please see this wiki page for instructions on how to get full permissions. Sorry for the inconvenience.

  • NetworkManagerNetworkManager
  • NetworkManagerNetworkManager
  • Merge requests
  • !389

[th/inet-addr-cleanup]

  • Review changes

  • Download
  • Email patches
  • Plain diff
Closed Thomas Haller requested to merge th/inet-addr-cleanup into master Jan 09, 2020
  • Overview 4
  • Commits 1
  • Pipelines 3
  • Changes 1

Various cleanup for handling IP addresses (and their string representations).

Let's recap why we don't use inet_ntop() directly. The only reason is that inet_ntop() pretends that it might fail. But the only reason when this function can fail is if the addr-family is wrong, or the input buffers are not pointing to valid memory. De facto, properlty used the function cannot fail. In the past we had gazillon of code trying to handle errors from inet_ntop(). Instead, we use nm_utils_inet_ntop() and the likes, which asserts for valid input arguments, and otherwise cannot fail.

We should consistently use the same helper functions. That implies, a helper function defined in libnm-core/libnm is not suitable, because it's not available everywhere.

Move some of the helper functions to shared and do various cleanup along the way.

Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: th/inet-addr-cleanup