[asterisk-bugs] [Zaptel 0012405]: [patch] bad master selection (2 different ways)

noreply at bugs.digium.com noreply at bugs.digium.com
Fri Apr 11 16:51:21 CDT 2008


A NOTE has been added to this issue. 
====================================================================== 
http://bugs.digium.com/view.php?id=12405 
====================================================================== 
Reported By:                biohumanoid
Assigned To:                
====================================================================== 
Project:                    Zaptel
Issue ID:                   12405
Category:                   zaptel (the module)
Reproducibility:            always
Severity:                   major
Priority:                   normal
Status:                     new
Zaptel Version:             1.4.9.2 
SVN Branch (only for SVN checkouts, not tarball releases): N/A 
SVN Revision (number only!):  
Disclaimer on File?:        N/A 
Request Review:              
====================================================================== 
Date Submitted:             04-10-2008 05:44 CDT
Last Modified:              04-11-2008 16:51 CDT
====================================================================== 
Summary:                    [patch] bad master selection (2 different ways)
Description: 
Current zaptel master handling work in the following way:
The first SPAN become a master
If a new registered !!! SPAN is preferred , it is the new master
If a span is unregistered - the new master is the first available span
If master SPAN is in alarm state - the new master is the first non in
alarm state SPAN

So
1. ztdummy once loaded will be the master forever.
2. even not-running SPAN can be a master
3. master implementation is ugly...

====================================================================== 

---------------------------------------------------------------------- 
 tzafrir - 04-11-08 16:51  
---------------------------------------------------------------------- 
And to a few matters of style:

0. http://lxr.linux.no/linux/Documentation/CodingStyle

1. there are some places where the indentation is with spaces, rather than
tabs. They show up as an extra indentation in the diff. e.g. the call to
'zt_checkmaster ();' in the end.

2. In that line: please don't add an extra space after the function name.

3. in the following line, the result should be in a line of its own:
  if (span && !span->alarms && (span->flags & ZT_FLAG_RUNNING)) return 1;

"return 1" should be in a separate line.

4. Please always give a priority to a printk message.
Change:
printk("Zaptel: Master changed to %s\n"
To:
printk(KERN_INFO "Zaptel: Master changed to %s\n"

(KERN_INFO? KERN_DEBUG?) 

Issue History 
Date Modified   Username       Field                    Change               
====================================================================== 
04-11-08 16:51  tzafrir        Note Added: 0085385                          
======================================================================




More information about the asterisk-bugs mailing list