Skip to content

Move inet_ntopXX() methods to common.{c,h} - #2916

Merged
jimklimov merged 9 commits into
networkupstools:masterfrom
jimklimov:common-inet_ntopX
Apr 24, 2025
Merged

jimklimov merged 9 commits into
networkupstools:masterfrom
jimklimov:common-inet_ntopX

Conversation

@jimklimov

@jimklimov jimklimov commented Apr 24, 2025 •

Copy link
Copy Markdown
Member

There is a fair amount of ritual to memcpy() (for alignment) the socket structures for different address families, to extract the IP (or other) address from them with inet_ntop() afterwards. Relocating these methods into one spot allows to simplify repetitions of that code in NUT codebase, as well as commonly extend later (e.g. AF_UNIX?..) should we want to.

Follows up from #2915 (includes it) and #2847.

The problem seems to have been introduced in #2012 (part of NUT v2.8.2).

@jimklimov jimklimov added enhancement C-str Issues and PRs about C/C++ methods, headers and data types dealing with strings and memory blocks labels Apr 24, 2025
@jimklimov jimklimov added this to the 2.8.4 milestone Apr 24, 2025
…normally

Avoid firing up QEMU builders on the NUT CI farm, unless we want QEMU tests

Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
@jimklimov jimklimov added the CI Entries related to continuous integration infrastructure (here CI = tools + scripts + recipes) label Apr 24, 2025
Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
…s with NUT_WANT_INET_NTOP_XX macro [networkupstools#2916]

Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
@jimklimov
jimklimov merged commit 72fbc58 into networkupstools:master Apr 24, 2025
@jimklimov
jimklimov deleted the common-inet_ntopX branch April 24, 2025 22:22
@jimklimov jimklimov added impacts-release-2.8.2 Issues reported against NUT release 2.8.2 (maybe vanilla or with minor packaging tweaks) impacts-release-2.8.3 Issues reported against NUT release 2.8.3 (maybe vanilla or with minor packaging tweaks) labels Apr 27, 2025
Challado pushed a commit to Challado/nut that referenced this pull request Oct 14, 2026
Move `inet_ntopXX()` methods to `common.{c,h}`

SVN-Git-Bridge: nut-3e341d2d9c-3fc79f1e8124 72fbc58
Bridge-Author: Jim Klimov <jimklimov+nut@gmail.com>
Bridge-Author-Date: 2025-04-25T00:22:32+02:00
Bridge-Committer: GitHub <noreply@github.com>
Bridge-Committer-Date: 2025-04-25T00:22:32+02:00
From: Jim Klimov <jimklimov+nut@gmail.com>

git-svn-id: file:///mnt/export/subversion/nut/trunk@4335 5f2f2009-99cd-4845-9af7-39d0aa6e3748
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

C-str Issues and PRs about C/C++ methods, headers and data types dealing with strings and memory blocks CI Entries related to continuous integration infrastructure (here CI = tools + scripts + recipes) enhancement impacts-release-2.8.2 Issues reported against NUT release 2.8.2 (maybe vanilla or with minor packaging tweaks) impacts-release-2.8.3 Issues reported against NUT release 2.8.3 (maybe vanilla or with minor packaging tweaks)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants