Project

General

Profile

Actions

Bug #81504

open
DV DV

msg: IPv6 addresses from FreeBSD and macOS daemons are encoded with a non-Linux AF_INET6

Bug #81504: msg: IPv6 addresses from FreeBSD and macOS daemons are encoded with a non-Linux AF_INET6

Added by Dan van der Ster about 2 months ago. Updated about 2 months ago.

Status:
Fix Under Review
Priority:
Normal
Category:
-
Target version:
-
Due date:
% Done:

0%

Source:
Backport:
Regression:
No
Severity:
3 - minor
Reviewed:
Affected Versions:
ceph-qa-suite:
Pull request ID:
Tags (freeform):
Merge Commit:
Fixed In:
Released In:
Upkeep Timestamp:

Description

`entity_addr_t` (msgr2) and the legacy `sockaddr_storage` encoding carry the address family as a number, and readers assume Linux's values. AF_INET is 2 everywhere, but AF_INET6 is 10 on Linux, 23 on Windows, 28 on FreeBSD and 30 on macOS.

`encode()`/`decode()` in `src/msg/msg_types.h` map AF_INET6 to and from `AF_INET6_LINUX` (10) only under `_WIN32`. So an IPv6 address from a FreeBSD or macOS daemon reaches a Linux peer as family 28 or 30, which it doesn't recognise, and a Linux peer's IPv6 address arrives on FreeBSD/macOS as family 10.

Found while reviewing https://github.com/ceph/ceph/pull/71445 (which fixes the rest of the BSD/macOS address encoding). Most BSD/macOS testing so far has been IPv4-only.

Fix: define `AF_INET6_LINUX` on every platform and map in both encodings (a no-op on Linux).

DV Updated by Dan van der Ster about 2 months ago Actions #1

  • Status changed from New to Fix Under Review
  • Pull request ID set to 72446
Actions

Also available in: PDF Atom