Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a48d4df5 authored by Abhishek Pandit-Subedi's avatar Abhishek Pandit-Subedi Committed by Automerger Merge Worker
Browse files

Merge "Floss: Use SOCK_STREAM for L2CAP socket" am: c63f8cec am: 74e931c9...

Merge "Floss: Use SOCK_STREAM for L2CAP socket" am: c63f8cec am: 74e931c9 am: 58e941c1 am: e7ae0ba3

Original change: https://android-review.googlesource.com/c/platform/packages/modules/Bluetooth/+/2532642



Change-Id: I8d40fb31460ba960f5c5a1fc33b3a440c63d4f45
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents f6fc5f42 e7ae0ba3
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -269,6 +269,7 @@ static l2cap_socket* btsock_l2cap_alloc_l(const char* name,
  unsigned security = 0;
  int fds[2];
  l2cap_socket* sock = (l2cap_socket*)osi_calloc(sizeof(*sock));
  int sock_type = SOCK_SEQPACKET;

  if (flags & BTSOCK_FLAG_ENCRYPT)
    security |= is_server ? BTM_SEC_IN_ENCRYPT : BTM_SEC_OUT_ENCRYPT;
@@ -279,7 +280,12 @@ static l2cap_socket* btsock_l2cap_alloc_l(const char* name,
  if (flags & BTSOCK_FLAG_AUTH_16_DIGIT)
    security |= BTM_SEC_IN_MIN_16_DIGIT_PIN;

  if (socketpair(AF_LOCAL, SOCK_SEQPACKET, 0, fds)) {
    // For Floss, set socket as SOCK_STREAM
    // TODO(b:271828292): Set SOCK_STREAM for everyone after verification tests
#if TARGET_FLOSS
  sock_type = SOCK_STREAM;
#endif
  if (socketpair(AF_LOCAL, sock_type, 0, fds)) {
    LOG_ERROR("socketpair failed:%s", strerror(errno));
    goto fail_sockpair;
  }