bug in smsc_smpp.c login failure

Alan McNatty <[email protected]>
Newsgroups gmane.comp.mobile.kannel.devel
Message-ID <[email protected]>
Hello,

found that if I type in the smpp password incorrectly kannel loops
forever trying to reconnect. ie:

 [6] DEBUG: SMPP PDU 0x80f3a18 dump:
 [6] DEBUG:   type_name: bind_receiver_resp
 [6] DEBUG:   command_id: 2147483649 = 0x80000001
 [6] DEBUG:   command_status: 14 = 0x0000000e
 [6] DEBUG:   sequence_number: 732 = 0x000002dc
 [6] DEBUG:   system_id: NULL
 [6] DEBUG: SMPP PDU dump ends.
 [6] ERROR: SMPP[xxx]: SMSC rejected login to receive, code 0x0000000e.
 [6] ERROR: SMPP[xxx]: I/O error or other error. Re-connecting.

And so on .. 

The smsc_smpp.c handle_pdu notices the error (and indeed reports on it)
but it's not noticed at the io_thread level so keeps trying.

I worked around it by setting smpp->quitting = 1 after the error message
in handle_pdu (see patch) which has the effect of shutting down the
failing threads (so they don't keep trying). Crude - provided as example
only - will look at improving this. 

Also, in the instance you only have 1 smpp connection which when fails
in this way, the bearerbox sits without actually shutting down (ie:
doesn't realise there are no active threads and clean up, etc). Should
the bearerbox shutdown in this instance?

Cheers,
Alan


-- 
Alan McNatty <[email protected]>
smsc_smpp.c-fault (text/x-patch, 759 B)
Index: gw/smsc/smsc_smpp.c
===================================================================
RCS file: /home/cvs/gateway/gw/smsc/smsc_smpp.c,v
retrieving revision 1.25
diff -u -r1.25 smsc_smpp.c
--- gw/smsc/smsc_smpp.c	23 Feb 2003 11:35:34 -0000	1.25
+++ gw/smsc/smsc_smpp.c	27 Feb 2003 02:29:38 -0000
@@ -958,6 +958,11 @@
 		              "code 0x%08lx.",
                       octstr_get_cstr(smpp->conn->id),
                       pdu->u.bind_transmitter_resp.command_status); 
+
+		/* Need to die here, well just don't keep trying this connection
+		 * if the password doesn't work it never will */
+	         smpp->quitting = 1;
+
             } else { 
                 *pending_submits = 0; 
                 smpp->conn->status = SMSCCONN_ACTIVE;
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.