diff options
author | Pau Espin Pedrol <pespin@sysmocom.de> | 2017-11-17 12:57:25 +0100 |
---|---|---|
committer | Harald Welte <laforge@gnumonks.org> | 2017-12-20 16:04:08 +0000 |
commit | 10d4815bb1b4b548ec0bc97611b2e7ac45e0ebc5 (patch) | |
tree | 9dd55111832b35ae1d9d71defbcb9bdf652befd4 /include | |
parent | 6cd8d1243711f4de2f1314c7b87b972572cdec4e (diff) |
ss7: Re-bind xUA server socket after setting new IP
In osmo-stp, cmd "local-ip" inside node "listen m3ua 2905" was actually
not being applied, because the server was created + bound at "listen" command
time using NULL as IP, and at "local-ip" time the IP was changed but the
server was not re-bound using the new IP, so it kept listening at
0.0.0.0.
With this patch, we defer binding the socket to "local-ip" cmd time,
after the IP has been applied.
As a result, if no "local-ip" command is provided, then the bind never
happens, which means it is now mandatory that users of osmo_ss7_xua_server_create
API not using osmo_ss7_xua_server_set_local_host call new provided API
osmo_ss7_xua_server_bind. Another new API osmo_ss7_bind_all_instances is
provided to easily make sure all servers are bound after configuration
process. This is specially important for servers which doesn't contain
the "local-ip" parameter.
Users of osmo_sccp_simple_server API are not affected by this change,
and they not requrie to call any new API.
Furthermore, using osmo_ss7_xua_server_bind in VTY code ensures the xUA
server is automatically bound to the new address if the operator changes
the "local-ip" cmd at runtime.
Related: OS#2647
Change-Id: I79738963d633bec70705ff159c5b2127cd498aa2
Diffstat (limited to 'include')
-rw-r--r-- | include/osmocom/sigtran/osmo_ss7.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/include/osmocom/sigtran/osmo_ss7.h b/include/osmocom/sigtran/osmo_ss7.h index 71c2022..94d5e8a 100644 --- a/include/osmocom/sigtran/osmo_ss7.h +++ b/include/osmocom/sigtran/osmo_ss7.h @@ -108,6 +108,8 @@ osmo_ss7_instance_find_or_create(void *ctx, uint32_t id); void osmo_ss7_instance_destroy(struct osmo_ss7_instance *inst); int osmo_ss7_instance_set_pc_fmt(struct osmo_ss7_instance *inst, uint8_t c0, uint8_t c1, uint8_t c2); +int osmo_ss7_instance_bind(struct osmo_ss7_instance *inst); +int osmo_ss7_bind_all_instances(); /*********************************************************************** * MTP Users (Users of MTP, such as SCCP or ISUP) @@ -441,6 +443,9 @@ osmo_ss7_xua_server_create(struct osmo_ss7_instance *inst, enum osmo_ss7_asp_pro uint16_t local_port, const char *local_host); int +osmo_ss7_xua_server_bind(struct osmo_xua_server *xs); + +int osmo_ss7_xua_server_set_local_host(struct osmo_xua_server *xs, const char *local_host); void osmo_ss7_xua_server_destroy(struct osmo_xua_server *xs); |