bug-inetutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

libicmp patch


From: Alain Magloire
Subject: libicmp patch
Date: Tue, 19 Jun 2001 00:05:47 -0400 (EDT)

Bonjour
 oops ! forgot the patches 8-)
Index: libping.c
===================================================================
RCS file: /home/cvs/inetutils/libicmp/libping.c,v
retrieving revision 1.2
diff -w -u -p -r1.2 libping.c
--- libping.c   2001/06/18 15:54:23     1.2
+++ libping.c   2001/06/19 01:41:47
@@ -1,4 +1,4 @@
-/* Copyright (C) 1998 Free Software Foundation, Inc.
+/* Copyright (C) 1998, 2001 Free Software Foundation, Inc.
 
    This file is part of GNU Inetutils.
 
@@ -44,9 +44,10 @@
 static void _ping_freebuf(PING *p);
 static int _ping_setbuf(PING *p);
 static size_t _ping_headersize(PING *p);
+static size_t _ping_packetsize(PING *p);
 
 
-size_t
+static size_t
 _ping_packetsize(PING *p)
 {
   switch (p->ping_type)
@@ -127,8 +128,6 @@ _ping_setbuf(PING *p)
 {
   if (!p->ping_buffer)
     {
-      int i;
-      
       p->ping_buffer = malloc(_PING_BUFLEN(p));
       if (!p->ping_buffer)
        return -1;
@@ -230,7 +229,7 @@ ping_recv(PING *p)
       /*FIXME: conditional*/
       fprintf(stderr,"packet too short (%d bytes) from %s\n", n,
              inet_ntoa(p->ping_from.sin_addr));
-      return;
+      return 0;
     }
 
   switch (icmp->icmp_type)
@@ -240,7 +239,7 @@ ping_recv(PING *p)
     case ICMP_ADDRESSREPLY:
       /*    case ICMP_ROUTERADV:*/
       if (icmp->icmp_id != p->ping_ident)
-       return;
+       return 0;
       if (rc)
        {
          fprintf(stderr, "checksum mismatch from %s\n",




reply via email to

[Prev in Thread] Current Thread [Next in Thread]