lists.osmocom.org
Sign In Sign Up
Manage this list Sign In Sign Up

Keyboard Shortcuts

Thread View

  • j: Next unread message
  • k: Previous unread message
  • j a: Jump to all threads
  • j l: Jump to MailingList overview

gerrit-log

Thread Start a new thread
Download
Threads by month
  • ----- 2026 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2025 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2024 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2023 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2022 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
gerrit-log@lists.osmocom.org

August 2023

  • 1 participants
  • 1514 discussions
[S] Change in libosmo-netif[master]: stream_srv: Increase logging level of SCTP MSG_NOTIFICATION lines
by pespin 04 Aug '23

04 Aug '23
pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmo-netif/+/34081 ) Change subject: stream_srv: Increase logging level of SCTP MSG_NOTIFICATION lines ...................................................................... stream_srv: Increase logging level of SCTP MSG_NOTIFICATION lines Those are events affecting the state of the link, so it makes sense to have a higher level than debug. Change-Id: I0ed84cc2effb71b6ef1f6efb3f8b663c602a5a31 --- M src/stream_srv.c 1 file changed, 22 insertions(+), 10 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-netif refs/changes/81/34081/1 diff --git a/src/stream_srv.c b/src/stream_srv.c index 554596d..c1d3739 100644 --- a/src/stream_srv.c +++ b/src/stream_srv.c @@ -845,33 +845,33 @@ msgb_sctp_stream(msg) = sinfo.sinfo_stream; if (flags & MSG_NOTIFICATION) { union sctp_notification *notif = (union sctp_notification *)data; - LOGP(DLINP, LOGL_DEBUG, "NOTIFICATION %u flags=0x%x\n", notif->sn_header.sn_type, notif->sn_header.sn_flags); + LOGP(DLINP, LOGL_INFO, "NOTIFICATION %u flags=0x%x\n", notif->sn_header.sn_type, notif->sn_header.sn_flags); msgb_put(msg, sizeof(union sctp_notification)); msgb_sctp_msg_flags(msg) = OSMO_STREAM_SCTP_MSG_FLAGS_NOTIFICATION; switch (notif->sn_header.sn_type) { case SCTP_ASSOC_CHANGE: - LOGP(DLINP, LOGL_DEBUG, "===> ASSOC CHANGE:"); + LOGP(DLINP, LOGL_INFO, "===> ASSOC CHANGE:"); switch (notif->sn_assoc_change.sac_state) { case SCTP_COMM_UP: - LOGPC(DLINP, LOGL_DEBUG, " UP\n"); + LOGPC(DLINP, LOGL_INFO, " UP\n"); break; case SCTP_COMM_LOST: - LOGPC(DLINP, LOGL_DEBUG, " LOST\n"); + LOGPC(DLINP, LOGL_INFO, " LOST\n"); /* Handle this like a regular disconnect */ return 0; case SCTP_RESTART: - LOGPC(DLINP, LOGL_DEBUG, " RESTART\n"); + LOGPC(DLINP, LOGL_INFO, " RESTART\n"); break; case SCTP_SHUTDOWN_COMP: - LOGPC(DLINP, LOGL_DEBUG, " SHUTDOWN COMP\n"); + LOGPC(DLINP, LOGL_INFO, " SHUTDOWN COMP\n"); break; case SCTP_CANT_STR_ASSOC: - LOGPC(DLINP, LOGL_DEBUG, " CANT STR ASSOC\n"); + LOGPC(DLINP, LOGL_INFO, " CANT STR ASSOC\n"); break; } break; case SCTP_SEND_FAILED: - LOGP(DLINP, LOGL_DEBUG, "===> SEND FAILED\n"); + LOGP(DLINP, LOGL_INFO, "===> SEND FAILED\n"); break; case SCTP_PEER_ADDR_CHANGE: { @@ -879,14 +879,14 @@ struct sockaddr_storage sa = notif->sn_paddr_change.spc_aaddr; osmo_sockaddr_to_str_buf(addr_str, sizeof(addr_str), (const struct osmo_sockaddr *)&sa); - LOGP(DLINP, LOGL_DEBUG, "===> PEER ADDR CHANGE: %s %s err=%s\n", + LOGP(DLINP, LOGL_INFO, "===> PEER ADDR CHANGE: %s %s err=%s\n", addr_str, osmo_sctp_paddr_chg_str(notif->sn_paddr_change.spc_state), (notif->sn_paddr_change.spc_state == SCTP_ADDR_UNREACHABLE) ? osmo_sctp_sn_error_str(notif->sn_paddr_change.spc_error) : "None"); } break; case SCTP_SHUTDOWN_EVENT: - LOGP(DLINP, LOGL_DEBUG, "===> SHUTDOWN EVT\n"); + LOGP(DLINP, LOGL_INFO, "===> SHUTDOWN EVT\n"); /* RFC6458 3.1.4: Any attempt to send more data will cause sendmsg() * to return with an ESHUTDOWN error. */ break; -- To view, visit https://gerrit.osmocom.org/c/libosmo-netif/+/34081 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmo-netif Gerrit-Branch: master Gerrit-Change-Id: I0ed84cc2effb71b6ef1f6efb3f8b663c602a5a31 Gerrit-Change-Number: 34081 Gerrit-PatchSet: 1 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: newchange
1 0
0 0
[M] Change in docker-playground[master]: ttcn3: use debian-bookworm-titan
by laforge 04 Aug '23

04 Aug '23
Attention is currently required from: osmith. laforge has posted comments on this change. ( https://gerrit.osmocom.org/c/docker-playground/+/34049 ) Change subject: ttcn3: use debian-bookworm-titan ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/c/docker-playground/+/34049 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: docker-playground Gerrit-Branch: master Gerrit-Change-Id: I2017dd3888670c475b96e692d911a433484f3df9 Gerrit-Change-Number: 34049 Gerrit-PatchSet: 1 Gerrit-Owner: osmith <osmith(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-Attention: osmith <osmith(a)sysmocom.de> Gerrit-Comment-Date: Fri, 04 Aug 2023 16:09:48 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
1 0
0 0
[M] Change in docker-playground[master]: debian-bookworm-titan{,-master}: new containers
by laforge 04 Aug '23

04 Aug '23
Attention is currently required from: osmith, daniel. laforge has posted comments on this change. ( https://gerrit.osmocom.org/c/docker-playground/+/34048 ) Change subject: debian-bookworm-titan{,-master}: new containers ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/c/docker-playground/+/34048 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: docker-playground Gerrit-Branch: master Gerrit-Change-Id: I4415fcde6518bd26d1e2cb5785ddaf84ac2116b3 Gerrit-Change-Number: 34048 Gerrit-PatchSet: 1 Gerrit-Owner: osmith <osmith(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: daniel <dwillmann(a)sysmocom.de> Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-Attention: osmith <osmith(a)sysmocom.de> Gerrit-Attention: daniel <dwillmann(a)sysmocom.de> Gerrit-Comment-Date: Fri, 04 Aug 2023 16:09:35 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
1 0
0 0
[S] Change in osmo-ttcn3-hacks[master]: SGSN_Tests: add missing RIM ROUTING ADDRESS field in request
by pespin 04 Aug '23

04 Aug '23
Attention is currently required from: dexter. pespin has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/34077 ) Change subject: SGSN_Tests: add missing RIM ROUTING ADDRESS field in request ...................................................................... Patch Set 1: (1 comment) Commit Message: https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/34077/comment/f8d88b69_bbab… PS1, Line 13: AFAIU the spec you are mentioning clearly states the opposite: Those are OPTIONAL. It even says: """ If RIM Routing Address Discriminator IE is not included, the RIM Routing Address shall be processed as an RNC identifier, or as if "RIM Routing Address discriminator = 0001". """ -- To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/34077 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Change-Id: Id944c66f28d787a18c6c6f7c9dc885997d83e94c Gerrit-Change-Number: 34077 Gerrit-PatchSet: 1 Gerrit-Owner: dexter <pmaier(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-CC: pespin <pespin(a)sysmocom.de> Gerrit-Attention: dexter <pmaier(a)sysmocom.de> Gerrit-Comment-Date: Fri, 04 Aug 2023 15:53:24 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: No Gerrit-MessageType: comment
1 0
0 0
[S] Change in osmo-ttcn3-hacks[master]: GTP_Templates: add function to encode RIM_Routing_Address_GTPC
by pespin 04 Aug '23

04 Aug '23
Attention is currently required from: dexter. pespin has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/34076 ) Change subject: GTP_Templates: add function to encode RIM_Routing_Address_GTPC ...................................................................... Patch Set 1: Code-Review+1 (1 comment) Patchset: PS1: You could add a decode function while at it, I assume we'll also need it? -- To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/34076 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Change-Id: I45d1f5b019f3847fd611c38dc19d78d6fe027c5a Gerrit-Change-Number: 34076 Gerrit-PatchSet: 1 Gerrit-Owner: dexter <pmaier(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-Attention: dexter <pmaier(a)sysmocom.de> Gerrit-Comment-Date: Fri, 04 Aug 2023 15:51:08 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
1 0
0 0
[S] Change in osmo-ttcn3-hacks[master]: GTP_Templates: Add templates for RIM ROUTING ADDRESS
by pespin 04 Aug '23

04 Aug '23
Attention is currently required from: dexter. pespin has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/34075 ) Change subject: GTP_Templates: Add templates for RIM ROUTING ADDRESS ...................................................................... Patch Set 1: (2 comments) File library/GTP_Templates.ttcn: https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/34075/comment/92f33ccc_a0d6… PS1, Line 1443: template RIM_RoutingAddress tr_RIM_RoutingAddress(template octetstring addr_value := ?) := { template (present) https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/34075/comment/2e884205_7196… PS1, Line 1456: template RIM_RoutingAddress_Discriminator tr_RIM_RoutingAddress_Discriminator(template bitstring addr_discr := ?) := { template (present) -- To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/34075 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Change-Id: If79f94ac3b7ec9a76763141ee2d8cac50c69d60b Gerrit-Change-Number: 34075 Gerrit-PatchSet: 1 Gerrit-Owner: dexter <pmaier(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-CC: pespin <pespin(a)sysmocom.de> Gerrit-Attention: dexter <pmaier(a)sysmocom.de> Gerrit-Comment-Date: Fri, 04 Aug 2023 15:50:16 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: No Gerrit-MessageType: comment
1 0
0 0
[XL] Change in libosmo-netif[master]: stream: Split cli/srv specific code out of stream.c
by pespin 04 Aug '23

04 Aug '23
Attention is currently required from: laforge, fixeria, daniel. pespin has posted comments on this change. ( https://gerrit.osmocom.org/c/libosmo-netif/+/34057 ) Change subject: stream: Split cli/srv specific code out of stream.c ...................................................................... Patch Set 3: (1 comment) Patchset: PS3: > are we sure this re-factoring doesn't clash with ongoing osmo_io work? We should always avoid to do […] Most of the io work was already merged, at least the initial big commits, so I expect minimal crash now. In any case, I'm also doing a lot of ongoing work now in order to improve libosmo-sccp Primary Address on top of this commit. I think I already provided a big amount of time (lots of weeks, even months?) to get whatever work there merged. Furthermore, this split should also make it easier to submit new patches regarding io in the future. -- To view, visit https://gerrit.osmocom.org/c/libosmo-netif/+/34057 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmo-netif Gerrit-Branch: master Gerrit-Change-Id: I22af01bba2040eb320ba48fd1b46c090c98be159 Gerrit-Change-Number: 34057 Gerrit-PatchSet: 3 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: daniel <dwillmann(a)sysmocom.de> Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: osmith <osmith(a)sysmocom.de> Gerrit-CC: laforge <laforge(a)osmocom.org> Gerrit-Attention: laforge <laforge(a)osmocom.org> Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Attention: daniel <dwillmann(a)sysmocom.de> Gerrit-Comment-Date: Fri, 04 Aug 2023 15:48:35 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: No Comment-In-Reply-To: laforge <laforge(a)osmocom.org> Gerrit-MessageType: comment
1 0
0 0
[S] Change in libosmo-netif[master]: stream_srv: Handle ESHUTDOWN and other write() errors destroying the ...
by pespin 04 Aug '23

04 Aug '23
Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/c/libosmo-netif/+/34078 to look at the new patch set (#2). Change subject: stream_srv: Handle ESHUTDOWN and other write() errors destroying the socket ...................................................................... stream_srv: Handle ESHUTDOWN and other write() errors destroying the socket If internal send() fails with a fatal error, it should destroy the socket. The user will know about the event through the close_cb() called during osmo_stream_srv_destroy(). As a result, the socket is not closed when receiving SHUTDOWN by the peer (through SCTP MSG_NOTIFICATION), but keep it alive since the socket can still keep receiving data from the peer. Only fail if write() to that read-only socket is attempted. Related: OS#6134 Change-Id: I84ddebabdffe47733cb529bcfebec8757e6a172b --- M src/stream_srv.c 1 file changed, 34 insertions(+), 4 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-netif refs/changes/78/34078/2 -- To view, visit https://gerrit.osmocom.org/c/libosmo-netif/+/34078 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmo-netif Gerrit-Branch: master Gerrit-Change-Id: I84ddebabdffe47733cb529bcfebec8757e6a172b Gerrit-Change-Number: 34078 Gerrit-PatchSet: 2 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-MessageType: newpatchset
1 0
0 0
[S] Change in libosmo-netif[master]: stream_cli: Proper handling of send() socket errors
by pespin 04 Aug '23

04 Aug '23
pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmo-netif/+/34079 ) Change subject: stream_cli: Proper handling of send() socket errors ...................................................................... stream_cli: Proper handling of send() socket errors Upon EAGAIN, simply re-enqueue the message and return waiting for next poll. Upon any other error, force close + reconnect. Related: OS#6134 Change-Id: I462cb176ebc51f3e99ee796310e8665144c84ccc --- M src/stream_cli.c 1 file changed, 22 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-netif refs/changes/79/34079/1 diff --git a/src/stream_cli.c b/src/stream_cli.c index 0e075b8..e90b5e4 100644 --- a/src/stream_cli.c +++ b/src/stream_cli.c @@ -288,9 +288,15 @@ } if (ret < 0) { - if (errno == EPIPE || errno == ENOTCONN) - osmo_stream_cli_reconnect(cli); - LOGSCLI(cli, LOGL_ERROR, "received error %d in response to send\n", errno); + int err = errno; + LOGSCLI(cli, LOGL_ERROR, "error to send: %s\n", strerror(err)); + if (err == EAGAIN) { + /* Re-add at the start of the queue to re-attempt: */ + llist_add(&msg->list, &cli->tx_queue); + return 0; + } + msgb_free(msg); + osmo_stream_cli_reconnect(cli); } msgb_free(msg); -- To view, visit https://gerrit.osmocom.org/c/libosmo-netif/+/34079 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmo-netif Gerrit-Branch: master Gerrit-Change-Id: I462cb176ebc51f3e99ee796310e8665144c84ccc Gerrit-Change-Number: 34079 Gerrit-PatchSet: 1 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: newchange
1 0
0 0
[M] Change in libosmo-netif[master]: WIP: stream_cli: Forward SCTP MSG_NOTIFICATION to upper layers
by pespin 04 Aug '23

04 Aug '23
pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmo-netif/+/34080 ) Change subject: WIP: stream_cli: Forward SCTP MSG_NOTIFICATION to upper layers ...................................................................... WIP: stream_cli: Forward SCTP MSG_NOTIFICATION to upper layers Same mechanism as already used in strea_srv. Change-Id: I4cb94d264109f1b763cccd44c6ba049cc7509319 --- M src/stream_cli.c 1 file changed, 114 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-netif refs/changes/80/34080/1 diff --git a/src/stream_cli.c b/src/stream_cli.c index e90b5e4..cc63297 100644 --- a/src/stream_cli.c +++ b/src/stream_cli.c @@ -913,18 +913,119 @@ } } +#ifdef HAVE_LIBSCTP +static int _sctp_recvmsg_wrapper(int fd, struct msgb *msg) +{ + struct sctp_sndrcvinfo sinfo; + int flags = 0; + int ret; + uint8_t *data = msg->tail; + + ret = sctp_recvmsg(fd, data, msgb_tailroom(msg), + NULL, NULL, &sinfo, &flags); + msgb_sctp_msg_flags(msg) = 0; + msgb_sctp_ppid(msg) = ntohl(sinfo.sinfo_ppid); + msgb_sctp_stream(msg) = sinfo.sinfo_stream; + if (flags & MSG_NOTIFICATION) { + union sctp_notification *notif = (union sctp_notification *)data; + LOGP(DLINP, LOGL_INFO, "NOTIFICATION %u flags=0x%x\n", notif->sn_header.sn_type, notif->sn_header.sn_flags); + msgb_put(msg, sizeof(union sctp_notification)); + msgb_sctp_msg_flags(msg) = OSMO_STREAM_SCTP_MSG_FLAGS_NOTIFICATION; + switch (notif->sn_header.sn_type) { + case SCTP_ASSOC_CHANGE: + LOGP(DLINP, LOGL_INFO, "===> ASSOC CHANGE:"); + switch (notif->sn_assoc_change.sac_state) { + case SCTP_COMM_UP: + LOGPC(DLINP, LOGL_INFO, " UP\n"); + break; + case SCTP_COMM_LOST: + LOGPC(DLINP, LOGL_INFO, " LOST\n"); + /* Handle this like a regular disconnect */ + return 0; + case SCTP_RESTART: + LOGPC(DLINP, LOGL_INFO, " RESTART\n"); + break; + case SCTP_SHUTDOWN_COMP: + LOGPC(DLINP, LOGL_INFO, " SHUTDOWN COMP\n"); + break; + case SCTP_CANT_STR_ASSOC: + LOGPC(DLINP, LOGL_INFO, " CANT STR ASSOC\n"); + break; + } + break; + case SCTP_SEND_FAILED: + LOGP(DLINP, LOGL_INFO, "===> SEND FAILED\n"); + break; + case SCTP_PEER_ADDR_CHANGE: + { + char addr_str[INET6_ADDRSTRLEN + 10]; + struct sockaddr_storage sa = notif->sn_paddr_change.spc_aaddr; + osmo_sockaddr_to_str_buf(addr_str, sizeof(addr_str), + (const struct osmo_sockaddr *)&sa); + LOGP(DLINP, LOGL_INFO, "===> PEER ADDR CHANGE: %s %s err=%s\n", + addr_str, osmo_sctp_paddr_chg_str(notif->sn_paddr_change.spc_state), + (notif->sn_paddr_change.spc_state == SCTP_ADDR_UNREACHABLE) ? + osmo_sctp_sn_error_str(notif->sn_paddr_change.spc_error) : "None"); + } + break; + case SCTP_SHUTDOWN_EVENT: + LOGP(DLINP, LOGL_INFO, "===> SHUTDOWN EVT\n"); + /* Handle this like a regular disconnect */ + return 0; + } + return -EAGAIN; + } + return ret; +} +#endif + /*! \brief Receive data via an Osmocom stream client * \param[in] cli Stream Client through which we want to send * \param msg pre-allocate message buffer to which received data is appended - * \returns number of bytes read; <=0 in case of error */ + * \returns number of bytes read; <=0 in case of erro + * + * If conn is an SCTP connection, additional specific considerations shall be taken: + * - msg->cb is always filled with SCTP ppid, and SCTP stream values, see msgb_sctp_*() APIs. + * - If an SCTP notification was received when reading from the SCTP socket, + * msgb_sctp_msg_flags(msg) will contain bit flag + * OSMO_STREAM_SCTP_MSG_FLAGS_NOTIFICATION set, and the msgb will + * contain a "union sctp_notification" instead of user data. In this case the + * return code will be either 0 (if conn is considered dead after the + * notification) or -EAGAIN (if conn is considered still alive after the + * notification) resembling the standard recv() API. + */ int osmo_stream_cli_recv(struct osmo_stream_cli *cli, struct msgb *msg) { int ret; OSMO_ASSERT(cli); OSMO_ASSERT(msg); - ret = recv(cli->ofd.fd, msg->tail, msgb_tailroom(msg), 0); + switch (cli->sk_domain) { + case AF_UNIX: + ret = recv(cli->ofd.fd, msg->tail, msgb_tailroom(msg), 0); + break; + case AF_INET: + case AF_INET6: + case AF_UNSPEC: + switch (cli->proto) { +#ifdef HAVE_LIBSCTP + case IPPROTO_SCTP: + ret = _sctp_recvmsg_wrapper(cli->ofd.fd, msg); + break; +#endif + case IPPROTO_TCP: + default: + ret = recv(cli->ofd.fd, msg->tail, msgb_tailroom(msg), 0); + break; + } + break; + default: + ret = -ENOTSUP; + } + if (ret < 0) { + if (ret == -EAGAIN) + return ret; if (errno == EPIPE || errno == ECONNRESET) LOGSCLI(cli, LOGL_ERROR, "lost connection with srv\n"); osmo_stream_cli_reconnect(cli); -- To view, visit https://gerrit.osmocom.org/c/libosmo-netif/+/34080 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmo-netif Gerrit-Branch: master Gerrit-Change-Id: I4cb94d264109f1b763cccd44c6ba049cc7509319 Gerrit-Change-Number: 34080 Gerrit-PatchSet: 1 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: newchange
1 0
0 0
  • ← Newer
  • 1
  • ...
  • 134
  • 135
  • 136
  • 137
  • 138
  • 139
  • 140
  • ...
  • 152
  • Older →

HyperKitty Powered by HyperKitty version 1.3.12.