osmo-nitb: add -M to pass specific MNCC socket path
The old -m option without argument is still available and marked deprecated,
to not make users' lives more difficult than necessary.
diff --git a/openbsc/src/libmsc/mncc_sock.c b/openbsc/src/libmsc/mncc_sock.c
index dd0a44f..6da1c56 100644
--- a/openbsc/src/libmsc/mncc_sock.c
+++ b/openbsc/src/libmsc/mncc_sock.c
@@ -277,7 +277,7 @@
}
-int mncc_sock_init(struct gsm_network *net)
+int mncc_sock_init(struct gsm_network *net, const char *sock_path)
{
struct mncc_sock_state *state;
struct osmo_fd *bfd;
@@ -292,10 +292,10 @@
bfd = &state->listen_bfd;
- rc = osmo_unixsock_listen(bfd, SOCK_SEQPACKET, "/tmp/bsc_mncc");
+ rc = osmo_unixsock_listen(bfd, SOCK_SEQPACKET, sock_path);
if (rc < 0) {
- LOGP(DMNCC, LOGL_ERROR, "Could not create unix socket: %s\n",
- strerror(errno));
+ LOGP(DMNCC, LOGL_ERROR, "Could not create unix socket: %s: %s\n",
+ sock_path, strerror(errno));
talloc_free(state);
return rc;
}
@@ -314,6 +314,7 @@
net->mncc_state = state;
+ LOGP(DMNCC, LOGL_NOTICE, "MNCC socket at %s\n", sock_path);
return 0;
}