Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

inet_aton() -> inet_pton() #1461

Open
wants to merge 9 commits into
base: develop
Choose a base branch
from

Conversation

michaelortmann
Copy link
Member

@michaelortmann michaelortmann commented Jul 25, 2023

Found by: michaelortmann
Patch by: michaelortmann
Fixes:

One-line summary:
inet_aton() -> inet_pton()

Additional description (if needed):
inet_pton() is POSIX 2001 and additionally supports IPV6
other egg_inet_aton() / inet_aton() calls within eggdrop were already replaced with inet_pton
This PR fixes the rest / module API
Please run misc/runautotools when testing / merging this PR

Test cases demonstrating functionality (if applicable):

@@ -526,7 +526,7 @@ Function global_table[] = {
(Function) sock_has_data,
(Function) bots_in_subtree,
(Function) users_in_subtree,
(Function) egg_inet_aton,
(Function) 0, /* was egg_inet_aton -- use inet_pton() instead */
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can't we just export inet_aton here then to avoid breaking modules?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

inet_aton is not posix. inet_aton(y,z) could be mapped to inet_pton(AF_INET,y,z), but thats not equivalent. inet_aton accepts numbers-and-dots notation, something inet_pton doesnt, so it could potentially break modules anyway. given the module api breakage, i propose we milestone this PR for eggdrop 1.10 pr newer.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if we can risk theoretical breakage, we could of course export inet_aton if available, and export 0 otherwise. if that is what you had in mind.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants