[asterisk-commits] wedhorn: trunk r340070 - /trunk/channels/chan_skinny.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Sun Oct 9 19:36:05 CDT 2011


Author: wedhorn
Date: Sun Oct  9 19:36:02 2011
New Revision: 340070

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=340070
Log:
Increase SKINNY_MAX_PACKET and add some logging.

Increase SKINNY_MAX_PACKET to 2000 bytes to handle some messages
in v17 that are greater than the old 1000 bytes. Also add some
useful logging regarding packet and session handling.

A device (with protocol v17) was sending a packet with length 
greater than 1000 which resulted in the TCP session being
destroyed and registration being retryed.


Modified:
    trunk/channels/chan_skinny.c

Modified: trunk/channels/chan_skinny.c
URL: http://svnview.digium.com/svn/asterisk/trunk/channels/chan_skinny.c?view=diff&rev=340070&r1=340069&r2=340070
==============================================================================
--- trunk/channels/chan_skinny.c (original)
+++ trunk/channels/chan_skinny.c Sun Oct  9 19:36:02 2011
@@ -166,7 +166,7 @@
 
 #define DEFAULT_SKINNY_PORT 2000
 #define DEFAULT_SKINNY_BACKLOG 2
-#define SKINNY_MAX_PACKET 1000
+#define SKINNY_MAX_PACKET 2000
 #define DEFAULT_AUTH_TIMEOUT 30
 #define DEFAULT_AUTH_LIMIT 50
 
@@ -6862,6 +6862,7 @@
 			return -1;
 		}
 		if (dlen+8 > sizeof(s->inbuf)) {
+			ast_log(LOG_WARNING, "Skinny packet too large (%d bytes), max length(%d bytes)\n", dlen+8, SKINNY_MAX_PACKET);
 			dlen = sizeof(s->inbuf) - 8;
 		}
 		*bufaddr = htolel(dlen);
@@ -6915,6 +6916,7 @@
 	for (;;) {
 		res = get_input(s);
 		if (res < 0) {
+			ast_verb(3, "Ending Skinny session from %s (bad input)\n", ast_inet_ntoa(s->sin.sin_addr));
 			break;
 		}
 
@@ -6922,6 +6924,7 @@
 		{
 			if (!(req = skinny_req_parse(s))) {
 				destroy_session(s);
+				ast_verb(3, "Ending Skinny session from %s (failed parse)\n", ast_inet_ntoa(s->sin.sin_addr));
 				return NULL;
 			}
 




More information about the asterisk-commits mailing list