Skip to content
Snippets Groups Projects

Enable obtaining source IP address if HAproxy is used

Merged Deon George requested to merge leenooks/sbbs:master into master

Hey Rob, I use SBBS in a docker container, but if I choose to deploy it in a swarm - because of docker NAT, all src IP addresses are from the docker host. (Which affects DNS resolution and an IP source address logic - like current connections, ip blocking etc.

To get around this, I wanted to put SBBS behind HAproxy, and leverage HAproxys "Proxy Protocol" which supplies the source address (and some other info) in the first TCP frame.

There may be a use case where folks want to put HAproxy in front SBBS to enable another layout of IP rule processing.

This patch parses that first frame to pluck the source IP address out and use it. (Please forgive my C++ coding - its not a language I code in - so if you see a better way of doing things, please make those changes - I'll learn something new if you do.)

...deon

Edited by Deon George

Merge request reports

Merge request pipeline #755 passed

Merge request pipeline passed for ee0e526c

Merged by Rob SwindellRob Swindell 4 years ago (Nov 22, 2020 8:35am UTC)

Loading

Pipeline #757 passed

Pipeline passed for e562d227 on master

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • Rob Swindell
  • Rob Swindell
  • Rob Swindell
  • Rob Swindell
  • Rob Swindell
  • Rob Swindell
  • Rob Swindell
  • Rob Swindell
  • Rob Swindell
  • Rob Swindell
  • mentioned in commit leenooks/sbbs@ae214830

  • mentioned in commit leenooks/sbbs@c6cba226

  • Deon George added 2 commits

    added 2 commits

    • ae214830 - Revert changes, not actually used. sbbs/sbbs!11
    • c6cba226 - Changes to recv() so that it is no longer blocking.

    Compare with previous version

  • Author Developer

    Thanks for the feedback Rob - I've made some changes - how does it look now?

  • mentioned in commit leenooks/sbbs@e7dc5145

  • Deon George added 1 commit

    added 1 commit

    • e7dc5145 - Debug logging should really be LOG_DEBUG and errors should really be LOG_ERR....

    Compare with previous version

  • mentioned in commit leenooks/sbbs@d92b6b68

  • Deon George added 1 commit

    added 1 commit

    • d92b6b68 - Increase hapstr to 128, and define macros for haproxy binary connections.

    Compare with previous version

  • Deon George resolved all threads

    resolved all threads

  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Please register or sign in to reply
    Loading