Bugreport by Christian:
[lcr.git] / gsm.cpp
diff --git a/gsm.cpp b/gsm.cpp
index 3358329..961c11f 100644 (file)
--- a/gsm.cpp
+++ b/gsm.cpp
@@ -18,10 +18,10 @@ extern "C" {
 #include <getopt.h>
 
 #include <openbsc/db.h>
-#include <openbsc/select.h>
+#include <osmocore/select.h>
 #include <openbsc/debug.h>
 #include <openbsc/e1_input.h>
-#include <openbsc/talloc.h>
+#include <osmocore/talloc.h>
 #include <openbsc/mncc.h>
 #include <openbsc/trau_frame.h>
 struct gsm_network *bsc_gsmnet = 0;
@@ -44,12 +44,9 @@ static struct timer_list db_sync_timer;
 
 #include "gsm_audio.h"
 
-#undef AF_ISDN
-#undef PF_ISDN
-extern  int     AF_ISDN;
-#define PF_ISDN AF_ISDN
 }
 
+#include <mISDN/mISDNcompat.h>
 
 struct lcr_gsm *gsm = NULL;
 
@@ -176,7 +173,7 @@ int Pgsm::bchannel_open(int index)
                bchannel_close();
                return(ret);
        }
-       memset(&p_m_g_gsm_b_fd, 0, sizeof(p_m_g_gsm_b_fd.fd));
+       memset(&p_m_g_gsm_b_fd, 0, sizeof(p_m_g_gsm_b_fd));
        p_m_g_gsm_b_fd.fd = p_m_g_gsm_b_sock;
        register_fd(&p_m_g_gsm_b_fd, LCR_FD_READ, b_handler, this, 0);
 
@@ -249,7 +246,7 @@ void Pgsm::bchannel_send(unsigned int prim, unsigned int id, unsigned char *data
        memcpy(buf+MISDN_HEADER_LEN, data, len);
        ret = sendto(p_m_g_gsm_b_sock, buf, MISDN_HEADER_LEN+len, 0, NULL, 0);
        if (ret <= 0)
-               PERROR("Failed to send to socket index %d\n", index);
+               PERROR("Failed to send to socket index %d\n", p_m_g_gsm_b_index);
 }
 
 void Pgsm::frame_send(void *_frame)
@@ -1607,6 +1604,8 @@ int gsm_init(void)
        char hlr[128], cfg[128], filename[128];
         mode_t mode = S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH;
        int pcapfd, rc;
+       char conf_error[128] = "";
+
 
        debug_init();
        tall_bsc_ctx = talloc_named_const(NULL, 1, "openbsc");
@@ -1632,8 +1631,8 @@ int gsm_init(void)
        gsm->gsm_sock = -1;
 
        /* parse options */
-       if (!gsm_conf(&gsm->conf)) {
-               PERROR("%s", gsm_conf_error);
+       if (!gsm_conf(&gsm->conf, conf_error)) {
+               PERROR("%s", conf_error);
                return gsm_exit(-EINVAL);
        }