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

NGINX agent cannot find the default network interface on Linux hosts.… #318

Closed
wants to merge 2 commits into from

Conversation

richbrowne
Copy link
Contributor

@richbrowne richbrowne commented May 18, 2023

… (#317)

The parser was skipping over the first (header) line with the first invocation of scanner.Scan(). The second invocation of scanner.Scan() called in the for loop points to the first line of route data; however, this line was being skipped. The tests were incorrect because they started with a newline before the header.

Proposed changes

Remove the logic to skip over the first line of route data for Linux hosts and corrected the unit tests.

Tested the change on Ubuntu 20.04.5 LTS

Checklist

Before creating a PR, run through this checklist and mark each as complete.

  • I have read the CONTRIBUTING document
  • I have run make install-tools and have attached any dependency changes to this pull request
  • If applicable, I have added tests that prove my fix is effective or that my feature works
  • If applicable, I have checked that any relevant tests pass after adding my changes
  • If applicable, I have updated any relevant documentation (README.md)
  • If applicable, I have tested my cross-platform changes on Ubuntu 22, Redhat 8, SUSE 15 and FreeBSD 13

…nginx#317)

The parser was skipping over the first (header) line with the first
invocation of scanner.Scan().  The second invocation of scanner.Scan()
called in the for loop points to the first line of route data; however,
this line was being skipped.  The tests were incorrect because they
started with a newline before the header.
@netlify
Copy link

netlify bot commented May 18, 2023

Deploy Preview for agent-public-docs canceled.

Name Link
🔨 Latest commit 2ee0798
🔍 Latest deploy log https://app.netlify.com/sites/agent-public-docs/deploys/64667e50fc6d390007722597

@github-actions github-actions bot added the chore Pull requests for routine tasks label May 18, 2023
@richbrowne
Copy link
Contributor Author

@nkashiv @achawla2012 Could you review too and get this pushed through?

@achawla2012
Copy link
Contributor

@nkashiv @achawla2012 Could you review too and get this pushed through?

The default interface is the one that has 0 for both destination and mask. Therefore we will also have to check if mask is 0 as well. https://github.com/jackpal/gateway/blob/master/gateway_parsers.go#L69

@github-actions github-actions bot added dependencies documentation Improvements or additions to documentation labels May 18, 2023
@achawla2012
Copy link
Contributor

LGTM

@Dean-Coakley
Copy link
Contributor

Fixed in #331

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
chore Pull requests for routine tasks dependencies documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants