/[monit]/monit/http/engine.c
ViewVC logotype

Diff of /monit/http/engine.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.67 by martinp, Sat Feb 12 11:25:23 2005 UTC revision 1.68 by martinp, Sat Feb 12 11:39:43 2005 UTC
# Line 588  static int parse_network(char *s_network Line 588  static int parse_network(char *s_network
588    net->network=inp.s_addr;    net->network=inp.s_addr;
589    
590    /* Convert short netmasks to integer */    /* Convert short netmasks to integer */
591    /* longmask has to be NULL here, so we don't need to test it */    if (longmask==NULL) {
592            
593    if ((shortmask > 32) || (shortmask < 0)) {      if ((shortmask > 32) || (shortmask < 0)) {
594                
595      goto done;        goto done;
596                
597    } else if ( shortmask == 32 ) {      } else if ( shortmask == 32 ) {
598    
599      net->mask=-1;        net->mask=-1;
600    
601    } else {      } else {
602                
603      net->mask= (1<<shortmask)-1;        net->mask= (1<<shortmask)-1;
604      net->mask= (net->mask<<(32-shortmask));        net->mask= (net->mask<<(32-shortmask));
605    
606    }      }
607    
608      } else {      
609            
610        /* Parse long netmasks */    
611        if (inet_aton(longmask, &inp) == 0) {        
612    
613          goto done;        
614    
615    net->mask=inp.s_addr;      }
616    
617        net->mask=inp.s_addr;
618    
619      }
620    
621    /* Remove bogus network components */    /* Remove bogus network components */
622    net->network&=net->mask;    net->network&=net->mask;

Legend:
Removed from v.1.67  
changed lines
  Added in v.1.68

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26