[PATCH] Fix a core dump with AT2 SMSC and lost network connections in rawtcp mode

Ben Suffolk <[email protected]>
Newsgroups gmane.comp.mobile.kannel.devel
Message-ID <[email protected]>
Hi all,

I have 4 modems connected via rawtcp mode to a terminal server.

I discovered that if I reboot the terminal server (or presumably  
otherwise have a network connection failure) that bearerbox core dumps.

The following patch fixes this problem.

Regards

Ben
at2_fix_lost_connection.patch (application/octet-stream, 689 B)
Index: gw/smsc/smsc_at.c
===================================================================
RCS file: /home/cvs/gateway/gw/smsc/smsc_at.c,v
retrieving revision 1.34
diff -r1.34 smsc_at.c
197c197
<     size_t count, s;
---
>     ssize_t count, s;
230a231,235
>     else {
>         error(errno, "AT2[%s]: at2_read_buffer: Error during read", 
>               octstr_get_cstr(privdata->name));
>         at2_close_device(privdata);
>     }
636c641
<     while (time(&cur_time) <= end_time) {
---
>     while (privdata->fd != -1 && time(&cur_time) <= end_time) {
1190a1196,1200
>         if (privdata->fd == -1) {
>             reconnecting = 1;
>             goto reconnect;
>         }
>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.