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 osmocom-bb[master]: l1ctl_proto: add 'start_fn' field to UL/DL TBF CFG.req messages
by pespin 20 Aug '23

20 Aug '23
Attention is currently required from: laforge, fixeria. pespin has posted comments on this change. ( https://gerrit.osmocom.org/c/osmocom-bb/+/33222 ) Change subject: l1ctl_proto: add 'start_fn' field to UL/DL TBF CFG.req messages ...................................................................... Patch Set 4: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/c/osmocom-bb/+/33222 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Change-Id: Ibb6a05165fe1c81268fb0e3674adae4065e78171 Gerrit-Change-Number: 33222 Gerrit-PatchSet: 4 Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: osmith <osmith(a)sysmocom.de> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-Attention: laforge <laforge(a)osmocom.org> Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Comment-Date: Sun, 20 Aug 2023 14:37:40 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
1 0
0 0
[S] Change in libosmo-netif[master]: sctp: Document relevant RFC specs
by pespin 20 Aug '23

20 Aug '23
pespin has submitted this change. ( https://gerrit.osmocom.org/c/libosmo-netif/+/34082 ) ( 3 is the latest approved patch-set. No files were changed between the latest approved patch-set and the submitted one. )Change subject: sctp: Document relevant RFC specs ...................................................................... sctp: Document relevant RFC specs Change-Id: Iae325b787fdb7fc95aa6922975a7e1fcf368527a --- M include/osmocom/netif/sctp.h 1 file changed, 15 insertions(+), 0 deletions(-) Approvals: laforge: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/osmocom/netif/sctp.h b/include/osmocom/netif/sctp.h index 0b64824..f0c52cf 100644 --- a/include/osmocom/netif/sctp.h +++ b/include/osmocom/netif/sctp.h @@ -2,6 +2,12 @@ #include <osmocom/core/utils.h> +/* Relevant SCTP RFCs: + * rfc9260 (obsoletes rfc4960): SCTP protocol + * rfc5061: SCTP Dynamic Address Reconfiguration + * rfc6458: SCTP Sockets API Extensions + */ + enum sctp_sac_state; extern const struct value_string osmo_sctp_assoc_chg_strs[]; static inline const char *osmo_sctp_assoc_chg_str(enum sctp_sac_state val) -- To view, visit https://gerrit.osmocom.org/c/libosmo-netif/+/34082 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmo-netif Gerrit-Branch: master Gerrit-Change-Id: Iae325b787fdb7fc95aa6922975a7e1fcf368527a Gerrit-Change-Number: 34082 Gerrit-PatchSet: 5 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: merged
1 0
0 0
[S] Change in libosmo-netif[master]: stream_srv: sctp: Log error cause of COMM_LOST event
by pespin 20 Aug '23

20 Aug '23
pespin has submitted this change. ( https://gerrit.osmocom.org/c/libosmo-netif/+/34083 ) Change subject: stream_srv: sctp: Log error cause of COMM_LOST event ...................................................................... stream_srv: sctp: Log error cause of COMM_LOST event RFC 6458 6.1.1: """ sac_error: If the state was reached due to an error condition (e.g., SCTP_COMM_LOST), any relevant error information is available in this field. This corresponds to the protocol error codes defined in [RFC4960]. """ Change-Id: Ie48360d22ce1e35eefb1a305dde106948dfa80e8 --- M src/stream_srv.c 1 file changed, 18 insertions(+), 1 deletion(-) Approvals: Jenkins Builder: Verified laforge: Looks good to me, but someone else must approve osmith: Looks good to me, but someone else must approve pespin: Looks good to me, approved diff --git a/src/stream_srv.c b/src/stream_srv.c index cccb811..6c50a69 100644 --- a/src/stream_srv.c +++ b/src/stream_srv.c @@ -856,7 +856,8 @@ LOGPC(DLINP, LOGL_DEBUG, " UP\n"); break; case SCTP_COMM_LOST: - LOGPC(DLINP, LOGL_DEBUG, " LOST\n"); + LOGPC(DLINP, LOGL_DEBUG, " COMM_LOST (err: %s)\n", + osmo_sctp_sn_error_str(notif->sn_assoc_change.sac_error)); /* Handle this like a regular disconnect */ return 0; case SCTP_RESTART: -- To view, visit https://gerrit.osmocom.org/c/libosmo-netif/+/34083 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmo-netif Gerrit-Branch: master Gerrit-Change-Id: Ie48360d22ce1e35eefb1a305dde106948dfa80e8 Gerrit-Change-Number: 34083 Gerrit-PatchSet: 4 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: osmith <osmith(a)sysmocom.de> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: merged
1 0
0 0
[M] Change in libosmo-netif[master]: stream_srv: Log SCTP REMOTE_ERROR events
by pespin 20 Aug '23

20 Aug '23
pespin has submitted this change. ( https://gerrit.osmocom.org/c/libosmo-netif/+/34084 ) Change subject: stream_srv: Log SCTP REMOTE_ERROR events ...................................................................... stream_srv: Log SCTP REMOTE_ERROR events The event was enabled but was not being logged. Change-Id: I49f5a648fd474e320101424fb6873a37442339bf --- M include/osmocom/netif/sctp.h M src/sctp.c M src/stream_srv.c 3 files changed, 54 insertions(+), 0 deletions(-) Approvals: Jenkins Builder: Verified laforge: Looks good to me, but someone else must approve osmith: Looks good to me, but someone else must approve pespin: Looks good to me, approved diff --git a/include/osmocom/netif/sctp.h b/include/osmocom/netif/sctp.h index f0c52cf..bb8acda 100644 --- a/include/osmocom/netif/sctp.h +++ b/include/osmocom/netif/sctp.h @@ -27,3 +27,24 @@ extern const struct value_string osmo_sctp_sn_error_strs[]; static inline const char *osmo_sctp_sn_error_str(enum sctp_sn_error val) { return get_value_string(osmo_sctp_sn_error_strs, val); } + +enum osmo_sctp_op_error { + OSMO_SCTP_OP_ERR_INVALID_STREAM_ID = 1, + OSMO_SCTP_OP_ERR_MISS_MAND_PARAM = 2, + OSMO_SCTP_OP_ERR_STALE_COOKIE = 3, + OSMO_SCTP_OP_ERR_NO_RESOURCES = 4, + OSMO_SCTP_OP_ERR_UNRESOLV_ADDR = 5, + OSMO_SCTP_OP_ERR_UNKN_CHUNK_TYPE = 6, + OSMO_SCTP_OP_ERR_INVALID_MAND_PARAM = 7, + OSMO_SCTP_OP_ERR_UNKN_PARAM = 8, + OSMO_SCTP_OP_ERR_NO_USER_DATA = 9, + OSMO_SCTP_OP_ERR_COOKIE_RX_WHILE_SHUTDOWN = 10, + OSMO_SCTP_OP_ERR_RESTART_ASSC_NEW_ADDR = 11, + OSMO_SCTP_OP_ERR_UNER_INITED_ABORT = 12, + OSMO_SCTP_OP_ERR_PROTO_VERSION = 13, +}; + + +extern const struct value_string osmo_sctp_op_error_strs[]; +static inline const char *osmo_sctp_op_error_str(enum osmo_sctp_op_error val) +{ return get_value_string(osmo_sctp_op_error_strs, val); } diff --git a/src/sctp.c b/src/sctp.c index c1b57db..7f4f54b 100644 --- a/src/sctp.c +++ b/src/sctp.c @@ -51,3 +51,21 @@ { SCTP_PEER_FAULTY, "PEER_FAULTY" }, { 0, NULL } }; + +/* rfc4960 section 3.3.10 "Operation Error", in host byte order */ +const struct value_string osmo_sctp_op_error_strs[] = { + { OSMO_SCTP_OP_ERR_INVALID_STREAM_ID, "Invalid Stream Identifier" }, + { OSMO_SCTP_OP_ERR_MISS_MAND_PARAM, "Missing Mandatory Parameter" }, + { OSMO_SCTP_OP_ERR_STALE_COOKIE, "Stale Cookie Error" }, + { OSMO_SCTP_OP_ERR_NO_RESOURCES, "Out of Resource" }, + { OSMO_SCTP_OP_ERR_UNRESOLV_ADDR, "Unresolvable Address" }, + { OSMO_SCTP_OP_ERR_UNKN_CHUNK_TYPE, "Unrecognized Chunk Type" }, + { OSMO_SCTP_OP_ERR_INVALID_MAND_PARAM, "Invalid Mandatory Parameter" }, + { OSMO_SCTP_OP_ERR_UNKN_PARAM, "Unrecognized Parameters" }, + { OSMO_SCTP_OP_ERR_NO_USER_DATA, "No User Data" }, + { OSMO_SCTP_OP_ERR_COOKIE_RX_WHILE_SHUTDOWN, "Cookie Received While Shutting Down" }, + { OSMO_SCTP_OP_ERR_RESTART_ASSC_NEW_ADDR, "Restart of an Association with New Addresses" }, + { OSMO_SCTP_OP_ERR_UNER_INITED_ABORT, "User Initiated Abort" }, + { OSMO_SCTP_OP_ERR_PROTO_VERSION, "Protocol Violation" }, + { 0, NULL } +}; diff --git a/src/stream_srv.c b/src/stream_srv.c index 6c50a69..3625ffd 100644 --- a/src/stream_srv.c +++ b/src/stream_srv.c @@ -891,6 +891,10 @@ /* RFC6458 3.1.4: Any attempt to send more data will cause sendmsg() * to return with an ESHUTDOWN error. */ break; + case SCTP_REMOTE_ERROR: + LOGP(DLINP, LOGL_DEBUG, "===> REMOTE ERROR: %s\n", + osmo_sctp_op_error_str(ntohs(notif->sn_remote_error.sre_error))); + break; } return -EAGAIN; } -- To view, visit https://gerrit.osmocom.org/c/libosmo-netif/+/34084 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmo-netif Gerrit-Branch: master Gerrit-Change-Id: I49f5a648fd474e320101424fb6873a37442339bf Gerrit-Change-Number: 34084 Gerrit-PatchSet: 4 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: osmith <osmith(a)sysmocom.de> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: merged
1 0
0 0
[S] Change in libosmo-netif[master]: stream_srv: Use LOGSLNK() to print log line
by pespin 20 Aug '23

20 Aug '23
pespin has submitted this change. ( https://gerrit.osmocom.org/c/libosmo-netif/+/34071 ) ( 2 is the latest approved patch-set. No files were changed between the latest approved patch-set and the submitted one. )Change subject: stream_srv: Use LOGSLNK() to print log line ...................................................................... stream_srv: Use LOGSLNK() to print log line Change-Id: I9aaa63b676b1cd77c7ea500f9bceda989db50db0 --- M src/stream_srv.c 1 file changed, 11 insertions(+), 2 deletions(-) Approvals: laforge: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/stream_srv.c b/src/stream_srv.c index 9146028..1ef2cc4 100644 --- a/src/stream_srv.c +++ b/src/stream_srv.c @@ -107,8 +107,8 @@ ret = accept(ofd->fd, &osa.u.sa, &sa_len); if (ret < 0) { - LOGP(DLINP, LOGL_ERROR, "failed to accept from origin peer, reason=`%s'\n", - strerror(errno)); + LOGSLNK(link, LOGL_ERROR, "failed to accept from origin peer, reason=`%s'\n", + strerror(errno)); return ret; } sock_fd = ret; -- To view, visit https://gerrit.osmocom.org/c/libosmo-netif/+/34071 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmo-netif Gerrit-Branch: master Gerrit-Change-Id: I9aaa63b676b1cd77c7ea500f9bceda989db50db0 Gerrit-Change-Number: 34071 Gerrit-PatchSet: 3 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: merged
1 0
0 0
[S] Change in libosmo-netif[master]: stream_srv: call setsockopt(SO_NOSIGPIPE) also in srv sockets
by pespin 20 Aug '23

20 Aug '23
pespin has submitted this change. ( https://gerrit.osmocom.org/c/libosmo-netif/+/34072 ) Change subject: stream_srv: call setsockopt(SO_NOSIGPIPE) also in srv sockets ...................................................................... stream_srv: call setsockopt(SO_NOSIGPIPE) also in srv sockets Commit 5b0ad8bd851e4ce888b386be68c1821e4f2ca301 added call to setsockopt(SO_NOSIGPIPE) in order to avoid SIGPIPE being signalled on platforms not supporting send() flag MSG_NOSIGNAL (macOS, FreeBSD etc...). While it may be a topic to discuss whether we support those platorms or not, the fact that we call an extra setsockopt() during socket creation doesn't hurt much, and for sure we want to have the same behavior in client and server. Hence, this commit adds the same behavior pesent in srv sockets to cli ones. Change-Id: I867d8e244e473679abb7e7e7a9b531eeed046436 --- M src/stream_cli.c M src/stream_srv.c 2 files changed, 38 insertions(+), 1 deletion(-) Approvals: Jenkins Builder: Verified laforge: Looks good to me, but someone else must approve osmith: Looks good to me, but someone else must approve pespin: Looks good to me, approved diff --git a/src/stream_cli.c b/src/stream_cli.c index 72a86c3..9845f14 100644 --- a/src/stream_cli.c +++ b/src/stream_cli.c @@ -308,7 +308,7 @@ int val = 1; ret = setsockopt(osmo_stream_cli_fd(cli), SOL_SOCKET, SO_NOSIGPIPE, (void *)&val, sizeof(val)); if (ret < 0) - LOGSCLI(cli, LOGL_DEBUG, "Failed setting SO_NOSIGPIPE: %s\n", strerror(errno)); + LOGSCLI(cli, LOGL_ERROR, "Failed setting SO_NOSIGPIPE: %s\n", strerror(errno)); return ret; #else return 0; diff --git a/src/stream_srv.c b/src/stream_srv.c index 1ef2cc4..6898ef4 100644 --- a/src/stream_srv.c +++ b/src/stream_srv.c @@ -97,6 +97,20 @@ int flags; }; +static int _setsockopt_nosigpipe(struct osmo_stream_srv_link *link, int new_fd) +{ +#ifdef SO_NOSIGPIPE + int ret; + int val = 1; + ret = setsockopt(new_fd, SOL_SOCKET, SO_NOSIGPIPE, (void *)&val, sizeof(val)); + if (ret < 0) + LOGSLNK(link, LOGL_ERROR, "Failed setting SO_NOSIGPIPE: %s\n", strerror(errno)); + return ret; +#else + return 0; +#endif +} + static int osmo_stream_srv_link_ofd_cb(struct osmo_fd *ofd, unsigned int what) { int ret; @@ -117,6 +131,7 @@ case AF_UNIX: LOGSLNK(link, LOGL_DEBUG, "accept()ed new link on fd %d\n", sock_fd); + _setsockopt_nosigpipe(link, sock_fd); break; case AF_INET6: case AF_INET: @@ -124,6 +139,7 @@ osmo_sockaddr_to_str(&osa)); if (link->proto == IPPROTO_SCTP) { + _setsockopt_nosigpipe(link, sock_fd); ret = stream_sctp_sock_activate_events(sock_fd); if (ret < 0) goto error_close_socket; -- To view, visit https://gerrit.osmocom.org/c/libosmo-netif/+/34072 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmo-netif Gerrit-Branch: master Gerrit-Change-Id: I867d8e244e473679abb7e7e7a9b531eeed046436 Gerrit-Change-Number: 34072 Gerrit-PatchSet: 3 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: osmith <osmith(a)sysmocom.de> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: merged
1 0
0 0
[S] Change in libosmo-netif[master]: stream_cli: Increase log level of established conn to INFO
by pespin 20 Aug '23

20 Aug '23
pespin has submitted this change. ( https://gerrit.osmocom.org/c/libosmo-netif/+/34070 ) Change subject: stream_cli: Increase log level of established conn to INFO ...................................................................... stream_cli: Increase log level of established conn to INFO Change-Id: I49776db0b12ee46b629381d2fa2b501c2a63e390 --- M src/stream_cli.c M tests/stream/stream_test.err 2 files changed, 13 insertions(+), 1 deletion(-) Approvals: laforge: Looks good to me, but someone else must approve Jenkins Builder: Verified osmith: Looks good to me, approved diff --git a/src/stream_cli.c b/src/stream_cli.c index 5cd6931..72a86c3 100644 --- a/src/stream_cli.c +++ b/src/stream_cli.c @@ -341,7 +341,7 @@ /* Update sockname based on socket info: */ osmo_sock_get_name_buf(cli->sockname, sizeof(cli->sockname), osmo_stream_cli_fd(cli)); - LOGSCLI(cli, LOGL_DEBUG, "connection established\n"); + LOGSCLI(cli, LOGL_INFO, "connection established\n"); cli->state = STREAM_CLI_STATE_CONNECTED; switch (cli->sk_domain) { case AF_UNIX: diff --git a/tests/stream/stream_test.err b/tests/stream/stream_test.err index 2409c07..1fbf395 100644 --- a/tests/stream/stream_test.err +++ b/tests/stream/stream_test.err @@ -1,3 +1,4 @@ +CLICONN(cli_test,r=127.0.0.11:1111<->l=127.0.0.1:8976){CONNECTING} connection established {2.000001} autoreconnecting test step 11 [client NA, server OK], FD reg 1 @@ -18,11 +19,13 @@ {11.000008} autoreconnecting test step 4 [client OK, server OK], FD reg 0 {11.000009} autoreconnecting test step 3 [client OK, server OK], FD reg 1 +CLICONN(cli_test,r=127.0.0.11:1111<->l=127.0.0.1:8976){CONNECTING} connection established {11.000010} autoreconnecting test step 2 [client OK, server OK], FD reg 0 SRVCONN(srv_test,r=127.0.0.1:8976<->l=127.0.0.11:1111) connection closed with client {11.000011} autoreconnecting test step 1 [client OK, server NA], FD reg 0 +CLICONN(cli_test,r=127.0.0.11:1111<->l=127.0.0.1:8976){CONNECTING} connection established {11.000012} non-reconnecting test step 7 [client NA, server OK], FD reg 1 -- To view, visit https://gerrit.osmocom.org/c/libosmo-netif/+/34070 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmo-netif Gerrit-Branch: master Gerrit-Change-Id: I49776db0b12ee46b629381d2fa2b501c2a63e390 Gerrit-Change-Number: 34070 Gerrit-PatchSet: 3 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: daniel <dwillmann(a)sysmocom.de> Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: osmith <osmith(a)sysmocom.de> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: merged
1 0
0 0
[S] Change in libosmo-netif[master]: stream: Append data to current tail of message upon recv()
by pespin 20 Aug '23

20 Aug '23
pespin has submitted this change. ( https://gerrit.osmocom.org/c/libosmo-netif/+/34074 ) Change subject: stream: Append data to current tail of message upon recv() ...................................................................... stream: Append data to current tail of message upon recv() The previous behavior was not standarized, and even erratic under some code paths (passing msgb_data() and size=msgb_tailroom()). This patch standarizes the behavior, and makes it possible to append content if the user wishes so instead of erasing old data in the msgb passed to it. Change-Id: I2cfcd4f61545e6a76d84495c3467999efccf22df --- M src/stream_cli.c M src/stream_srv.c 2 files changed, 21 insertions(+), 5 deletions(-) Approvals: laforge: Looks good to me, but someone else must approve Jenkins Builder: Verified osmith: Looks good to me, but someone else must approve pespin: Looks good to me, approved diff --git a/src/stream_cli.c b/src/stream_cli.c index 9845f14..0e075b8 100644 --- a/src/stream_cli.c +++ b/src/stream_cli.c @@ -917,7 +917,7 @@ OSMO_ASSERT(cli); OSMO_ASSERT(msg); - ret = recv(cli->ofd.fd, msg->data, msg->data_len, 0); + ret = recv(cli->ofd.fd, msg->tail, msgb_tailroom(msg), 0); if (ret < 0) { if (errno == EPIPE || errno == ECONNRESET) LOGSCLI(cli, LOGL_ERROR, "lost connection with srv\n"); diff --git a/src/stream_srv.c b/src/stream_srv.c index 4d8d4d3..be43a80 100644 --- a/src/stream_srv.c +++ b/src/stream_srv.c @@ -826,14 +826,15 @@ struct sctp_sndrcvinfo sinfo; int flags = 0; int ret; + uint8_t *data = msg->tail; - ret = sctp_recvmsg(fd, msgb_data(msg), msgb_tailroom(msg), + 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 *)msgb_data(msg); + 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); msgb_put(msg, sizeof(union sctp_notification)); msgb_sctp_msg_flags(msg) = OSMO_STREAM_SCTP_MSG_FLAGS_NOTIFICATION; @@ -908,7 +909,7 @@ switch (conn->srv->sk_domain) { case AF_UNIX: - ret = recv(conn->ofd.fd, msgb_data(msg), msgb_tailroom(msg), 0); + ret = recv(conn->ofd.fd, msg->tail, msgb_tailroom(msg), 0); break; case AF_INET: case AF_INET6: @@ -921,7 +922,7 @@ #endif case IPPROTO_TCP: default: - ret = recv(conn->ofd.fd, msgb_data(msg), msgb_tailroom(msg), 0); + ret = recv(conn->ofd.fd, msg->tail, msgb_tailroom(msg), 0); break; } break; -- To view, visit https://gerrit.osmocom.org/c/libosmo-netif/+/34074 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmo-netif Gerrit-Branch: master Gerrit-Change-Id: I2cfcd4f61545e6a76d84495c3467999efccf22df Gerrit-Change-Number: 34074 Gerrit-PatchSet: 3 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: osmith <osmith(a)sysmocom.de> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: merged
1 0
0 0
[S] Change in libosmo-netif[master]: stream_srv: Improve logging lines accepting new connections
by pespin 20 Aug '23

20 Aug '23
pespin has submitted this change. ( https://gerrit.osmocom.org/c/libosmo-netif/+/34073 ) Change subject: stream_srv: Improve logging lines accepting new connections ...................................................................... stream_srv: Improve logging lines accepting new connections Change-Id: Iaca9a99417d2f1dbf449e2b20e5dfcdd5e05b683 --- M src/stream_srv.c M tests/stream/stream_test.err 2 files changed, 15 insertions(+), 3 deletions(-) Approvals: laforge: Looks good to me, but someone else must approve Jenkins Builder: Verified osmith: Looks good to me, approved diff --git a/src/stream_srv.c b/src/stream_srv.c index 6898ef4..4d8d4d3 100644 --- a/src/stream_srv.c +++ b/src/stream_srv.c @@ -129,13 +129,13 @@ switch (osa.u.sa.sa_family) { case AF_UNIX: - LOGSLNK(link, LOGL_DEBUG, "accept()ed new link on fd %d\n", + LOGSLNK(link, LOGL_INFO, "accept()ed new link on fd %d\n", sock_fd); _setsockopt_nosigpipe(link, sock_fd); break; case AF_INET6: case AF_INET: - LOGSLNK(link, LOGL_DEBUG, "accept()ed new link from %s\n", + LOGSLNK(link, LOGL_INFO, "accept()ed new link from %s\n", osmo_sockaddr_to_str(&osa)); if (link->proto == IPPROTO_SCTP) { @@ -146,7 +146,7 @@ } break; default: - LOGSLNK(link, LOGL_DEBUG, "accept()ed unexpected address family %d\n", + LOGSLNK(link, LOGL_ERROR, "accept()ed unexpected address family %d\n", osa.u.sa.sa_family); goto error_close_socket; } diff --git a/tests/stream/stream_test.err b/tests/stream/stream_test.err index 1fbf395..df0ebc3 100644 --- a/tests/stream/stream_test.err +++ b/tests/stream/stream_test.err @@ -1,3 +1,4 @@ +SRV(srv_link_test,127.0.0.11:1111) accept()ed new link from 127.0.0.1:8976 CLICONN(cli_test,r=127.0.0.11:1111<->l=127.0.0.1:8976){CONNECTING} connection established {2.000001} autoreconnecting test step 11 [client NA, server OK], FD reg 1 @@ -19,12 +20,14 @@ {11.000008} autoreconnecting test step 4 [client OK, server OK], FD reg 0 {11.000009} autoreconnecting test step 3 [client OK, server OK], FD reg 1 +SRV(srv_link_test,127.0.0.11:1111) accept()ed new link from 127.0.0.1:8976 CLICONN(cli_test,r=127.0.0.11:1111<->l=127.0.0.1:8976){CONNECTING} connection established {11.000010} autoreconnecting test step 2 [client OK, server OK], FD reg 0 SRVCONN(srv_test,r=127.0.0.1:8976<->l=127.0.0.11:1111) connection closed with client {11.000011} autoreconnecting test step 1 [client OK, server NA], FD reg 0 +SRV(srv_link_test,127.0.0.11:1111) accept()ed new link from 127.0.0.1:8976 CLICONN(cli_test,r=127.0.0.11:1111<->l=127.0.0.1:8976){CONNECTING} connection established {11.000012} non-reconnecting test step 7 [client NA, server OK], FD reg 1 -- To view, visit https://gerrit.osmocom.org/c/libosmo-netif/+/34073 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmo-netif Gerrit-Branch: master Gerrit-Change-Id: Iaca9a99417d2f1dbf449e2b20e5dfcdd5e05b683 Gerrit-Change-Number: 34073 Gerrit-PatchSet: 3 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: osmith <osmith(a)sysmocom.de> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: merged
1 0
0 0
[S] Change in libosmo-netif[master]: stream_srv: Handle ESHUTDOWN and other write() errors destroying the ...
by pespin 20 Aug '23

20 Aug '23
pespin has submitted this change. ( https://gerrit.osmocom.org/c/libosmo-netif/+/34078 ) 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(-) Approvals: Jenkins Builder: Verified laforge: Looks good to me, but someone else must approve osmith: Looks good to me, but someone else must approve pespin: Looks good to me, approved diff --git a/src/stream_srv.c b/src/stream_srv.c index be43a80..cccb811 100644 --- a/src/stream_srv.c +++ b/src/stream_srv.c @@ -588,8 +588,18 @@ return; } - if (ret == -1) /* send(): On error -1 is returned, and errno is set appropriately */ - LOGSSRV(conn, LOGL_ERROR, "error to send: %s\n", strerror(errno)); + if (ret == -1) {/* send(): On error -1 is returned, and errno is set appropriately */ + int err = errno; + LOGSSRV(conn, LOGL_ERROR, "send(len=%u) error: %s\n", msgb_length(msg), strerror(err)); + if (err == EAGAIN) { + /* Re-add at the start of the queue to re-attempt: */ + llist_add(&msg->list, &conn->tx_queue); + return; + } + msgb_free(msg); + osmo_stream_srv_destroy(conn); + return; + } msgb_free(msg); @@ -877,8 +887,9 @@ break; case SCTP_SHUTDOWN_EVENT: LOGP(DLINP, LOGL_DEBUG, "===> SHUTDOWN EVT\n"); - /* Handle this like a regular disconnect */ - return 0; + /* RFC6458 3.1.4: Any attempt to send more data will cause sendmsg() + * to return with an ESHUTDOWN error. */ + break; } return -EAGAIN; } -- 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: 4 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: osmith <osmith(a)sysmocom.de> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: merged
1 0
0 0
  • ← Newer
  • 1
  • ...
  • 84
  • 85
  • 86
  • 87
  • 88
  • 89
  • 90
  • ...
  • 152
  • Older →

HyperKitty Powered by HyperKitty version 1.3.12.