From d60dae29f9b68bc51e7bb29cbbb62653f8da5191 Mon Sep 17 00:00:00 2001 From: Super User Date: Wed, 4 Jun 2008 18:09:43 +0200 Subject: [PATCH] fixed bad bug in opening bchannel modified: Makefile modified: bchannel.c --- Makefile | 1 + bchannel.c | 5 ++--- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 1acde7a..53f43c2 100644 --- a/Makefile +++ b/Makefile @@ -257,6 +257,7 @@ $(GENEXT): options.o extension.o genext.o # @exit install: + make -killall -9 -w -q lcr # the following error must be ignored cp $(LCR) $(INSTALL_BIN) cp $(LCRADMIN) $(INSTALL_BIN) diff --git a/bchannel.c b/bchannel.c index 6d28a7c..3db3bc5 100644 --- a/bchannel.c +++ b/bchannel.c @@ -141,18 +141,17 @@ int bchannel_create(struct bchannel *bchannel) CERROR(NULL, NULL, "Failed to set bchannel-socket handle 0x%x into nonblocking IO\n", bchannel->handle); close(bchannel->b_sock); bchannel->b_sock = -1; - bchannel->handle = 0; return(0); } /* bind socket to bchannel */ addr.family = AF_ISDN; addr.dev = (bchannel->handle>>8)-1; - addr.channel = bchannel->handle && 0xff; + addr.channel = bchannel->handle & 0xff; ret = bind(bchannel->b_sock, (struct sockaddr *)&addr, sizeof(addr)); if (ret < 0) { - CERROR(NULL, NULL, "Failed to bind bchannel-socket for handle 0x%x with mISDN-DSP layer. Did you load mISDNdsp.ko?\n", bchannel->handle); + CERROR(NULL, NULL, "Failed to bind bchannel-socket for handle 0x%x with mISDN-DSP layer. (port %d, channel %d) Did you load mISDNdsp.ko?\n", bchannel->handle, addr.dev + 1, addr.channel); close(bchannel->b_sock); bchannel->b_sock = -1; return(0); -- 2.13.6