Skip to content

Prevent Steam Networking IPs being added to DB & being parsed by SourceSleuth - #1600

Merged
rumblefrog merged 6 commits into
sbpp:mainfrom
aarmastah:main
Oct 25, 2026
Merged

rumblefrog merged 6 commits into
sbpp:mainfrom
aarmastah:main

Conversation

@aarmastah

Copy link
Copy Markdown
Contributor

Description

Steam Networking / SDR IP addresses always use 169.254.x.x, which causes problems for a plugin like this. When every player uses the same IP range, SourceSleuth becomes ineffective and there's no point in storing these IPs in the first place, so I disable the IP check on this internal address range and disable storing it as well. This prevents existing IPs causing trouble as well as needlessly storing new ones.

Motivation and Context

This change fixes innocent players being banned from SDR-enabled servers that use SourceBans++ and do not know to turn off SourceSleuth (don't ask me how I know -- (the answer is experience)).

How Has This Been Tested?

I tested this by compiling my plugin changes, running a dedicated TF2 server on Windows with -enablefakeip, connecting to said server in TF2 via SDR, banning my alt account, and seeing it populate on my SB++ instance with no IP listed, exactly as expected.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.

@aarmastah
aarmastah requested a review from a team October 23, 2026 22:02
* SDR / Steam Networking clients connect with a link-local 169.254.x.x address
* rather than their real IP. This can get legitimate players banned, so skip it.
*/
stock bool IsSteamNetworkingIP(const char[] ip)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Can you link official docs on this?

Also can be moved to an include since it's shared across plugins

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I can't find any official documentation that specifically states an IP assignment of "169.254.x.x" when using SDR in Source SDK 2013 games, but I did find direct reference to it in the source code:

https://github.com/ValveSoftware/source-sdk-2013/blob/be57e3d01ac7d7aa6a2cacbfef187c0b46616db0/src/public/steam/isteamnetworkingsockets.h#L812-L820

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Got it, can you add this to the stock's comments.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Technically, the comment also says "this is subject to change! Do not make assumptions about these addresses. or your code might break in the future." It points out that you could use "ISteamNetworkingUtils::IsFakeIP to determine if an IP address is a "fake" one used by this system," but I wouldn't have direct access to this without writing a new extension that SB++ would now have to rely on.

Given it's been several years without any change in the IP format, I highly doubt it's going to change any time soon. I think the current method is okay. Do you have any opinions?

@aarmastah
aarmastah requested a review from rumblefrog October 23, 2026 22:44
@aarmastah

Copy link
Copy Markdown
Contributor Author

I've added the comment from the Source 2013 SDK as requested. Please note my comment from earlier:

Technically, the comment also says "this is subject to change! Do not make assumptions about these addresses. or your code might break in the future." It points out that you could use "ISteamNetworkingUtils::IsFakeIP to determine if an IP address is a "fake" one used by this system," but I wouldn't have direct access to this without writing a new extension that SB++ would now have to rely on.

Given it's been several years without any change in the IP format, I highly doubt it's going to change any time soon. I think the current method is okay. Do you have any opinions?

Adding to this: the IP format has remained the same since TF2's SDR implementation back in ~2021.

Added a reference link to the Steam Networking Sockets documentation.

@rumblefrog rumblefrog left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

couple things outside the diff:

  • sbpp_checker.sp still uses raw GetClientIP (L191 count query, L284 sm_listbans), so SDR players still get matched against every 169.254 IP ban there
  • existing 169.254.x.x values already in the DB (bans.ip, comms.adminIp, submissions, etc) stick around. probably want a cleanup migration to null those out
  • since this changes plugin behavior self-hosters will see (sm_banip refusing SDR targets, sleuth skipping them), can you add a note to docs/src/content/docs/setup/plugin-setup.md

range check is fine by me btw, don't think it's worth pulling in an extension for IsFakeIP


Generated by Claude Code

Comment thread game/addons/sourcemod/scripting/include/sbpp_server_ip.inc Outdated
Comment thread game/addons/sourcemod/scripting/include/sbpp_server_ip.inc Outdated
Comment thread game/addons/sourcemod/scripting/sbpp_main.sp
Comment thread game/addons/sourcemod/scripting/sbpp_main.sp Outdated
Comment thread game/addons/sourcemod/scripting/sbpp_main.sp
@github-actions

github-actions Bot commented Oct 25, 2026 •

Copy link
Copy Markdown

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@aarmastah

Copy link
Copy Markdown
Contributor Author

I have read the CLA Document and I hereby sign the CLA

github-actions Bot added a commit that referenced this pull request Oct 25, 2026
rumblefrog

This comment was marked as outdated.

Added logic to update placeholder IPs in in-game reports, setting `ip` to an empty string and `sip` to NULL for specific conditions.
@rumblefrog
rumblefrog added this pull request to the merge queue Oct 25, 2026
Merged via the queue into sbpp:main with commit 53d351a Oct 25, 2026
9 checks passed
@github-actions github-actions Bot locked and limited conversation to collaborators Oct 25, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants