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

fix use of deprecated c-ares api #15837

Merged
merged 2 commits into from
May 2, 2024

Conversation

ghost
Copy link

@ghost ghost commented Apr 25, 2024

The c-ares api has deprecated ares_process() and ares_gethostbyname() and it causes a build failure on Fedora 40.

This PR replaces the deprecated functions with their replacements.

ares_process(...) has been deprecated.
Replace it with ares_process_fd(...)

Signed-off-by: Andrew Cooks <acooks.at.bda@gmail.com>
@ghost
Copy link
Author

ghost commented Apr 25, 2024

Somewhat similar theme as #14869

I'm not sure how to make this backwards compatible with older versions of c-ares,
but FRR master doesn't currently build on Fedora 40 with the deprecated functions.

@ghost ghost changed the title fix deprecated c-ares api fix use of deprecated c-ares api Apr 25, 2024
@donaldsharp
Copy link
Member

You need to put a bit in the configure.ac file that detects c-ares versioning, see usage of AC_CHECK_LIB examples in the file. If you are not sure how to do that respond here and we can work with you.

@ghost ghost force-pushed the dev/fix-deprecated-cares-api branch from 5839f52 to 49ffbab Compare April 25, 2024 12:11
c-ares has deprecated ares_gethostbyname() in version 1.28.0
Replace it with ares_getaddrinfo().

This fixes a build error on Fedora 40.

Signed-off-by: Andrew Cooks <acooks.at.bda@gmail.com>
@ghost ghost force-pushed the dev/fix-deprecated-cares-api branch from 49ffbab to 89a2e4d Compare April 25, 2024 20:29
@ghost
Copy link
Author

ghost commented Apr 26, 2024

You need to put a bit in the configure.ac file that detects c-ares versioning, see usage of AC_CHECK_LIB examples in the file. If you are not sure how to do that respond here and we can work with you.

Thanks. I saw how to add a version dependency in configure.ac. Perhaps I misunderstood your suggestion, but in this case I think both old and new versions of c-ares would need to be supported. Luckily c-ares provides a ARES_VERSION macro in ares_version.h, which is already included.

@ghost ghost marked this pull request as ready for review April 26, 2024 00:24
@ghost
Copy link
Author

ghost commented Apr 27, 2024

ci:rerun

@eqvinox eqvinox merged commit afb3020 into FRRouting:master May 2, 2024
9 checks passed
@ton31337
Copy link
Member

ton31337 commented May 3, 2024

@Mergifyio backport stable/10.0

Copy link

mergify bot commented May 3, 2024

backport stable/10.0

✅ Backports have been created

donaldsharp added a commit that referenced this pull request May 4, 2024
@ton31337
Copy link
Member

ton31337 commented May 6, 2024

@Mergifyio backport stable/9.1 stable/9.0 stable/8.5

Copy link

mergify bot commented May 6, 2024

backport stable/9.1 stable/9.0 stable/8.5

✅ Backports have been created

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

Successfully merging this pull request may close these issues.

4 participants