This message was generated by the Security Alerts service ( Free Trial 14th of 
August - 14th of September )
http://www.opensips.org/Resources/AlertsMain
*
SVN commit*:
http://opensips.svn.sourceforge.net/viewvc/opensips?view=revision&revision=9197

*Severity*: Medium

*Version*  : 1.8, trunk

*Affected modules*  : Dialog

*Effect*  : Distributed Load-Balacing was not working properly

*Affected scenarios*: In a distributed load-balancing setup, the LoadBalancer 
module
was not properly marking the internally-created dialog profiles as shared,
thus breaking the distributed functionality.

*Description:*  The bug was in the Dialog module. When the LoadBalancer modules 
used the
Dialog API to create distributed profiles, the Dialog module was mistakenly 
modifying
the resource name, removing the distributed marker ( /s ). When the LoadBalancer
module would search again for the profile, it couldn't be found anymore.

*Risks*  : When setting up a distributed LoadBalancer setup, each node would 
not be able
to see the other nodes load, and would end up overloading destination servers.

*Update*  :
- if you have an SVN checkout, 1.8 and trunk were fixed; so
update to a revision later than 9196 (trunk) or 9197 (1.8 branch)
- if you have OpenSIPS from sources, download and apply the patch from
http://opensips.svn.sourceforge.net/viewvc/opensips/branches/1.8/modules/dialog/dlg_profile.c?view=patch&r1=9197&r2=9196&pathrev=9197
or see the attached patch;
- if using tarballs, they were already regenerated (and include the fix)
- If using the official Debian package (apt.opensips.org), they are also
re-generated including the fix.

--
Vlad Paiu
OpenSIPS Developer
http://www.opensips-solutions.com

--- modules/dialog/dlg_profile.c	2012/08/09 16:25:25	9196
+++ modules/dialog/dlg_profile.c	2012/08/09 16:27:33	9197
@@ -374,17 +374,31 @@
 struct dlg_profile_table* search_dlg_profile(str *name)
 {
 	struct dlg_profile_table *profile;
+	char *p,*e;
+	int use_cached=0;
+	str profile_name = *name;
+
+	/* check if this is a shared profile, and remove /s for lookup */
+	p = memchr(profile_name.s, '/', profile_name.len);
+
+	if (p) {
+		e = profile_name.s + profile_name.len;
+		profile_name.len = p - profile_name.s;
+		trim_spaces_lr( profile_name );
+		/* skip spaces after p */
+		for (++p; *p == ' ' && p < e; p++);
+		if ( p < e && *p == 's')
+		use_cached=1;
+	}
 
 	for( profile=profiles ; profile ; profile=profile->next ) {
-		if (name->len==profile->name.len &&
-		memcmp(name->s,profile->name.s,name->len)==0 )
+		if (profile->use_cached == use_cached && profile_name.len ==profile->name.len &&
+		memcmp(profile_name.s,profile->name.s,profile_name.len)==0 )
 			return profile;
 	}
 	return NULL;
 }
 
-
-
 static struct dlg_profile_table* new_dlg_profile( str *name, unsigned int size,
 		unsigned int has_value, unsigned use_cached)
 {

_______________________________________________
Alerts mailing list
ale...@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/alerts
_______________________________________________
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users

Reply via email to