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 -----
  • 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

October 2023

  • 1 participants
  • 1843 discussions
[S] Change in libosmo-sccp[master]: xua_server: asp: Support removing local addresses
by pespin 02 Oct '23

02 Oct '23
pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmo-sccp/+/34613?usp=email ) Change subject: xua_server: asp: Support removing local addresses ...................................................................... xua_server: asp: Support removing local addresses The socket is reconfigured (and hence reopened) upon VTY node exit if changes were stored in the address list of the xua_server (osmo_stream_srv_link). Related: OS#4607 Change-Id: I942edff7695efeea7753f22e31c2098c201290ff --- M include/osmocom/sigtran/osmo_ss7.h M src/osmo_ss7_vty.c M src/osmo_ss7_xua_srv.c 3 files changed, 43 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-sccp refs/changes/13/34613/1 diff --git a/include/osmocom/sigtran/osmo_ss7.h b/include/osmocom/sigtran/osmo_ss7.h index 841c12b..a8a624f 100644 --- a/include/osmocom/sigtran/osmo_ss7.h +++ b/include/osmocom/sigtran/osmo_ss7.h @@ -562,6 +562,7 @@ int osmo_ss7_xua_server_set_local_hosts(struct osmo_xua_server *xs, const char **local_hosts, size_t local_host_cnt); int osmo_ss7_xua_server_add_local_host(struct osmo_xua_server *xs, const char *local_host); +int osmo_ss7_xua_server_del_local_host(struct osmo_xua_server *xs, const char *local_host); void osmo_ss7_xua_server_destroy(struct osmo_xua_server *xs); struct osmo_sccp_instance * diff --git a/src/osmo_ss7_vty.c b/src/osmo_ss7_vty.c index 172893e..ff27cf3 100644 --- a/src/osmo_ss7_vty.c +++ b/src/osmo_ss7_vty.c @@ -511,6 +511,22 @@ return CMD_SUCCESS; } +DEFUN_ATTR(xua_no_local_ip, xua_no_local_ip_cmd, + "no local-ip " VTY_IPV46_CMD, + NO_STR "Configure the Local IP Address for xUA\n" + "IPv4 Address to use for XUA\n" + "IPv6 Address to use for XUA\n", + CMD_ATTR_NODE_EXIT) +{ + struct osmo_xua_server *xs = vty->index; + + if (osmo_ss7_xua_server_del_local_host(xs, argv[0]) != 0) { + vty_out(vty, "%% Failed deleting local address '%s' from set%s", argv[0], VTY_NEWLINE); + return CMD_WARNING; + } + return CMD_SUCCESS; +} + DEFUN_ATTR(xua_accept_dyn_asp, xua_accept_dyn_asp_cmd, "accept-asp-connections (pre-configured|dynamic-permitted)", "Define what kind of ASP connections to accept\n" @@ -2476,6 +2492,7 @@ install_lib_element(L_CS7_NODE, &cs7_xua_cmd); install_lib_element(L_CS7_NODE, &no_cs7_xua_cmd); install_lib_element(L_CS7_XUA_NODE, &xua_local_ip_cmd); + install_lib_element(L_CS7_XUA_NODE, &xua_no_local_ip_cmd); install_lib_element(L_CS7_XUA_NODE, &xua_accept_dyn_asp_cmd); install_lib_element(L_CS7_XUA_NODE, &xua_sctp_param_init_cmd); install_lib_element(L_CS7_XUA_NODE, &xua_no_sctp_param_init_cmd); diff --git a/src/osmo_ss7_xua_srv.c b/src/osmo_ss7_xua_srv.c index dc27c83..32266ff 100644 --- a/src/osmo_ss7_xua_srv.c +++ b/src/osmo_ss7_xua_srv.c @@ -284,6 +284,17 @@ return osmo_stream_srv_link_set_addrs(xs->server, (const char **)xs->cfg.local.host, xs->cfg.local.host_cnt); } +int +osmo_ss7_xua_server_del_local_host(struct osmo_xua_server *xs, const char *local_host) +{ + int rc; + + rc = osmo_ss7_asp_peer_del_host(&xs->cfg.local, local_host); + if (rc < 0) + return rc; + return osmo_stream_srv_link_set_addrs(xs->server, (const char **)xs->cfg.local.host, xs->cfg.local.host_cnt); +} + bool ss7_xua_server_set_default_local_hosts(struct osmo_xua_server *oxs) { /* If no local addr was set, or erased after _create(): */ -- To view, visit https://gerrit.osmocom.org/c/libosmo-sccp/+/34613?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Change-Id: I942edff7695efeea7753f22e31c2098c201290ff Gerrit-Change-Number: 34613 Gerrit-PatchSet: 1 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: newchange
1 0
0 0
[S] Change in libosmo-sccp[master]: asp: Apply SCTP peer primary address changes after the ASP was started
by pespin 02 Oct '23

02 Oct '23
pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmo-sccp/+/34610?usp=email ) Change subject: asp: Apply SCTP peer primary address changes after the ASP was started ...................................................................... asp: Apply SCTP peer primary address changes after the ASP was started Related: OS#6077 Change-Id: I088b9a59ebfd85f3ce4a26f28bf41472d9b9da60 --- M src/osmo_ss7_vty.c 1 file changed, 27 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-sccp refs/changes/10/34610/1 diff --git a/src/osmo_ss7_vty.c b/src/osmo_ss7_vty.c index 000b1cf..cdca10d 100644 --- a/src/osmo_ss7_vty.c +++ b/src/osmo_ss7_vty.c @@ -714,11 +714,28 @@ { struct osmo_ss7_asp *asp = vty->index; bool is_primary = argc > 1; + int old_idx_primary = asp->cfg.local.idx_primary; + int rc; if (osmo_ss7_asp_peer_add_host2(&asp->cfg.local, asp, argv[0], is_primary) != 0) { vty_out(vty, "%% Failed adding host '%s' to set%s", argv[0], VTY_NEWLINE); return CMD_WARNING; } + + if (!ss7_asp_is_started(asp)) + return CMD_SUCCESS; + if (asp->cfg.proto == OSMO_SS7_ASP_PROT_IPA) + return CMD_SUCCESS; + + /* The SCTP socket is already created, dynamically apply the new primary if it changed: */ + if (is_primary && asp->cfg.local.idx_primary != old_idx_primary) { + if ((rc = ss7_asp_apply_peer_primary_address(asp)) < 0) { + /* Failed, rollback changes: */ + asp->cfg.local.idx_primary = old_idx_primary; + vty_out(vty, "%% Failed announcing primary '%s' to peer%s", argv[0], VTY_NEWLINE); + return CMD_WARNING; + } + } return CMD_SUCCESS; } -- To view, visit https://gerrit.osmocom.org/c/libosmo-sccp/+/34610?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Change-Id: I088b9a59ebfd85f3ce4a26f28bf41472d9b9da60 Gerrit-Change-Number: 34610 Gerrit-PatchSet: 1 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: newchange
1 0
0 0
[S] Change in libosmo-sccp[master]: asp: Support adding new local addresses after the ASP was started
by pespin 02 Oct '23

02 Oct '23
pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmo-sccp/+/34611?usp=email ) Change subject: asp: Support adding new local addresses after the ASP was started ...................................................................... asp: Support adding new local addresses after the ASP was started Related: OS#6077 Depends: libosmocore.git Change-Id Ifc6e7d643c2a0c53f479bfd0d5c36d08c0c01953 Change-Id: I8318d2693f3a9c479b18ab1d660431c1ec77c004 --- M TODO-RELEASE M src/osmo_ss7_asp.c M src/osmo_ss7_vty.c M src/ss7_internal.h 4 files changed, 48 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-sccp refs/changes/11/34611/1 diff --git a/TODO-RELEASE b/TODO-RELEASE index d0852fc..b1b533c 100644 --- a/TODO-RELEASE +++ b/TODO-RELEASE @@ -7,3 +7,4 @@ # If any interfaces have been added since the last public release: c:r:a + 1. # If any interfaces have been removed or changed since the last public release: c:r:0. #library what description / commit summary line +libosmocore >1.9.0 osmo_sock_multiaddr_add_local_addr() \ No newline at end of file diff --git a/src/osmo_ss7_asp.c b/src/osmo_ss7_asp.c index f26e2e1..68bd0ca 100644 --- a/src/osmo_ss7_asp.c +++ b/src/osmo_ss7_asp.c @@ -168,6 +168,25 @@ }; static unsigned int g_ss7_asp_rcg_idx; +int ss7_asp_apply_new_local_address(const struct osmo_ss7_asp *asp, unsigned int loc_idx) +{ + const char *new_loc_addr; + struct osmo_fd *ofd; + + OSMO_ASSERT(loc_idx < asp->cfg.local.host_cnt); + new_loc_addr = asp->cfg.local.host[loc_idx]; + + LOGPASP(asp, DLSS7, LOGL_INFO, "Add local address %s\n", + new_loc_addr); + + if (asp->cfg.is_server) + ofd = osmo_stream_srv_get_ofd(asp->server); + else + ofd = osmo_stream_cli_get_ofd(asp->client); + + return osmo_sock_multiaddr_add_local_addr(ofd->fd, &new_loc_addr, 1); +} + int ss7_asp_apply_peer_primary_address(const struct osmo_ss7_asp *asp) { struct osmo_fd *ofd; diff --git a/src/osmo_ss7_vty.c b/src/osmo_ss7_vty.c index cdca10d..f9c1ada 100644 --- a/src/osmo_ss7_vty.c +++ b/src/osmo_ss7_vty.c @@ -715,6 +715,7 @@ struct osmo_ss7_asp *asp = vty->index; bool is_primary = argc > 1; int old_idx_primary = asp->cfg.local.idx_primary; + int old_host_count = asp->cfg.local.host_cnt; int rc; if (osmo_ss7_asp_peer_add_host2(&asp->cfg.local, asp, argv[0], is_primary) != 0) { @@ -726,8 +727,21 @@ return CMD_SUCCESS; if (asp->cfg.proto == OSMO_SS7_ASP_PROT_IPA) return CMD_SUCCESS; + /* The SCTP socket is already created. */ - /* The SCTP socket is already created, dynamically apply the new primary if it changed: */ + /* dynamically apply the new address if it was added to the set: */ + if (asp->cfg.local.host_cnt > old_host_count) { + if ((rc = ss7_asp_apply_new_local_address(asp, asp->cfg.local.host_cnt - 1)) < 0) { + /* Failed, rollback changes: */ + TALLOC_FREE(asp->cfg.local.host[asp->cfg.local.host_cnt - 1]); + asp->cfg.local.host_cnt--; + vty_out(vty, "%% Failed adding new local address '%s'%s", argv[0], VTY_NEWLINE); + return CMD_WARNING; + } + vty_out(vty, "%% Local address '%s' added to the active socket bind set%s", argv[0], VTY_NEWLINE); + } + + /* dynamically apply the new primary if it changed: */ if (is_primary && asp->cfg.local.idx_primary != old_idx_primary) { if ((rc = ss7_asp_apply_peer_primary_address(asp)) < 0) { /* Failed, rollback changes: */ @@ -735,6 +749,7 @@ vty_out(vty, "%% Failed announcing primary '%s' to peer%s", argv[0], VTY_NEWLINE); return CMD_WARNING; } + vty_out(vty, "%% Local address '%s' announced as primary to the peer on the active socket%s", argv[0], VTY_NEWLINE); } return CMD_SUCCESS; } diff --git a/src/ss7_internal.h b/src/ss7_internal.h index ad71e83..438fca9 100644 --- a/src/ss7_internal.h +++ b/src/ss7_internal.h @@ -27,6 +27,7 @@ int ss7_asp_xua_srv_conn_closed_cb(struct osmo_stream_srv *srv); int ss7_asp_apply_peer_primary_address(const struct osmo_ss7_asp *asp); int ss7_asp_apply_primary_address(const struct osmo_ss7_asp *asp); +int ss7_asp_apply_new_local_address(const struct osmo_ss7_asp *asp, unsigned int loc_idx); bool ss7_asp_peer_match_host(const struct osmo_ss7_asp_peer *peer, const char *host, bool host_is_v6); -- To view, visit https://gerrit.osmocom.org/c/libosmo-sccp/+/34611?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Change-Id: I8318d2693f3a9c479b18ab1d660431c1ec77c004 Gerrit-Change-Number: 34611 Gerrit-PatchSet: 1 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: newchange
1 0
0 0
[S] Change in libosmo-sccp[master]: asp: Apply SCTP primary address changes after the ASP was started
by pespin 02 Oct '23

02 Oct '23
pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmo-sccp/+/34609?usp=email ) Change subject: asp: Apply SCTP primary address changes after the ASP was started ...................................................................... asp: Apply SCTP primary address changes after the ASP was started Related: OS#6077 Change-Id: I2beb597b2e98d8983177fb21882a461219b3aa58 --- M src/osmo_ss7_asp.c M src/osmo_ss7_vty.c M src/ss7_internal.h 3 files changed, 37 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-sccp refs/changes/09/34609/1 diff --git a/src/osmo_ss7_asp.c b/src/osmo_ss7_asp.c index 6068a9d..f26e2e1 100644 --- a/src/osmo_ss7_asp.c +++ b/src/osmo_ss7_asp.c @@ -617,6 +617,14 @@ return asp->fi->state == XUA_ASP_S_ACTIVE; } +bool ss7_asp_is_started(const struct osmo_ss7_asp *asp) +{ + if (asp->cfg.is_server) + return !!asp->server; + else + return !!asp->client; +} + /*********************************************************************** * libosmo-netif integration for SCTP stream server/client ***********************************************************************/ diff --git a/src/osmo_ss7_vty.c b/src/osmo_ss7_vty.c index 4e13522..000b1cf 100644 --- a/src/osmo_ss7_vty.c +++ b/src/osmo_ss7_vty.c @@ -732,11 +732,28 @@ { struct osmo_ss7_asp *asp = vty->index; bool is_primary = argc > 1; + int old_idx_primary = asp->cfg.remote.idx_primary; + int rc; if (osmo_ss7_asp_peer_add_host2(&asp->cfg.remote, asp, argv[0], is_primary) != 0) { vty_out(vty, "%% Failed adding host '%s' to set%s", argv[0], VTY_NEWLINE); return CMD_WARNING; } + + if (!ss7_asp_is_started(asp)) + return CMD_SUCCESS; + if (asp->cfg.proto == OSMO_SS7_ASP_PROT_IPA) + return CMD_SUCCESS; + + /* The SCTP socket is already created, dynamically apply the new primary if it changed: */ + if (asp->cfg.proto != OSMO_SS7_ASP_PROT_IPA && ss7_asp_is_started(asp)) { + if ((rc = ss7_asp_apply_primary_address(asp)) < 0) { + /* Failed, rollback changes: */ + asp->cfg.remote.idx_primary = old_idx_primary; + vty_out(vty, "%% Failed applying primary on host '%s'%s", argv[0], VTY_NEWLINE); + return CMD_WARNING; + } + } return CMD_SUCCESS; } diff --git a/src/ss7_internal.h b/src/ss7_internal.h index 6449c5b..ad71e83 100644 --- a/src/ss7_internal.h +++ b/src/ss7_internal.h @@ -18,7 +18,9 @@ uint16_t remote_port, uint16_t local_port, enum osmo_ss7_asp_protocol proto); bool ss7_asp_set_default_peer_hosts(struct osmo_ss7_asp *asp); +bool ss7_asp_is_started(const struct osmo_ss7_asp *asp); struct osmo_ss7_asp *ss7_asp_find_by_socket_addr(int fd); + int ss7_asp_proto_to_ip_proto(enum osmo_ss7_asp_protocol proto); int ss7_asp_ipa_srv_conn_cb(struct osmo_stream_srv *conn); int ss7_asp_xua_srv_conn_cb(struct osmo_stream_srv *conn); -- To view, visit https://gerrit.osmocom.org/c/libosmo-sccp/+/34609?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Change-Id: I2beb597b2e98d8983177fb21882a461219b3aa58 Gerrit-Change-Number: 34609 Gerrit-PatchSet: 1 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: newchange
1 0
0 0
[M] Change in libosmo-sccp[master]: asp: Support removing local & remote addresses
by pespin 02 Oct '23

02 Oct '23
pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmo-sccp/+/34612?usp=email ) Change subject: asp: Support removing local & remote addresses ...................................................................... asp: Support removing local & remote addresses The local address is removed dynamically from the socket if it is already created. For remote addresses, it doesn't make any sense (and there's no API to do so) because the remote address list passed to it is only used at connect() time, when the socket is created. During the initial hanshake, the remote provides its own list of remote addresses. Related: OS#6077 Related: OS#4607 Depends: libosmocore.git Change-Id Ifc6e7d643c2a0c53f479bfd0d5c36d08c0c01953 Change-Id: I554aee92285bd72eb90c6daf47b37055cb3067aa --- M TODO-RELEASE M include/osmocom/sigtran/osmo_ss7.h M src/osmo_ss7_asp.c M src/osmo_ss7_asp_peer.c M src/osmo_ss7_vty.c M src/ss7_internal.h M tests/vty/ss7_asp_test.vty 7 files changed, 162 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-sccp refs/changes/12/34612/1 diff --git a/TODO-RELEASE b/TODO-RELEASE index b1b533c..ae21a12 100644 --- a/TODO-RELEASE +++ b/TODO-RELEASE @@ -7,4 +7,4 @@ # If any interfaces have been added since the last public release: c:r:a + 1. # If any interfaces have been removed or changed since the last public release: c:r:0. #library what description / commit summary line -libosmocore >1.9.0 osmo_sock_multiaddr_add_local_addr() \ No newline at end of file +libosmocore >1.9.0 osmo_sock_multiaddr_{add,del}_local_addr() \ No newline at end of file diff --git a/include/osmocom/sigtran/osmo_ss7.h b/include/osmocom/sigtran/osmo_ss7.h index 98e1187..841c12b 100644 --- a/include/osmocom/sigtran/osmo_ss7.h +++ b/include/osmocom/sigtran/osmo_ss7.h @@ -471,6 +471,8 @@ const char *const*hosts, size_t host_cnt, int idx_primary); int osmo_ss7_asp_peer_add_host(struct osmo_ss7_asp_peer *peer, void *talloc_ctx, const char *host); int osmo_ss7_asp_peer_add_host2(struct osmo_ss7_asp_peer *peer, void *talloc_ctx, const char *host, bool is_primary_addr); +int osmo_ss7_asp_peer_del_host(struct osmo_ss7_asp_peer *peer, const char *host); + struct osmo_ss7_asp * osmo_ss7_asp_find_by_name(struct osmo_ss7_instance *inst, const char *name); diff --git a/src/osmo_ss7_asp.c b/src/osmo_ss7_asp.c index 68bd0ca..1ba0a43 100644 --- a/src/osmo_ss7_asp.c +++ b/src/osmo_ss7_asp.c @@ -187,6 +187,25 @@ return osmo_sock_multiaddr_add_local_addr(ofd->fd, &new_loc_addr, 1); } +int ss7_asp_apply_drop_local_address(const struct osmo_ss7_asp *asp, unsigned int loc_idx) +{ + const char *new_loc_addr; + struct osmo_fd *ofd; + + OSMO_ASSERT(loc_idx < asp->cfg.local.host_cnt); + new_loc_addr = asp->cfg.local.host[loc_idx]; + + LOGPASP(asp, DLSS7, LOGL_INFO, "Remove local address %s\n", + new_loc_addr); + + if (asp->cfg.is_server) + ofd = osmo_stream_srv_get_ofd(asp->server); + else + ofd = osmo_stream_cli_get_ofd(asp->client); + + return osmo_sock_multiaddr_del_local_addr(ofd->fd, &new_loc_addr, 1); +} + int ss7_asp_apply_peer_primary_address(const struct osmo_ss7_asp *asp) { struct osmo_fd *ofd; diff --git a/src/osmo_ss7_asp_peer.c b/src/osmo_ss7_asp_peer.c index cf591d9..39a92b1 100644 --- a/src/osmo_ss7_asp_peer.c +++ b/src/osmo_ss7_asp_peer.c @@ -208,6 +208,50 @@ return 0; } +/*! \brief Remove address from a given ASP peer. + * \param[in] peer Application Server Process peer the address is removed from. + * \param[in] host string containing an IP address. + * \returns 0 on success; negative otherwise */ +int osmo_ss7_asp_peer_del_host(struct osmo_ss7_asp_peer *peer, const char *host) +{ + int i; + struct osmo_sockaddr_str addr_str; + bool found = false; + + if (osmo_sockaddr_str_from_str(&addr_str, host, 0) < 0) + return -EINVAL; + + for (i = 0; i < peer->host_cnt; i++) { + if (strcmp(host, peer->host[i]) == 0) { + found = true; + break; + } + } + + if (!found) + return -ENOENT; + + /* If current primary points to addr being removed, unset it: */ + if (peer->idx_primary == i) + peer->idx_primary = -1; + /* If it's after it, update it together with sliding done further below: */ + else if (peer->idx_primary > i) + peer->idx_primary--; + + /* Free addr to remove: */ + TALLOC_FREE(peer->host[i]); + + /* Move the rest of the array: */ + for (; i < peer->host_cnt - 1; i++) + peer->host[i] = peer->host[i + 1]; + peer->host[i] = NULL; + + /* Update array size: */ + peer->host_cnt--; + + return 0; +} + /*! \brief Append (copy) address to a given ASP peer. Previous addresses are kept. * \param[in] peer Application Server Process peer the address is appended to. * \param[in] talloc_ctx talloc context used to allocate new address. @@ -233,3 +277,18 @@ } return false; } + +/*! \brief Find the exact IP address match and return its index in the array + * \param[in] peer Application Server Process peer where the address is looked up. + * \param[in] host string containing an IP address. + * \returns >=0 on success containing the index of the host; negative otherwise */ +int ss7_asp_peer_find_host(const struct osmo_ss7_asp_peer *peer, const char *host) +{ + unsigned int i; + + for (i = 0; i < peer->host_cnt; i++) { + if (strcmp(host, peer->host[i]) == 0) + return i; + } + return -1; +} diff --git a/src/osmo_ss7_vty.c b/src/osmo_ss7_vty.c index f9c1ada..172893e 100644 --- a/src/osmo_ss7_vty.c +++ b/src/osmo_ss7_vty.c @@ -754,6 +754,39 @@ return CMD_SUCCESS; } +DEFUN_ATTR(asp_no_local_ip, asp_no_local_ip_cmd, + "no local-ip " VTY_IPV46_CMD, + NO_STR "Specify Local IP Address from which to contact ASP\n" + "Local IPv4 Address from which to contact of ASP\n" + "Local IPv6 Address from which to contact of ASP\n", + CMD_ATTR_NODE_EXIT) +{ + struct osmo_ss7_asp *asp = vty->index; + int idx = ss7_asp_peer_find_host(&asp->cfg.local, argv[0]); + int rc; + + if (idx < 0) { + vty_out(vty, "%% Local address '%s' not found in set%s", argv[0], VTY_NEWLINE); + return CMD_WARNING; + } + + if (ss7_asp_is_started(asp)) { + if (asp->cfg.proto != OSMO_SS7_ASP_PROT_IPA) { + if ((rc = ss7_asp_apply_drop_local_address(asp, idx)) < 0) { + vty_out(vty, "%% Failed removing local address '%s' from existing socket%s", argv[0], VTY_NEWLINE); + return CMD_WARNING; + } + vty_out(vty, "%% Local address '%s' removed from active socket connection%s", argv[0], VTY_NEWLINE); + } + } + + if (osmo_ss7_asp_peer_del_host(&asp->cfg.local, argv[0]) != 0) { + vty_out(vty, "%% Failed deleting local address '%s' from set%s", argv[0], VTY_NEWLINE); + return CMD_WARNING; + } + return CMD_SUCCESS; +} + DEFUN_ATTR(asp_remote_ip, asp_remote_ip_cmd, "remote-ip " VTY_IPV46_CMD " [primary]", "Specify Remote IP Address of ASP\n" @@ -789,6 +822,28 @@ return CMD_SUCCESS; } +DEFUN_ATTR(asp_no_remote_ip, asp_no_remote_ip_cmd, + "no remote-ip " VTY_IPV46_CMD, + NO_STR "Specify Remote IP Address of ASP\n" + "Remote IPv4 Address of ASP\n" + "Remote IPv6 Address of ASP\n", + CMD_ATTR_NODE_EXIT) +{ + struct osmo_ss7_asp *asp = vty->index; + int idx = ss7_asp_peer_find_host(&asp->cfg.remote, argv[0]); + + if (idx < 0) { + vty_out(vty, "%% Remote address '%s' not found in set%s", argv[0], VTY_NEWLINE); + return CMD_WARNING; + } + + if (osmo_ss7_asp_peer_del_host(&asp->cfg.remote, argv[0]) != 0) { + vty_out(vty, "%% Failed deleting remote address '%s' from set%s", argv[0], VTY_NEWLINE); + return CMD_WARNING; + } + return CMD_SUCCESS; +} + DEFUN_ATTR(asp_qos_clas, asp_qos_class_cmd, "qos-class <0-255>", "Specify QoS Class of ASP\n" @@ -2362,7 +2417,9 @@ install_lib_element(L_CS7_NODE, &no_cs7_asp_cmd); install_lib_element(L_CS7_ASP_NODE, &cfg_description_cmd); install_lib_element(L_CS7_ASP_NODE, &asp_remote_ip_cmd); + install_lib_element(L_CS7_ASP_NODE, &asp_no_remote_ip_cmd); install_lib_element(L_CS7_ASP_NODE, &asp_local_ip_cmd); + install_lib_element(L_CS7_ASP_NODE, &asp_no_local_ip_cmd); install_lib_element(L_CS7_ASP_NODE, &asp_qos_class_cmd); install_lib_element(L_CS7_ASP_NODE, &asp_role_cmd); install_lib_element(L_CS7_ASP_NODE, &asp_sctp_role_cmd); diff --git a/src/ss7_internal.h b/src/ss7_internal.h index 438fca9..e2d78d8 100644 --- a/src/ss7_internal.h +++ b/src/ss7_internal.h @@ -28,8 +28,10 @@ int ss7_asp_apply_peer_primary_address(const struct osmo_ss7_asp *asp); int ss7_asp_apply_primary_address(const struct osmo_ss7_asp *asp); int ss7_asp_apply_new_local_address(const struct osmo_ss7_asp *asp, unsigned int loc_idx); +int ss7_asp_apply_drop_local_address(const struct osmo_ss7_asp *asp, unsigned int loc_idx); bool ss7_asp_peer_match_host(const struct osmo_ss7_asp_peer *peer, const char *host, bool host_is_v6); +int ss7_asp_peer_find_host(const struct osmo_ss7_asp_peer *peer, const char *host); bool ss7_xua_server_set_default_local_hosts(struct osmo_xua_server *oxs); diff --git a/tests/vty/ss7_asp_test.vty b/tests/vty/ss7_asp_test.vty index 09a3dba..dcea4ca 100644 --- a/tests/vty/ss7_asp_test.vty +++ b/tests/vty/ss7_asp_test.vty @@ -221,7 +221,9 @@ ... description .TEXT remote-ip (A.B.C.D|X:X::X:X) [primary] + no remote-ip (A.B.C.D|X:X::X:X) local-ip (A.B.C.D|X:X::X:X) [primary] + no local-ip (A.B.C.D|X:X::X:X) qos-class <0-255> role (sg|asp|ipsp) sctp-role (client|server) @@ -235,12 +237,12 @@ ... description Save human-readable description of the object remote-ip Specify Remote IP Address of ASP + no Negate a command or set its defaults local-ip Specify Local IP Address from which to contact ASP qos-class Specify QoS Class of ASP role Specify the xUA role for this ASP sctp-role Specify the SCTP role for this ASP sctp-param Configure SCTP parameters - no Negate a command or set its defaults block Allows a SCTP Association with ASP, but doesn't let it become active shutdown Terminates SCTP association; New associations will be rejected ... -- To view, visit https://gerrit.osmocom.org/c/libosmo-sccp/+/34612?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Change-Id: I554aee92285bd72eb90c6daf47b37055cb3067aa Gerrit-Change-Number: 34612 Gerrit-PatchSet: 1 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: newchange
1 0
0 0
[M] Change in osmo-bsc[master]: meas_feed: Use osmo_io instead of write queue
by pespin 02 Oct '23

02 Oct '23
Attention is currently required from: arehbein, daniel, fixeria. pespin has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-bsc/+/34526?usp=email ) Change subject: meas_feed: Use osmo_io instead of write queue ...................................................................... Patch Set 6: (2 comments) File src/osmo-bsc/meas_feed.c: https://gerrit.osmocom.org/c/osmo-bsc/+/34526/comment/90a2121e_c07296f8 PS6, Line 33: static struct meas_feed_state g_mfs = {.txqueue_max = MEAS_FEED_TXQUEUE_MAX_LEN_DEFAULT}; > I kind of like using a different style for structs as opposed to the style used for function definit […] I gree with Daniel, we usually use the way he proposed. For sure at least you should leave some space before/after "{ }" https://gerrit.osmocom.org/c/osmo-bsc/+/34526/comment/5b57b162_4bfcb0ba PS6, Line 133: struct osmo_io_ops meas_feed_oio = {.read_cb = NULL, .write_cb = meas_feed_noop_cb, > Here as well Ack -- To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/34526?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Change-Id: Ib0570a3242e2846062e24c93cbbbbd31137acdee Gerrit-Change-Number: 34526 Gerrit-PatchSet: 6 Gerrit-Owner: arehbein <arehbein(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: daniel <dwillmann(a)sysmocom.de> Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-Attention: arehbein <arehbein(a)sysmocom.de> Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Attention: daniel <dwillmann(a)sysmocom.de> Gerrit-Comment-Date: Mon, 02 Oct 2023 16:50:28 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: No Comment-In-Reply-To: arehbein <arehbein(a)sysmocom.de> Comment-In-Reply-To: daniel <dwillmann(a)sysmocom.de> Gerrit-MessageType: comment
1 0
0 0
[M] Change in osmo-bsc[master]: meas_feed: Use osmo_io instead of write queue
by arehbein 02 Oct '23

02 Oct '23
Attention is currently required from: daniel, fixeria, pespin. arehbein has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-bsc/+/34526?usp=email ) Change subject: meas_feed: Use osmo_io instead of write queue ...................................................................... Patch Set 6: (3 comments) File src/osmo-bsc/meas_feed.c: https://gerrit.osmocom.org/c/osmo-bsc/+/34526/comment/0d553836_798d4cea PS5, Line 148: &(struct osmo_io_ops) { : .read_cb = meas_feed_noop_cb, : .write_cb = meas_feed_noop_cb, : .segmentation_cb = NULL, : }, NULL); > The read callback (if set) also needs to free the msgb, otherwise we leak memory. […] @vyanitskiy@sysmocom.de I have adapted the code, although I do find it helpful to see what is effectually being passed when using an unnamed struct. @dwillmann@sysmocom.de Shouldn't we declare that part about freeing the msg buff in the comment for the `read_cb` member in `libosmocore.git:include/osmocom/core/osmo_io.h`? https://gerrit.osmocom.org/c/osmo-bsc/+/34526/comment/4865ff1a_05d03cae PS5, Line 156: meas_feed_txqueue_max_length_set(MEAS_FEED_TXQUEUE_MAX_LEN_DEFAULT > This looks suspicious. I see a few potential problems: […] Done File src/osmo-bsc/meas_feed.c: https://gerrit.osmocom.org/c/osmo-bsc/+/34526/comment/7c481d4b_6a9e9533 PS6, Line 33: static struct meas_feed_state g_mfs = {.txqueue_max = MEAS_FEED_TXQUEUE_MAX_LEN_DEFAULT}; > Not sure if we have preferred way in osmocom, but I'd prefer each initializer element on its own lin […] I kind of like using a different style for structs as opposed to the style used for function definitions and elements of control flow. If it's not a must, I'd like to keep it this way -- To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/34526?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Change-Id: Ib0570a3242e2846062e24c93cbbbbd31137acdee Gerrit-Change-Number: 34526 Gerrit-PatchSet: 6 Gerrit-Owner: arehbein <arehbein(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: daniel <dwillmann(a)sysmocom.de> Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Attention: pespin <pespin(a)sysmocom.de> Gerrit-Attention: daniel <dwillmann(a)sysmocom.de> Gerrit-Comment-Date: Mon, 02 Oct 2023 16:44:36 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: No Comment-In-Reply-To: fixeria <vyanitskiy(a)sysmocom.de> Comment-In-Reply-To: daniel <dwillmann(a)sysmocom.de> Gerrit-MessageType: comment
1 0
0 0
[M] Change in osmo-bsc[master]: meas_feed: Use osmo_io instead of write queue
by daniel 02 Oct '23

02 Oct '23
Attention is currently required from: arehbein, fixeria, pespin. daniel has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-bsc/+/34526?usp=email ) Change subject: meas_feed: Use osmo_io instead of write queue ...................................................................... Patch Set 6: (2 comments) File src/osmo-bsc/meas_feed.c: https://gerrit.osmocom.org/c/osmo-bsc/+/34526/comment/8d79aec3_162f3443 PS6, Line 33: static struct meas_feed_state g_mfs = {.txqueue_max = MEAS_FEED_TXQUEUE_MAX_LEN_DEFAULT}; Not sure if we have preferred way in osmocom, but I'd prefer each initializer element on its own line. ``` static struct meas_feed_state g_mfs = { .txqueue_max = MEAS_FEED_TXQUEUE_MAX_LEN_DEFAULT, }; ``` https://gerrit.osmocom.org/c/osmo-bsc/+/34526/comment/f74ff94f_607a94b9 PS6, Line 133: struct osmo_io_ops meas_feed_oio = {.read_cb = NULL, .write_cb = meas_feed_noop_cb, Here as well -- To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/34526?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Change-Id: Ib0570a3242e2846062e24c93cbbbbd31137acdee Gerrit-Change-Number: 34526 Gerrit-PatchSet: 6 Gerrit-Owner: arehbein <arehbein(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: daniel <dwillmann(a)sysmocom.de> Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-Attention: arehbein <arehbein(a)sysmocom.de> Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Attention: pespin <pespin(a)sysmocom.de> Gerrit-Comment-Date: Mon, 02 Oct 2023 16:12:48 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: No Gerrit-MessageType: comment
1 0
0 0
[M] Change in osmo-bsc[master]: meas_feed: Use osmo_io instead of write queue
by arehbein 02 Oct '23

02 Oct '23
Attention is currently required from: arehbein, fixeria, pespin. Hello Jenkins Builder, daniel, fixeria, pespin, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/c/osmo-bsc/+/34526?usp=email to look at the new patch set (#6). The following approvals got outdated and were removed: Code-Review-1 by fixeria, Verified+1 by Jenkins Builder Change subject: meas_feed: Use osmo_io instead of write queue ...................................................................... meas_feed: Use osmo_io instead of write queue Related: OS#6170 Change-Id: Ib0570a3242e2846062e24c93cbbbbd31137acdee --- M include/osmocom/bsc/meas_feed.h M src/osmo-bsc/bsc_vty.c M src/osmo-bsc/meas_feed.c M src/osmo-bsc/osmo_bsc_main.c 4 files changed, 51 insertions(+), 54 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/26/34526/6 -- To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/34526?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Change-Id: Ib0570a3242e2846062e24c93cbbbbd31137acdee Gerrit-Change-Number: 34526 Gerrit-PatchSet: 6 Gerrit-Owner: arehbein <arehbein(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: daniel <dwillmann(a)sysmocom.de> Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-Attention: arehbein <arehbein(a)sysmocom.de> Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Attention: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: newpatchset
1 0
0 0
[S] Change in osmocom-bb[master]: Fixed potential NULL pointer dereferences, discovered by Coverity Scan
by pespin 02 Oct '23

02 Oct '23
Attention is currently required from: jolly. pespin has posted comments on this change. ( https://gerrit.osmocom.org/c/osmocom-bb/+/34608?usp=email ) Change subject: Fixed potential NULL pointer dereferences, discovered by Coverity Scan ...................................................................... Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/c/osmocom-bb/+/34608?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Change-Id: I47aa506014d8bddb8c8ce9b506c1c5c7b8056d30 Gerrit-Change-Number: 34608 Gerrit-PatchSet: 1 Gerrit-Owner: jolly <andreas(a)eversberg.eu> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-Attention: jolly <andreas(a)eversberg.eu> Gerrit-Comment-Date: Mon, 02 Oct 2023 14:36:32 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
1 0
0 0
  • ← Newer
  • 1
  • ...
  • 176
  • 177
  • 178
  • 179
  • 180
  • 181
  • 182
  • ...
  • 185
  • Older →

HyperKitty Powered by HyperKitty version 1.3.12.