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

dnsdist: Fix several signed/unsigned comparison warnings on ARM #5597

merged 2 commits into from Sep 14, 2017


Copy link

Short description

Closes #5489


I have:

  • read the document
  • compiled and tested this code
  • included documentation (including possible behaviour changes)
  • documented the code
  • added or modified regression test(s)
  • added or modified unit test(s)

This would lead to signed/unsigned comparison warnings on ARM.
@@ -190,7 +190,7 @@ static bool sendResponseToClient(int fd, const char* response, uint16_t response
static bool maxConnectionDurationReached(unsigned int maxConnectionDuration, time_t start, unsigned int& remainingTime)
if (maxConnectionDuration) {
time_t elapsed = time(NULL) - start;
unsigned int elapsed = time(NULL) - start;
Copy link

Choose a reason for hiding this comment

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

It probably doesn't matter much but this would lead to closing the connection right away if the time goes backward, because then elapsed becomes huge instead of negative. Perhaps we should store time(nullptr), and if it's lesser than start set elapsed to 0.

@Habbie Habbie modified the milestones: dnsdist-1.2.0, dnsdist-1.3.0 Aug 16, 2017
@pieterlexis pieterlexis merged commit 6031f8d into PowerDNS:master Sep 14, 2017
@pieterlexis pieterlexis deleted the dnsdist-signed-unsigned-arm branch September 14, 2017 12:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet

Successfully merging this pull request may close these issues.

None yet

3 participants