/[monit]/monit/net.c
ViewVC logotype

Diff of /monit/net.c

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

revision 1.42 by hauk, Sat Oct 18 16:46:34 2003 UTC revision 1.43 by hauk, Mon Oct 20 01:48:04 2003 UTC
# Line 611  int icmp_echo(const char *hostname, int Line 611  int icmp_echo(const char *hostname, int
611        
612    ASSERT(hostname);    ASSERT(hostname);
613    
614    if( (hp= gethostbyname(hostname)) == NULL )    if((hp= gethostbyname(hostname)) == NULL)
615      return FALSE;      return FALSE;
616    
617    if( (s= socket(AF_INET, SOCK_RAW, IPPROTO_ICMP)) < 0 )    if((s= socket(AF_INET, SOCK_RAW, IPPROTO_ICMP)) < 0)
618      return FALSE;      return FALSE;
619    
620    if( setsockopt(s, SOL_IP, IP_TTL, (char *)&ttl, sizeof(ttl)) < 0 )    if(setsockopt(s, SOL_IP, IP_TTL, (char *)&ttl, sizeof(ttl)) < 0)
621      goto error;      goto error;
622    
623    icmphdrout= (struct icmphdr *)xmalloc(sizeof(struct icmphdr));    NEW(icmphdrout);
624    icmphdrout->type= ICMP_ECHO;    icmphdrout->type= ICMP_ECHO;
625    icmphdrout->code= 0;    icmphdrout->code= 0;
626    icmphdrout->un.echo.id= getpid();    icmphdrout->un.echo.id= getpid();

Legend:
Removed from v.1.42  
changed lines
  Added in v.1.43

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