[SERVER-15656] Improve bind_ip handling of badly formatted Internet address numbers Created: 14/Oct/14  Updated: 16/Feb/18  Resolved: 16/Feb/18

Status: Closed
Project: Core Server
Component/s: Networking, Security, Usability
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: Hannes Magnusson Assignee: DO NOT USE - Backlog - Platform Team
Resolution: Duplicate Votes: 0
Labels: 28qa
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
duplicates SERVER-14927 Bad bind_ip should fail, not listen o... Closed
is duplicated by SERVER-15630 Empty net.bindIp listens to all inter... Closed
Related
is related to SERVER-14927 Bad bind_ip should fail, not listen o... Closed
is related to SERVER-15630 Empty net.bindIp listens to all inter... Closed
Participants:

 Description   

bind_ip supports more then standard ipv4 dotted notation, which makes is easy to mess things up.

--bind_ip 0 for example represents 0.0.0.0, which will listen to all available interfaces.

--bind_ip 3232235521 becomes 192.168.0.1
--bind_ip 192.168.0.256 becomes 192.168.1.0

the risk of supporting the decimal notation is when creating the config files, or passing the argument, a empty variable is in many cases treated as a 0 - so when you thought you were binding to a specific interface - and afterwards it does indeed listen to that interface - you actually are listening to all of them.

In addition providing an empty net.bindIp listens to all interfaces.



 Comments   
Comment by Hannes Magnusson [ 14/Oct/14 ]

Also note, explicitly binding to 0.0.0.0 gives the warning:

warning: bind_ip of 0.0.0.0 is unnecessary; listens on all ips by default

while bind_ip 0 does not, even though it also results in listening on all ips

Generated at Thu Feb 08 03:38:36 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.