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 build on GNU/Hurd #1417

Closed
wants to merge 1 commit into from
Closed

Fix build on GNU/Hurd #1417

wants to merge 1 commit into from

Conversation

yadij
Copy link
Contributor

@yadij yadij commented Jul 12, 2023

Definitions of htonl() and htons() require these headers, in this order.

Definitions of htonl() and htons() require these headers, in this order.
@yadij yadij added the backport-to-v6 maintainer has approved these changes for v6 backporting label Jul 12, 2023
@yadij yadij added the M-cleared-for-merge https://github.com/measurement-factory/anubis#pull-request-labels label Jul 12, 2023
#if HAVE_ARPA_INET_H
#include <arpa/inet.h>
#endif

static_assert(sizeof(RandomUuid) == 128/8, "RandomUuid has RFC 4122-prescribed 128-bit size");
Copy link
Contributor

Choose a reason for hiding this comment

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

Definitions of htonl() and htons() require these headers, in this order.

A better fix would provide a Squid-specific header that can be included to get htonl() and similar declarations (and an automated check for that header inclusion) instead of chasing #include violations one build failure at a time while we continue to copy-paste htonl() callers.

FWIW, here are some of the other source files that make htonl() or similar calls but do not explicitly include the two system headers added in this PR. Some of the entries on this list include one header and most get the right declarations indirectly (in most build environments), from places like sys/socket.h.

  • lib/rfcnb/rfcnb-util.c: missing netinet/in.h
  • src/CacheDigest.cc: missing both
  • src/adaptation/icap/ServiceRep.cc: missing both
  • src/auth/basic/RADIUS/Changelog: missing both
  • src/auth/basic/RADIUS/basic_radius_auth.cc: missing arpa/inet.h
  • src/auth/basic/RADIUS/radius-util.cc: missing arpa/inet.h
  • src/base/RandomUuid.cc: missing both
  • src/cache_cf.cc: missing both
  • src/delay_pools.cc: missing both
  • src/dns/rfc3596.cc: missing arpa/inet.h
  • src/dns_internal.cc: missing both
  • src/htcp.cc: missing both
  • src/icmp/Icmp.cc: missing both
  • src/icmp/net_db.cc: missing both
  • src/icp_v2.cc: missing both
  • src/ip/Address.cc: missing netinet/in.h
  • src/ip/Intercept.cc: missing arpa/inet.h
  • src/ip/QosConfig.cc: missing both
  • src/neighbors.cc: missing both
  • src/peer_digest.cc: missing both
  • src/store_digest.cc: missing both
  • src/tests/testIcmp.cc: missing both
  • src/wccp.cc: missing both
  • src/wccp2.cc: missing both

Disclaimer: Manually, I have only checked a few entries on the above list.

squid-anubis pushed a commit that referenced this pull request Jul 12, 2023
Definitions of htonl() and htons() require these headers, in this order.
@squid-anubis squid-anubis added the M-waiting-staging-checks https://github.com/measurement-factory/anubis#pull-request-labels label Jul 12, 2023
@squid-anubis squid-anubis added M-merged https://github.com/measurement-factory/anubis#pull-request-labels and removed M-waiting-staging-checks https://github.com/measurement-factory/anubis#pull-request-labels M-cleared-for-merge https://github.com/measurement-factory/anubis#pull-request-labels labels Jul 12, 2023
@yadij yadij deleted the fix-ntohl branch July 19, 2023 19:33
squidadm pushed a commit to squidadm/squid that referenced this pull request Jul 25, 2023
Definitions of htonl() and htons() require these headers, in this order.
@squidadm squidadm removed the backport-to-v6 maintainer has approved these changes for v6 backporting label Jul 25, 2023
@squidadm
Copy link
Collaborator

queued for backport to v6

yadij added a commit that referenced this pull request Jul 25, 2023
Definitions of htonl() and htons() require these headers, in this order.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
M-merged https://github.com/measurement-factory/anubis#pull-request-labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants