[SERVER-32017] SockAddr incorrect sort order for IPv4 Created: 17/Nov/17 Updated: 30/Oct/23 Resolved: 20/Nov/17 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Networking |
| Affects Version/s: | None |
| Fix Version/s: | 3.7.1 |
| Type: | Improvement | Priority: | Minor - P4 |
| Reporter: | Billy Donahue | Assignee: | Billy Donahue |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Backwards Compatibility: | Fully Compatible |
| Participants: |
| Description |
|
SockAddr::operator<(SockAddr) treats AF_INET SockAddr objects incorrectly and nonportably. AF_INET6 addresses have no integer equivalent are are correctly compared with network-order memcmp, MSB-first. So currently on LE machines, we have IPv4 sorted LSB-first, and IPv6 sorted MSB-first. I'm not aware of any production impact of this, but that's not saying much as I've been here a month. |
| Comments |
| Comment by Githook User [ 20/Nov/17 ] |
|
Author: {'name': 'Billy Donahue', 'username': 'BillyDonahue', 'email': 'billy.donahue@mongodb.com'}Message: |
| Comment by Billy Donahue [ 17/Nov/17 ] |
|
Nobody calls this operator< anymore. Neither removing it nor =delete'ing it cause any build failure. |
| Comment by Billy Donahue [ 17/Nov/17 ] |
|
The operator was introduced at hash ab654fb9eda000661cde7f3273dac59fcd47caf8 EndPoint `operator<` depends on the order of its member SockAddr. |