aboutsummaryrefslogtreecommitdiffstats
path: root/src/gb/gprs_ns2_sns.c
diff options
context:
space:
mode:
authorAlexander Couzens <lynxis@fe80.eu>2020-10-11 20:48:04 +0200
committerlaforge <laforge@osmocom.org>2020-10-12 13:08:42 +0000
commit9a4cf275b2d2ae03702bd344291332f7e898da51 (patch)
treeca1fe9e1d9ac2ece53be9241c3aac525d518be47 /src/gb/gprs_ns2_sns.c
parent4b6c8afcb2e0c7c366bf0a98138d659055860af3 (diff)
gprs_ns2: const the return value of gprs_ns2_ip_vc_sockaddr / gprs_ns2_ip_bind_sockaddr
The sockaddr should not be changed. free and create the bind/nsvc if the address should be changed. Change-Id: I371ac2361b569e36722b02fc9cd82ec8da2fa9e3
Diffstat (limited to 'src/gb/gprs_ns2_sns.c')
-rw-r--r--src/gb/gprs_ns2_sns.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/gb/gprs_ns2_sns.c b/src/gb/gprs_ns2_sns.c
index fabc134a..27562269 100644
--- a/src/gb/gprs_ns2_sns.c
+++ b/src/gb/gprs_ns2_sns.c
@@ -473,7 +473,7 @@ static int do_sns_change_weight(struct osmo_fsm_inst *fi, const struct gprs_ns_i
struct gprs_ns2_nse *nse = nse_inst_from_fi(fi);
struct gprs_ns2_vc *nsvc;
struct osmo_sockaddr sa = {};
- struct osmo_sockaddr *remote;
+ const struct osmo_sockaddr *remote;
uint8_t new_signal;
uint8_t new_data;
@@ -533,7 +533,7 @@ static int do_sns_delete(struct osmo_fsm_inst *fi,
struct ns2_sns_state *gss = (struct ns2_sns_state *) fi->priv;
struct gprs_ns2_nse *nse = nse_inst_from_fi(fi);
struct gprs_ns2_vc *nsvc, *tmp;
- struct osmo_sockaddr *remote;
+ const struct osmo_sockaddr *remote;
struct osmo_sockaddr sa = {};
if (ip4) {
@@ -1239,7 +1239,9 @@ int ns2_sns_bss_fsm_start(struct gprs_ns2_nse *nse, struct gprs_ns2_vc *nsvc,
struct gprs_ns_ie_ip6_elem *ip6_elems;
struct gprs_ns2_vc_bind *bind;
struct gprs_ns2_inst *nsi = nse->nsi;
- struct osmo_sockaddr *sa, local;
+ const struct osmo_sockaddr *sa;
+ struct osmo_sockaddr local;
+
gss->ip = remote->u.sa.sa_family == AF_INET ? IPv4 : IPv6;
gss->initial = *remote;