aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/src/gprs/gprs_ns.c
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2010-05-12 11:56:39 +0000
committerHarald Welte <laforge@gnumonks.org>2010-05-12 18:28:00 +0200
commitcad8301dbe288190cbf18d9a1818c0a5312646d0 (patch)
tree1194a59b9bba32596e72dd5b3c3c4f36cf682bcf /openbsc/src/gprs/gprs_ns.c
parent9bdb3ba3229edcd077d19ee7c44a54703527b6c4 (diff)
NS: don't memcmp sockaddr_in but compare ip and port individually
this seems to work more portably (ppc/32bit big endian)
Diffstat (limited to 'openbsc/src/gprs/gprs_ns.c')
-rw-r--r--openbsc/src/gprs/gprs_ns.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/openbsc/src/gprs/gprs_ns.c b/openbsc/src/gprs/gprs_ns.c
index 9cb330058..a166956b0 100644
--- a/openbsc/src/gprs/gprs_ns.c
+++ b/openbsc/src/gprs/gprs_ns.c
@@ -104,7 +104,9 @@ static struct gprs_nsvc *nsvc_by_rem_addr(struct gprs_ns_inst *nsi,
{
struct gprs_nsvc *nsvc;
llist_for_each_entry(nsvc, &nsi->gprs_nsvcs, list) {
- if (!memcmp(&nsvc->ip.bts_addr, sin, sizeof(*sin)))
+ if (nsvc->ip.bts_addr.sin_addr.s_addr ==
+ sin->sin_addr.s_addr &&
+ nsvc->ip.bts_addr.sin_port == sin->sin_port)
return nsvc;
}
return NULL;
@@ -764,10 +766,9 @@ struct gprs_nsvc *nsip_connect(struct gprs_ns_inst *nsi,
struct gprs_nsvc *nsvc;
nsvc = nsvc_by_rem_addr(nsi, dest);
- if (!nsvc) {
+ if (!nsvc)
nsvc = nsvc_create(nsi, nsvci);
- nsvc->ip.bts_addr = *dest;
- }
+ nsvc->ip.bts_addr = *dest;
nsvc->nsei = nsei;
nsvc->nsvci = nsvci;
nsvc->remote_end_is_sgsn = 1;