]> git.apps.os.sepia.ceph.com Git - ceph.git/commit
crimson/net: FixedCPUServerSocket::accept() respects the listening addr's type. 43674/head
authorRadoslaw Zarzynski <rzarzyns@redhat.com>
Tue, 26 Oct 2021 18:03:31 +0000 (18:03 +0000)
committerRadoslaw Zarzynski <rzarzyns@redhat.com>
Tue, 26 Oct 2021 19:44:12 +0000 (19:44 +0000)
commited8107e8d4f206069fe8cd7ce641ea68861b8976
tree84ea0d575b4eea62f7d79a629904c4b101cc4fef
parent8ca0012e47ee3a2092320b30b8ea10a896bb6561
crimson/net: FixedCPUServerSocket::accept() respects the listening addr's type.

For the sake of compliance with the classical OSD where the type
of the listening address is being reflected in the address type
of an accepted connection:

```
int PosixServerSocketImpl::accept(ConnectedSocket *sock, const SocketOptions &opt, entity_addr_t *out, Worker *w) {
  // ...
  sockaddr_storage ss;
  // ...
  int sd = accept_cloexec(_fd, (sockaddr*)&ss, &slen);
  if (sd < 0) {
    return -ceph_sock_errno();
  }

  // ...

  out->set_type(addr_type);
  out->set_sockaddr((sockaddr*)&ss);
  handler.set_priority(sd, opt.priority, out->get_family());
}
```

In Rook crimson binds explicitly to v2 address:

```
INFO  2021-10-26 17:55:08,116 [shard 0] osd - picked address v2:0.0.0.0:0/0
ERROR 2021-10-26 17:55:08,116 [shard 0] none - Falling back to public interface
INFO  2021-10-26 17:55:08,116 [shard 0] osd - picked address v2:0.0.0.0:0/0
```

Signed-off-by: Radoslaw Zarzynski <rzarzyns@redhat.com>
src/crimson/net/Socket.h