Skip to content

Fix getprotobyname missing on Android preventing use - #470

Closed
Paliak wants to merge 9 commits into
schweikert:developfrom
Paliak:fix-getprotobyname-android
Closed

Paliak wants to merge 9 commits into
schweikert:developfrom
Paliak:fix-getprotobyname-android

Conversation

@Paliak

@Paliak Paliak commented May 17, 2026

Copy link
Copy Markdown

getprotobyname is stubbed out on Android causing crash_and_burn to be called. This commit removes the ICMP support check when compiling for Android and adds a configuration option to compile without getprotobyname check.

getprotobyname is stubbed out on Android causing crash_and_burn to be
called. This commit removes the icmp support check when compiling for
Android and adds a configuration option to compile without the check.

Signed-off-by: Paliak <91493239+Paliak@users.noreply.github.com>

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request introduces a configuration option to disable the use of getprotobyname and switches to using hardcoded protocol constants (IPPROTO_ICMP and IPPROTO_ICMPV6) for socket initialization. This change improves compatibility with environments like Android where these lookups may fail. A review comment identifies formatting issues in src/socket6.c, specifically the use of tabs instead of spaces and a minor syntax typo in an if condition.

Comment thread src/socket6.c Outdated
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Comment thread src/socket4.c Outdated
Comment thread configure.ac Outdated
Paliak added 4 commits May 31, 2026 20:51
Signed-off-by: Paliak <91493239+Paliak@users.noreply.github.com>
Signed-off-by: Paliak <91493239+Paliak@users.noreply.github.com>
Signed-off-by: Paliak <91493239+Paliak@users.noreply.github.com>
@Paliak

Paliak commented May 31, 2026

Copy link
Copy Markdown
Author

/gemini review

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request introduces conditional compilation to bypass getprotobyname on platforms like Android, falling back to default protocol constants (IPPROTO_ICMP and IPPROTO_ICMPV6). The reviewer suggests a more robust and idiomatic approach using Autoconf's standard feature detection (AC_CHECK_FUNCS([getprotobyname])) to define HAVE_GETPROTOBYNAME automatically, rather than hardcoding platform-specific checks and using a custom USE_GETPROTOBYNAME variable.

Comment thread configure.ac Outdated
Comment thread configure.ac Outdated
Comment thread configure.ac Outdated
Comment thread src/socket4.c Outdated
Comment thread src/socket6.c Outdated
@coveralls

coveralls commented Jun 7, 2026

Copy link
Copy Markdown

Coverage Status

coverage: 88.08% (+0.08%) from 88.0% — Paliak:fix-getprotobyname-android into schweikert:develop

@gsnw-sebast
gsnw-sebast requested a review from schweikert June 10, 2026 05:30
Comment thread src/socket4.c Outdated
Paliak added 2 commits June 13, 2026 15:48
Signed-off-by: Paliak <91493239+Paliak@users.noreply.github.com>
@Paliak
Paliak requested review from gsnw-sebast and schweikert June 13, 2026 14:00

@gsnw-sebast gsnw-sebast left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

As far as I'm concerned, we can go ahead with that. We just need to update the changelog and prepare for a rebase merge.

@sollybr

sollybr commented Aug 19, 2026

Copy link
Copy Markdown

Any ETA on merge?

@gsnw-sebast

Copy link
Copy Markdown
Collaborator

Merged with #475 due to too many merge conflicts

@Paliak
Paliak deleted the fix-getprotobyname-android branch August 23, 2026 15:09
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.

5 participants