summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNico Golde <nico@ngolde.de>2012-06-18 11:56:55 +0200
committerNico Golde <nico@ngolde.de>2012-06-18 11:56:55 +0200
commit8497747c726cb9af29a2a5100b5ce86a1390de93 (patch)
treeb8d808daffe5810ef5aecc2bcb92c6a3680cf236
parent8cbbb75bf5d87f4f1e3f7068dfbfd4a12bf73dc5 (diff)
[SAP] disable sap socket if it does not exist, otherwise it interrupts normal SIM operationsnion/sap
-rw-r--r--src/host/layer23/src/common/sap_interface.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/host/layer23/src/common/sap_interface.c b/src/host/layer23/src/common/sap_interface.c
index 1249ed7..f68a401 100644
--- a/src/host/layer23/src/common/sap_interface.c
+++ b/src/host/layer23/src/common/sap_interface.c
@@ -498,6 +498,7 @@ int sap_open(struct osmocom_ms *ms, const char *socket_path)
{
ssize_t rc;
struct sockaddr_un local;
+ struct gsm_settings *set = &ms->settings;
ms->sap_wq.bfd.fd = socket(AF_UNIX, SOCK_STREAM, 0);
if (ms->sap_wq.bfd.fd < 0) {
@@ -512,6 +513,7 @@ int sap_open(struct osmocom_ms *ms, const char *socket_path)
rc = connect(ms->sap_wq.bfd.fd, (struct sockaddr *) &local, sizeof(local));
if (rc < 0) {
fprintf(stderr, "Failed to connect to '%s'\n", local.sun_path);
+ set->sap_socket_path[0] = 0;
close(ms->sap_wq.bfd.fd);
return rc;
}