[thirdparty-commits] rmudgett: mISDN/trunk r198 - /mISDN/trunk/drivers/isdn/hardware/mISDN/udevice.c

SVN commits to the Digium third-party software repository thirdparty-commits at lists.digium.com
Fri Nov 30 14:43:38 CST 2012


Author: rmudgett
Date: Fri Nov 30 14:43:34 2012
New Revision: 198

URL: http://svnview.digium.com/svn/thirdparty?view=rev&rev=198
Log:
Fix mISDN B channels getting lost over time.

Sometimes messages sent by Asterisk in isdn_lib.c to the kernel driver
never reach it.  In case of these stuck B channels it is always first a
SETUP which is never acted upon (no TIMEOUT/no SETUP-ACK indication
follows) and then later the DISCONNECT is also not answered with an
appropriate RELEASE.

The problem was introduced in mISDN on 2004-11-19 with a "fix" for kernel
2.6.8, which turns out to be plain wrong.  Before kernel 2.6.8 it was
required to check "if (off != &file->f_pos)" and return -ESPIPE if a
device is not seekable.  Since 2.6.8, this check does not work anymore.
The fix for kernel 2.6.8 is to use the new API function nonseekable_open()
to disallow seeks.

(closes issue ABE-2869)
Reported by: Guenther Kelleter
Patches:
      noseek.diff (license #6372) patch uploaded by Guenther Kelleter

Modified:
    mISDN/trunk/drivers/isdn/hardware/mISDN/udevice.c

Modified: mISDN/trunk/drivers/isdn/hardware/mISDN/udevice.c
URL: http://svnview.digium.com/svn/thirdparty/mISDN/trunk/drivers/isdn/hardware/mISDN/udevice.c?view=diff&rev=198&r1=197&r2=198
==============================================================================
--- mISDN/trunk/drivers/isdn/hardware/mISDN/udevice.c (original)
+++ mISDN/trunk/drivers/isdn/hardware/mISDN/udevice.c Fri Nov 30 14:43:34 2012
@@ -1569,6 +1569,9 @@
 	filep->private_data = dev;
 	if (device_debug & DEBUG_DEV_OP)
 		printk(KERN_DEBUG "mISDN_open out: %p %p\n", filep, filep->private_data);
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,8)
+	nonseekable_open(ino, filep);
+#endif
 
 	mISDN_inc_usage();
 
@@ -1619,8 +1622,10 @@
 //	u_long		flags;
 	struct sk_buff	*skb;
 
-	if (*off != file->f_pos)
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,8)
+	if (off != &file->f_pos)
 		return(-ESPIPE);
+#endif
 	if (!access_ok(VERIFY_WRITE, buf, count))
 		return(-EFAULT);
 	if ((dev->minor == 0) && (count < mISDN_HEADER_LEN)) {
@@ -1708,8 +1713,10 @@
 	struct sk_buff	*skb;
 	mISDN_head_t	head;
 
-	if (*off != file->f_pos)
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,8)
+	if (off != &file->f_pos)
 		return(-ESPIPE);
+#endif
 	if (device_debug & DEBUG_DEV_OP)
 		printk(KERN_DEBUG "mISDN_write: file(%d) %p count %ld queue(%d)\n",
 			dev->minor, file, (long)count, skb_queue_len(&dev->wport.queue));




More information about the thirdparty-commits mailing list