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

Also available in: Atom PDF