Project

General

Profile

Actions

Bug #38457

open

common/msg: sockaddr on FreeBSD differs from Linux, has sa_len

Added by Willem Jan Withagen about 5 years ago. Updated almost 4 years ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
-
Target version:
% Done:

0%

Source:
Community (dev)
Tags:
Backport:
nautilus,mimic,luminous
Regression:
No
Severity:
3 - minor
Reviewed:
Affected Versions:
ceph-qa-suite:
Pull request ID:
Crash signature (v1):
Crash signature (v2):

Description

On Linux the definition of a sockaddr is:
```
struct sockaddr {
sa_family_t sa_family;
char sa_data14;
}
```
And on FreeBSD ik looks like:
```
struct sockaddr {
unsigned char sa_len; /* total length /
sa_family_t sa_family; /
address family /
char sa_data14; /
actually longer; address value */
};
```

We need to do 2 things:
- maintain the sa_len value for FreeBSD, otherwise memcmp() calls
can return unequal, where the only difference would be `sa_len`.
sa_len is set on returns from the FreeBSD syscalls.
- Look into comparing structures whch have sockaddr as members.

Testing with `ceph_test_msgr` will show all poll tests failing.
Most of the time the script wil just loop endlessly.

Future work could be to actually rework the comparission routines in
msg_types.h to make full use of the structure. But for now it looks
like it not needed.

Actions #1

Updated by Willem Jan Withagen about 5 years ago

Needs to be backported to
Mimic
Luminous

Actions #2

Updated by Yuri Weinstein about 5 years ago

  • Project changed from Stable releases to Ceph
Actions #3

Updated by Nathan Cutler about 5 years ago

  • Tracker changed from Tasks to Bug
  • Regression set to No
  • Severity set to 3 - minor

Willem Jan Withagen wrote:

Needs to be backported to
Mimic
Luminous

@Willem: There was no "Backport" field because you opened this in the wrong tracker. "Stable Releases" is, arguably, misleadingly named. You are not the first to open a bug there.

Actions #4

Updated by Nathan Cutler about 5 years ago

  • Backport set to mimic, luminous
Actions #5

Updated by Patrick Donnelly about 5 years ago

  • Project changed from Ceph to Messengers
  • Target version set to v15.0.0
  • Start date deleted (02/23/2019)
  • Source set to Community (dev)
  • Backport changed from mimic, luminous to nautilus,mimic,luminous
Actions #6

Updated by Willem Jan Withagen almost 4 years ago

This bug also causes errors in test_compression.cc.
Where the JSON output diff of the OSDMap structure between Linux and BSD

Results in:

*** 314,320 ****
              "addrvec": [
                  {
                      "type": "v1",
!                     "addr": "(unrecognized address family \u0000)",
                      "nonce": 1972920
                  }
              ]
--- 314,320 ----
              "addrvec": [
                  {
                      "type": "v1",
!                     "addr": "128.142.161.208:6827",
                      "nonce": 1972920
                  }
              ]
***************

Actions

Also available in: Atom PDF