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

Proxy protocol #281

Merged
merged 39 commits into from
Oct 3, 2023
Merged

Proxy protocol #281

merged 39 commits into from
Oct 3, 2023

Conversation

wcawijngaards
Copy link
Member

@wcawijngaards wcawijngaards commented May 23, 2023

This is an implementation of PROXYv2 for NSD.

It can be configured with proxy-protocol-port: <portnum> with the port number of the interface on which proxy traffic is handled. The interface can support proxy traffic for UDP, TCP and TLS.

It uses code from Unbound, that implements the proxy protocol specs, in NLnetLabs/unbound#881 .

…address.

  Fix for printout of refusal in log.
@wcawijngaards wcawijngaards self-assigned this May 23, 2023
Copy link
Contributor

@k0ekk0ek k0ekk0ek left a comment

Choose a reason for hiding this comment

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

Some small remarks about things that stood out. Nothing blocking.

server.c Outdated Show resolved Hide resolved
server.c Show resolved Hide resolved
server.c Outdated Show resolved Hide resolved
options.c Show resolved Hide resolved
util/proxy_protocol.c Outdated Show resolved Hide resolved
util/proxy_protocol.c Outdated Show resolved Hide resolved
util/proxy_protocol.h Show resolved Hide resolved
server.c Outdated Show resolved Hide resolved
@pettai
Copy link

pettai commented Sep 19, 2023

Hi,
Any update on when this is going to be merged into the main branch?

@k0ekk0ek
Copy link
Contributor

Hi @pettai, it's waiting for one more review to complete. Expect this to be merged soon.

@pettai
Copy link

pettai commented Sep 22, 2023

I noted an issue #297 then merging this branch to the latest git version of NSD, so apart from the review, this also needs to be fixed before merging. Thx

…r_remaining(data->query->packet) > 0' failed.
@wcawijngaards
Copy link
Member Author

The commit dfcdadb fixes the issue. The buffer was not reset properly between queries, the commit fixes that.

Copy link
Member

@gthess gthess left a comment

Choose a reason for hiding this comment

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

The PR looks nice!
Just replied on @k0ekk0ek 's suggestions.

util/proxy_protocol.c Outdated Show resolved Hide resolved
util/proxy_protocol.h Show resolved Hide resolved
util/proxy_protocol.c Outdated Show resolved Hide resolved
gthess and others added 2 commits September 29, 2023 15:03
- more generic switch statement for address families;
- comment the protocol values as such in their definitions;
- less hardcoded values for address family and protocol combinations.
@wcawijngaards wcawijngaards merged commit 7a3a604 into master Oct 3, 2023
4 checks passed
wcawijngaards added a commit that referenced this pull request Oct 3, 2023
- Merge #281: Proxy protocol. An implementation of PROXYv2 for NSD.
  It can be configured with proxy-protocol-port: portnum with the
  port number of the interface on which proxy traffic is handled.
  The interface can support proxy traffic for UDP, TCP and TLS.
@pettai
Copy link

pettai commented Oct 3, 2023

So it has been done 🎉

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

Successfully merging this pull request may close these issues.

5 participants